termux / proot

An chroot-like implementation using ptrace.
https://wiki.termux.com/wiki/PRoot
Other
781 stars 160 forks source link

su: permission denied when trying to launch ubuntu on proot-distro #117

Closed kickturn closed 4 years ago

kickturn commented 4 years ago

$ proot-distro install ubuntu [*] Installing Ubuntu 20.04... [*] Creating directory '/data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/ubuntu'... [*] Using cached rootfs tarball... [*] Extracting rootfs, please wait... [*] Writing '/data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/ubuntu/etc/profile.d/termux-proot.sh'... [*] Creating a source for fake /proc/stat file for SELinux restrictions workaround... [*] Creating a source for fake /proc/version file for SELinux restrictions workaround... [*] Writing resolv.conf file (NS 1.1.1.1/1.0.0.1)... [*] Writing hosts file... [*] Registering Android-specific UIDs and GIDs... [*] Running distro-specific configuration steps... [*] Installation finished.

Now run \'proot-distro login ubuntu\' to log in.

$ proot-distro login ubuntu su: Permission denied

This is what I'm getting when I install and launched ubuntu from proot-distro. I also tried other apps such as userlAnd but that doesnt work either, gives me function not implemented. so what's the fix for this?

I am doing this on a Lenovo Chromebook 500e 2nd Gen. It has a intel x86_64 arch.

ghost commented 4 years ago

Is this work for you:

unset LD_PRELOAD
proot -0 -w / -r /data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/ubuntu /bin/bash

Or this?

unset LD_PRELOAD
proot -0 -w / -r /data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/ubuntu /bin/su -l
ghost commented 4 years ago

Also try with export PROOT_NO_SECCOMP=1.

kickturn commented 4 years ago

$ export PROOT_NO_SEECOMP=1 $ proot-distro login ubuntu su: Permission denied $ unset LD_PRELOAD $ proot -0 -w / -r /data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/ubuntu /bin/bash bash: cannot make pipe for command substitution: Function not implemented root@localhost:/# exit (i didnt do this, it exited on its own) $ proot-distro login ubuntu
su: Permission denied $ unset LD_PRELOAD $ proot -0 -w / -r /data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/ubuntu /bin/su -l su: Permission denied $ proot-distro login ubuntu
su: Permission denied None of those worked.

ghost commented 4 years ago

This is some variation of https://github.com/termux/proot/issues/68.

kickturn commented 4 years ago

I noticed something on that

$ uname -a Linux Kali x86_64 GNU/Linux

My chromebook is x86_64, and probably his/her from that. So i assume there's something not working on x86_64 chromebooks.

michalbednarski commented 4 years ago

Looks like there was quite a few syscalls that were denied by Android seccomp but needed on x86_64, you can now test fix by building proot from master branch, I'll be pushing update to apt repository in few days if everything is ok

kickturn commented 4 years ago

I'll report back asap thanks

SDRausty commented 4 years ago

@powerprompt try:

sed -i "s/required/sufficient/g" /etc/pam.d/su
sed -i "s/^#auth/auth/g" /etc/pam.d/su
kickturn commented 4 years ago

The new update looks like it work, no errors.

Compile the new thing, install with make install and then set 'PROOT_NO_SECCOMP=1' environment variable.(other wise the error comes back)

echo "export PROOT_NO_SECCOMP=1" >> .bashrc && hash -r

other than that there is no error that pops up! Thanks!!

kickturn commented 4 years ago

I had to reinstall termux and now it doesnt seem to compile? I installed cmake and make and git only on this. It worked the other time

$ make make: [GNUmakefile:146: .check_process_vm] Error 1 (ignored) make: [GNUmakefile:146: .check_seccomp_filter] Error 1 (ignored) GEN build.h CC cli/cli.o ./cli/cli.c:27:10: fatal error: 'talloc.h' file not found

include / talloc, */

     ^~~~~~~~~~

1 error generated. make: *** [GNUmakefile:187: cli/cli.o] Error 1 rm .check_seccomp_filter.o .check_process_vm.o

ghost commented 4 years ago

pkg in libtalloc before compiling proot.

QkiZMR commented 1 year ago

I have exactly same problem on Termux and Ubuntu. It was working some time ago. Now when I try to run proot-distro login ubuntu I'm getting same error. Archlinux is working fine.