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

    How can I share files from my Ubuntu Touch host with Waydroid?

    Scheduled Pinned Locked Moved Unsolved Waydroid
    18 Posts 7 Posters 3.1k Views 4 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.
      • C Offline
        chris_bavaria @triguy
        last edited by

        @triguy
        Hi, can you explain the "Termux hack"?
        Thanks!

        Redmi Note 9 pro (UT 20.04 OTA-5) with Legion5 (Ubuntu 23.10)

        1 Reply Last reply Reply Quote 1
        • C Offline
          chris_bavaria @triguy
          last edited by chris_bavaria

          @triguy

          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.

          Redmi Note 9 pro (UT 20.04 OTA-5) with Legion5 (Ubuntu 23.10)

          1 Reply Last reply Reply Quote 0
          • C Offline
            chris_bavaria @Keneda
            last edited by

            @keneda
            Is this the "Termux hack"?
            https://forums.ubports.com/topic/7820/share-data-between-ub-and-waydroid/7

            Redmi Note 9 pro (UT 20.04 OTA-5) with Legion5 (Ubuntu 23.10)

            KenedaK 1 Reply Last reply Reply Quote 0
            • KenedaK Offline
              Keneda @chris_bavaria
              last edited by

              @chris_bavaria
              My post ?!?
              I don't think so lol.

              2015-2023 : Meizu MX4 ā˜ ļøāš°ļøāœļø
              2023-2024 : Nexus 5 ā˜ ļøāš°ļøāœļø
              2024-***** : FPOS Fairphone 5 waiting UT for freedom šŸ˜‰
              šŸ‡²šŸ‡«šŸ‡¬šŸ‡§

              C 1 Reply Last reply Reply Quote 0
              • C Offline
                chris_bavaria @Keneda
                last edited by

                @keneda
                No, 1 post above from user isndwx :beaming_face_with_smiling_eyes:
                Have you tried this "hack"?

                Redmi Note 9 pro (UT 20.04 OTA-5) with Legion5 (Ubuntu 23.10)

                KenedaK 1 Reply Last reply Reply Quote 0
                • KenedaK Offline
                  Keneda @chris_bavaria
                  last edited by

                  @chris_bavaria
                  Non i didn't try it.
                  And yes, it looks like it is the "termux hack" thing.

                  2015-2023 : Meizu MX4 ā˜ ļøāš°ļøāœļø
                  2023-2024 : Nexus 5 ā˜ ļøāš°ļøāœļø
                  2024-***** : FPOS Fairphone 5 waiting UT for freedom šŸ˜‰
                  šŸ‡²šŸ‡«šŸ‡¬šŸ‡§

                  P 1 Reply Last reply Reply Quote 1
                  • P Offline
                    patlefort @Keneda
                    last edited by

                    This post is deleted!
                    1 Reply Last reply Reply Quote 0
                    • P Offline
                      patlefort
                      last edited by

                      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 and lxc.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.

                      P 1 Reply Last reply Reply Quote 0
                      • P Offline
                        patlefort @patlefort
                        last edited by

                        Update:
                        The correct lines in /etc/subuid and /etc/subgid is root: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.

                        1 Reply Last reply Reply Quote 0
                        • G Offline
                          gandalf
                          last edited by gandalf

                          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 šŸ‘‹

                          P 1 Reply Last reply Reply Quote 4
                          • P Offline
                            patlefort @gandalf
                            last edited by

                            @gandalf

                            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

                            G 1 Reply Last reply Reply Quote 0
                            • G Offline
                              gandalf @patlefort
                              last edited by

                              @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 šŸ˜•

                              1 Reply Last reply Reply Quote 0
                              • T Offline
                                treebeard
                                last edited by

                                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

                                2015 BQ Aquaris E4.5
                                2021 Volla Phone (Ubuntu Touch)
                                2023 Volla Phone X23 (Ubuntu Touch)

                                1 Reply Last reply Reply Quote 0
                                • U Offline
                                  uphone @triguy
                                  last edited by

                                  @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

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