How can I share files from my Ubuntu Touch host with Waydroid?
-
@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