• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
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.0k 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.
    • T Offline
      triguy
      last edited by 13 Dec 2022, 05:10

      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!

      K C U 3 Replies Last reply 13 Dec 2022, 05:33 Reply Quote 1
      • K Offline
        Keneda @triguy
        last edited by Keneda 13 Dec 2022, 05:33

        @triguy
        Check there maybe ^^

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

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

        T 1 Reply Last reply 13 Dec 2022, 05:44 Reply Quote 0
        • T Offline
          triguy @Keneda
          last edited by 13 Dec 2022, 05:44

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

          K C 2 Replies Last reply 13 Dec 2022, 05:48 Reply Quote 0
          • K Offline
            Keneda @triguy
            last edited by Keneda 13 Dec 2022, 05:48

            @triguy
            You're welcome 😉
            What is the "Termux hack" if that can help other waydroid users ?

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

            C 1 Reply Last reply 15 Feb 2023, 14:42 Reply Quote 2
            • C Offline
              chris_bavaria @triguy
              last edited by 12 Feb 2023, 17:31

              @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 2 Dec 2023, 19:04 12 Feb 2023, 18:46

                @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 15 Feb 2023, 14:42

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

                  K 1 Reply Last reply 16 Feb 2023, 18:59 Reply Quote 0
                  • K Offline
                    Keneda @chris_bavaria
                    last edited by 16 Feb 2023, 18:59

                    @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 16 Feb 2023, 20:34 Reply Quote 0
                    • C Offline
                      chris_bavaria @Keneda
                      last edited by 16 Feb 2023, 20:34

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

                      K 1 Reply Last reply 17 Feb 2023, 00:06 Reply Quote 0
                      • K Offline
                        Keneda @chris_bavaria
                        last edited by 17 Feb 2023, 00:06

                        @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 13 Mar 2023, 21:11 Reply Quote 1
                        • P Offline
                          patlefort @Keneda
                          last edited by 13 Mar 2023, 21:11

                          This post is deleted!
                          1 Reply Last reply Reply Quote 0
                          • P Offline
                            patlefort
                            last edited by 15 Mar 2023, 03:30

                            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 29 Mar 2023, 00:46 Reply Quote 0
                            • P Offline
                              patlefort @patlefort
                              last edited by 29 Mar 2023, 00:46

                              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 4 May 2023, 06:46 5 Apr 2023, 06:40

                                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 7 Apr 2023, 02:09 Reply Quote 4
                                • P Offline
                                  patlefort @gandalf
                                  last edited by 7 Apr 2023, 02:09

                                  @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 12 Apr 2023, 13:36 Reply Quote 0
                                  • G Offline
                                    gandalf @patlefort
                                    last edited by 12 Apr 2023, 13:36

                                    @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 13 Apr 2023, 19:25

                                      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 14 Aug 2023, 19:09

                                        @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