Shared folder with r/w access
-
Hello, I am a fresh owner of a Volla Phone with Ubuntu Touch installed. I installed Waydroid with the app Waydroid Helper. It works good and i have no problems to use android apps.
For a better experience i would like to mount a shared folder, to share files. Both, the filemanager of Ubuntu Touch and Waydroid should have read and write access to this folder.
I found this solution:
https://docs.waydro.id/faq/setting-up-a-shared-foldersudo mount --bind <source> ~/.local/share/waydroid/data/media/0/<target>
But I didn't get it to work. So I searched and found this solution:
lxc.mount.entry = <source> data/media/0/<target> none bind,rw 0 0
I added this line to the lxc configuration file config_nodes and it worked. I can now move files in Waydroid to the folder and have this files in the Ubuntu Touch home directory source folder. The problem is now, that i have now no write access to this folder. The owner and group changed form phablet:phablet to 1023:1023 and i cannot change owner and group with chown. For instance I mounted the filesystem of Ubuntu Touch r/w.
I found out, that the problem is to map uids and gids. This is done with idmap in the lxc config file, but this very complicate. Does someone know how to do or managed this already?
-
@isndwx said in Shared folder with r/w access:
sudo mount --bind <source> ~/.local/share/waydroid/data/media/0/<target>
If i understand well the link this command comes from, it only allows to copy from host (gnu/linux) to waydroid contener folders, not the other way.
Plus, but maybe i'm wrong, only folders from "phablet" one (the ones you see or can create in file explorer just after launch without unlocking restricted access), should be used.
-
@keneda
Thank you for your reply.
I tried it also with the download folder from ubuntu touch. It has the same affect. The download folder becomes a new owner and group: 1023:1023 and the host (ubuntu touch) has no write access any more. I can only read the files. But apps in waydroid have read and write access.
I tried it also like explained here:
https://forums.ubports.com/topic/7296/is-a-copy-paste-possiblemkdir -p /home/phablet/WaydroidHome
chown phablet:phablet /home/phablet/WaydroidHome
chmod -R 755 /home/phablet/WaydroidHome
sudo chmod -R 777 ~/.local/share/waydroid/data/media/0
sudo mount --bind ~/.local/share/waydroid/data/media/0 /home/phablet/WaydroidHomeIt works, but it works only one time. After reboot i must make all steps again.
Ok, i could make a upstart script for that. For now i installed a samba server on ubuntu touch and have now access to the shared folders in waydroid.Here is the way to go:
https://askubuntu.com/questions/610513/how-do-i-share-a-directory-between-an-lxc-container-and-the-hostContainer specific configuration:
lxc.idmap = u 0 165536 1000
lxc.idmap = g 0 165536 1000
lxc.idmap = u 1000 1000 1
lxc.idmap = g 1000 1000 1
lxc.idmap = u 1001 166536 64535
lxc.idmap = g 1001 166536 64535But that does work on a standard ubuntu installation, not on ubuntu touch, because there are different uids and gids.