UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Shared folder with r/w access

    Scheduled Pinned Locked Moved Waydroid
    3 Posts 2 Posters 1.6k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      This topic has been deleted. Only users with topic management privileges can see it.
      • I Offline
        isndwx
        last edited by isndwx

        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-folder

        sudo 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?

        KenedaK 1 Reply Last reply Reply Quote 2
        • KenedaK Offline
          Keneda @isndwx
          last edited by Keneda

          @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.

          2015-2023 : Meizu MX4 ☠️⚰️✝️
          2023-2024 : Nexus 5 ☠️⚰️✝️
          2024-***** : FPOS Fairphone 5 waiting UT for freedom 😉
          🇲🇫🇬🇧

          I 1 Reply Last reply Reply Quote 0
          • I Offline
            isndwx @Keneda
            last edited by

            @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-possible

            mkdir -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/WaydroidHome

            It 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-host

            Container 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 64535

            But that does work on a standard ubuntu installation, not on ubuntu touch, because there are different uids and gids.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post