How can I share files from my Ubuntu Touch host with Waydroid?
-
Hello. I am using Ubuntu Touch OTA 24 with the latest Waydroid (installed today). It works decently on my Google Pixel 3a, outside of the home, back, app switcher buttons being out of reach. I primarily installed it to use Signal, along with possibly other social media apps. However, I noticed that user files such as Downloads, Pictures, Videos, etc. do not sync between Ubuntu Touch and Waydroid. I found a Waydroid FAQ article addressing this issue, but it does not work. If I run
# ls -a ~/.local/share/waydroid/data/media/0/Pictures
, in UT Terminal, for instance, I can see that the files are mounted there. However, Waydroid's file manager cannot see any of these files. Is anyone familiar enough with UT and/or Waydroid to help me sync/symlink or mount folders from my UT host so that Waydroid can see them? I'd love to be able to share a Downloads folder and a Photo gallery. Any help is appreciated! -
@triguy said :
I found a Waydroid FAQ article addressing this issue, but it does not work.
I believe this faq is for waydroid on linux desktop systems, but UT is not one of them, it doesn't work the same way concerning files management and apps (confined), plus waydroid is a particular case, it runs a lineage in a contener.
-
@keneda Thank you. Yeah, it definitely seems to handle the filesystem differently, which is understandable. I'll try the Termux hack for now, I suppose. Thanks again!
-
@triguy
You're welcome
What is the "Termux hack" if that can help other waydroid users ? -
@triguy
Hi, can you explain the "Termux hack"?
Thanks! -
So far I haven't been able to find a way to link Waydroid to UbuntuTouch. This post is still set to unresolved. If someone has posted a solution it would be nice if it could be linked here.
Tried a lot and came up with the following dirty solution to be able to exchange at least a few files.
$sudo ln -s /home/phablet/.local/share/waydroid/data/media/0/Download /home/phablet/waydroid/Download $ls -la lrwxrwxrwx 1 phablet phablet 57 Feb 11 03:45 Download -> /home/phablet/.local/share/waydroid/data/media/0/Download chmod -R 777 /home/phablet/.local/share/waydroid/data/media/0/Download reboot $sudo su #cd /home/phablet/waydroid/Download #ls FilesfromWaydroid.*
What do you think about this idea?
Edit: I use a script for syncing this folder with
sudo rsync -a
to a local folder. -
@keneda
Is this the "Termux hack"?
https://forums.ubports.com/topic/7820/share-data-between-ub-and-waydroid/7 -
@chris_bavaria
My post ?!?
I don't think so lol. -
@keneda
No, 1 post above from user isndwx
Have you tried this "hack"? -
@chris_bavaria
Non i didn't try it.
And yes, it looks like it is the "termux hack" thing. -
This post is deleted! -
Adding mount entries to the lxc containers doesn't work properly either because of permission problems. The folder can only be accessed as root inside the container even if all have read and execute permission.
I have tried to map user and group id from the container to the host (32011 -> 1023) which seem like it could resolve permission issues but I couldn't make it work.
What I did:
- Remount root:
sudo mount -o remount,rw /
- Install
uidmap
:sudo apt update && sudo apt install uidmap
. - Adding a line
phablet:1023:1
to/etc/subuid
and/etc/subgid
. Not sure if it should be a 1 or 0 as I want to map only one id. - Add lines
lxc.idmap = u 1023 32011 0
andlxc.idmap = g 1023 32011 0
to/var/lib/waydroid/lxc/waydroid/config
. Not ideal because it get reset on reboot.
It result in the following error:
lxc-start: waydroid: conf.c: lxc_map_ids: 3668 newuidmap failed to write mapping "newuidmap: uid range [1023-1023) -> [32011-32011) not allowed": newuidmap 3312 1023 32011 0
. I don't know what is missing. - Remount root:
-
Update:
The correct lines in/etc/subuid
and/etc/subgid
isroot:32011:1
.However it still won't work with this error:
lxc-start: waydroid: cgroups/cgfsng.c: cgfsng_chown: 1353 No such file or directory - Error requesting cgroup chown in new user namespace
.I can't make it work on my desktop either with the same error.
-
using bind mounts in UT works on my FP4/OTA-1 (focal) without touching any permission settings etc as described in the waydroid documentation:
https://docs.waydro.id/faq/setting-up-a-shared-folder
for example:
sudo mount --bind ~/Documents ~/.local/share/waydroid/data/media/0/Documents sudo mount --bind ~/Downloads ~/.local/share/waydroid/data/media/0/Download sudo mount --bind ~/Music ~/.local/share/waydroid/data/media/0/Music sudo mount --bind ~/Pictures ~/.local/share/waydroid/data/media/0/Pictures sudo mount --bind ~/Videos ~/.local/share/waydroid/data/media/0/Movies
allows sharing files in those directories between UT and waydroid both ways.
The one missing feature is making the bind mounts permanent. I added them to /etc/fstab but changes to that file don't seem to survive a reboot.
edit: I realize you did link to this and mentioned it doesn't work on xenial, I still posted here to let people know it can work on focal
-
It work now but permissions are still an issue without proper user and group mapping. Also it won't work if the binded directory is on another device (sd card) but it might work on a more recent version of lxc due to this merge request: https://github.com/lxc/lxc/pull/4200
-
@patlefort
You're right, permissions are not working properly yet. I didn't really notice as I have only used it for reading existing files yet -
For some workarounds for copying files in both directions have a look at the 'is copy paste possible' topic quite a way down the topics within waydroid'
I (treebeard) posted several methods. They are a bit unconventional but may make life easier for some.
Also they may give ideas for providing a permanent solution
-
@triguy said in How can I share files from my Ubuntu Touch host with Waydroid?:
on my Google Pixel 3a, outside of the home, back, app switcher buttons being out of reach
For others on Google Pixel 3a, this worked for me to get the back, home, and switch button raised up a bit so they could be accessed:
waydroid prop set persist.waydroid.height_padding 100
See documentation here