linuxdeploy
linuxdeploy copied to clipboard
How to share LinuxDeploy file system with Android?
I have found that I can mount Android files (at least /sdcard) for access inside of LinuxDeploy and that's great. But I am trying to figure out how to give Android access to the LInuxDeploy containter's file system. This used to work via /data/local/linux but I see nothing like that anywhere.
Don't really want to setup Samba under LinuxDeploy: (a) not sure how, (b) already have an SMB server running under Android.
Suggestions/tips?
Thanks
I just checked and my older system is using LD version 1.5.x and in the container setup for type=file it shows an entry for chroot file and this is /data/local/linux and this is what I am looking for.
Have things changed enough with the newer version 2.x that I have on my new box that this is no longer the case? I remain confused.
Excuse me @whitedavidp, was just wondering if you send through what you did to get Android files working within Linux Deploy? Am having a bit of trouble getting this to work and would appreciate some guidance.
Excuse me @whitedavidp, was just wondering if you send through what you did to get Android files working within Linux Deploy? Am having a bit of trouble getting this to work and would appreciate some guidance.
Sorry, but I have not. One "solution" would be to run a SMB server inside of the Linux deploy container. But I really don't want to go there. I am not sure if using a container type other than "File" (which is what I am using) would make any difference. It used to be easy as pie.
This used to work via /data/local/linux but I see nothing like that anywhere.
On my device the disk image is mounted on /data/local/mnt/. I'm on v2.6. You can see if it's the same on your device.
what you did to get Android files working within Linux Deploy?
Set your mount configuration in: configuration > Mounts > Mount points
you can set source to diskimage or directory . Though for sdcard you might have to add some special groups to your non root user to have proper access.
On my device the disk image is mounted on /data/local/mnt/. I'm on v2.6. You can see if it's the same on your device.
Thanks! I just checked. LD is currently running. There is nothing in /data/local/mnt (or anywhere else I have looked). This is version 2.6.0-259 on Android 9.0 rooted, of course.
The running profile is Ubuntu Trusty, the install type is File, and the install path is on my external SD card's root in a file called linux.img. Android mount points are enabled and I have / mounted to /storage/android-fs. In an ssh shell to LD and as root I can change dir to /storage/android-fs but I cannot access /sdcard and many other dir's. I do see /data/local/linux from within LD. But this is not visible from Android.
Thanks for your help and time.
This (or something quite similar - in an older version of LD) worked on another device which I upgrade to this one. The Android was far older - like 4.4.2, I think.
what you did to get Android files working within Linux Deploy?
Set your mount configuration in: configuration > Mounts > Mount points
you can set source to diskimage or directory . Though for sdcard you might have to add some special groups to your non root user to have proper access.
Thanks! I just checked. LD is currently running. There is nothing in /data/local/mnt
humm . Maybe check output of
mount
It should print mount points of all mounted devices .
I do see /data/local/linux from within LD. But this is not visible from Android.
Not even a root ? that's strange ..
I have / mounted to /storage/android-fs. In an ssh shell to LD and as root I can change dir to /storage/android-fs but I cannot access /sdcard and many other dir's.
Try adding your user in LD to groups like 'aid_sdcard_rw' and 'aid_media_rw' .
Thanks! I just checked. LD is currently running. There is nothing in /data/local/mnt
humm . Maybe check output of
mount
Thanks again. So in an ssh terminal into running LD:
android@localhost:~$ sudo mount
/dev/block/loop0 on / type ext4 (rw,seclabel,relatime,data=ordered)
proc on /proc type proc (rw,relatime)
sys on /sys type sysfs (rw,seclabel,relatime)
tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,mode=755)
tmpfs on /dev/shm type tmpfs (rw,seclabel,nosuid,nodev,relatime)
devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600,ptmxmode=000)
/dev/root on /storage/android-fs type ext4 (ro,seclabel,relatime,data=ordered)
This last line above would seem to be LD mounting my configured mount point.
And within a terminal running in Android on the same device:
:/ $ su -c mount
/dev/root on / type ext4 (ro,seclabel,relatime,data=ordered)
devtmpfs on /dev type devtmpfs (rw,seclabel,relatime,size=1978528k,nr_inodes=182352,mode=755)
tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,mode=755)
devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600,ptmxmode=000)
none on /dev/stune type cgroup (rw,nosuid,nodev,noexec,relatime,schedtune)
none on /dev/cpuctl type cgroup (rw,nosuid,nodev,noexec,relatime,cpu)
none on /dev/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset,noprefix,release_agent=/sbin/cpuset_release_agent)
cg2_bpf on /dev/cg2_bpf type cgroup2 (rw,nosuid,nodev,noexec,relatime)
adb on /dev/usb-ffs/adb type functionfs (rw,relatime)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,seclabel,relatime)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
/sys/kernel/debug on /sys/kernel/debug type debugfs (rw,seclabel,relatime,mode=755)
tracefs on /sys/kernel/debug/tracing type tracefs (rw,seclabel,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime)
pstore on /sys/fs/pstore type pstore (rw,seclabel,nosuid,nodev,noexec,relatime)
tmpfs on /mnt type tmpfs (rw,seclabel,nosuid,nodev,noexec,relatime,mode=755,gid=1000)
/dev/block/param on /mnt/vendor/param type ext4 (rw,seclabel,nosuid,nodev,noatime,nodelalloc,errors=panic,data=ordered)
/dev/block/tee on /mnt/vendor/tee type ext4 (rw,seclabel,nosuid,nodev,noatime,nodelalloc,errors=panic,data=ordered)
/data/media on /mnt/runtime/default/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid,default_normal)
/data/media on /mnt/runtime/read/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=23,derive_gid,default_normal)
/data/media on /mnt/runtime/write/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=7,derive_gid,default_normal)
/dev/block/vold/public:179,129 on /mnt/media_rw/10EC-0C0C type vfat (rw,dirsync,nosuid,nodev,noexec,noatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
/mnt/media_rw/10EC-0C0C on /mnt/runtime/default/10EC-0C0C type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,mask=6)
/mnt/media_rw/10EC-0C0C on /mnt/runtime/read/10EC-0C0C type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,mask=18)
/mnt/media_rw/10EC-0C0C on /mnt/runtime/write/10EC-0C0C type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,mask=18)
/dev/block/odm on /odm type ext4 (ro,seclabel,relatime,block_validity,delalloc,barrier,user_xattr,acl,inode_readahead_blks=8)
/dev/block/product on /product type ext4 (ro,seclabel,relatime,block_validity,delalloc,barrier,user_xattr,acl,inode_readahead_blks=8)
/dev/block/vendor on /vendor type ext4 (ro,seclabel,relatime,data=ordered,inode_readahead_blks=8)
none on /acct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct)
none on /config type configfs (rw,nosuid,nodev,noexec,relatime)
/dev/block/data on /data type ext4 (rw,seclabel,nosuid,nodev,noatime,nodelalloc,resgid=1065,errors=panic,data=ordered)
/dev/block/cache on /cache type ext4 (rw,seclabel,nosuid,nodev,noatime,nodelalloc,errors=panic,data=ordered)
/dev/block/metadata on /metadata type ext4 (rw,seclabel,nosuid,nodev,noatime,nodelalloc,errors=panic,data=ordered)
tmpfs on /storage type tmpfs (rw,seclabel,nosuid,nodev,noexec,relatime,mode=755,gid=1000)
/data/media on /storage/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid,default_normal)
/mnt/media_rw/10EC-0C0C on /storage/10EC-0C0C type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,mask=6)
tmpfs on /storage/self type tmpfs (rw,seclabel,nosuid,nodev,noexec,relatime,mode=755,gid=1000)
:/ $
I am not sure I see anything that helps ME (but I am a rank amatuer).
It should print mount points of all mounted devices . > I do see /data/local/linux from within LD. But this is not visible from Android. Not even a root ? that's strange .. > I have / mounted to /storage/android-fs. In an ssh shell to LD and as root I can change dir to /storage/android-fs but I cannot access /sdcard and many other dir's. Try adding your user in LD to groups like 'aid_sdcard_rw' and 'aid_media_rw' .
Well, I might try this. But I am looking around as root. So I think I should be seeing everything despite permissions, etc.
Cheers and thanks again.
Is it rooted with magisk ? Do you have mount namespace mode set to global . There's a similer settings on SuperSu too .
To be quite honest, I cannot say. On all my other rooted devices I always have used the global mount namespace. This is with both superSu and Magisk. But the device in question here is a Minix Neo U22-XJ and it comes pre-rooted (controlled by a switch in the settings - which, of course, I have enabled). I have posted a question to the support forum at Minix and can report back if someone responds to my query. Thanks!