termux / proot

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

proot info: vpid 1: terminated with signal 4 #82

Open RohitPingale opened 5 years ago

RohitPingale commented 5 years ago

I was trying to setup proxy chain for kali linux in termux

root@localhost:~# wget https://kuburan.github.io/kuburan-repo.sh -2019-11-01 02:00:33-- https://kuburan.github.io/kuburan-repo.sh Resolving kuburan.github.io (kuburan.github.io)... 185.199.110.153, 185.199.108.153, 185.199.111.153, ... Connecting to kuburan.github.io (kuburan.github.io)|185.199.110.153|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 1646 (1.6K) [application/x-sh] Saving to: ‘kuburan-repo.sh’

kuburan-rep 0% 0 --.-KB/s kuburan-rep 100% 1.61K --.-KB/s in 0.001s

2019-11-01 02:00:34 (1.77 MB/s) - ‘kuburan-repo.sh’ saved [1646/1646]

root@localhost:~ chmod +x kuburan-repo.sh root@localhost:~ ./kuburan-repo.sh bash: ./kuburan-repo.sh: /data/data/com.termux/files/usr/bin/sh: bad interpreter: No such file or directory

To solve this, I followed termux-chroot from here But now i am getting this errors

$ls binds start-ubuntu.sh ubuntu.sh kali-armhf storage kalinethunter ubuntu-fs $./start-ubuntu.sh proot info: vpid 1: terminated with signal 4 proot error: trying to remove a directory outside of '/data/data/com.termux/files/usr/tmp', please report this error. $startkali proot warning: can't sanitize binding "/sys/": No such file or directory proot info: vpid 1: terminated with signal 4 proot error: trying to remove a directory outside of '/data/data/com.termux/files/usr/tmp', please report this error.

I am not able to enter in my linux distro. How to fix this?

michalbednarski commented 5 years ago

In general, nesting proot doesn't work well, so you should exit termux-chroot before running ./start-ubuntu.sh

./kuburan-repo.sh should work without termux-chroot, looks like you system has $PREFIX/bin/sh missing, you might need to apt install dash

RohitPingale commented 5 years ago

apt install dash didnt work. I opened the .sh file the shebang say it required sh interpretor `GNU nano 3.2 kuburan-repo.sh

!/data/data/com.termux/files/usr/bin/sh`

But in $PREFIX/usr/bin sh is symlink to dash lrwxrwxrwx. 1 root root 4 Jul 18 18:15 sh -> dash I think this is the reason of the error, How to fix that?

michalbednarski commented 5 years ago

Error indicates that execve failed with ENOENT, so sh either does not exist, is broken symbolic link, or specifies non-existent file as its dynamic linker

Dash executable can be inspected using file command

$ file $PREFIX/bin/sh
/data/data/com.termux/files/usr/bin/sh: symbolic link to dash
$ file -L $PREFIX/bin/sh
/data/data/com.termux/files/usr/bin/sh: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /system/bin/linker, stripped

In particular on Termux/Android there should be interpreter /system/bin/linker in result of second command (or linker64 in case of 64 bit device)

Try apt update && apt install --reinstall dash which will reinstall dash from Termux repository.

If for some reason you're unable to make dash to work you always run scripts with bash (such as using bash ./start-ubuntu.sh instead of ./start-ubuntu.sh)

hamid12121 commented 4 years ago

Use nh -r

Bridges369 commented 2 years ago

in my device I can run termux commands and "proot-distro" command, but when I run on ssh it doesn't work

$ proot-distro login ubuntu
bash: /usr/bin/lesspipe: /bin/sh: bad interpreter: No such file or directory
proot info: vpid 1: terminated with signal 4
zcheese1 commented 1 year ago

This usually happens when you're attempting to setup a Linux chroot with an other architecture. (Ex. Your phone supports aarch64, but you're having amd64)

mogiliraviraj commented 10 months ago

~ $ ./start-ubuntu.sh proot info: vpid 1: terminated with signal 4 ~ $ ls proot-log.txt ubuntu-binds ubuntu.sh.1 start-ubuntu.sh ubuntu-fs storage ubuntu.sh

How to overcome this error

mogiliraviraj commented 10 months ago

This usually happens when you're attempting to setup a Linux chroot with an other architecture. (Ex. Your phone supports aarch64, but you're having amd64)

Bro then how to fix this error

sylirre commented 10 months ago

@mogiliraviraj Where did you get the ubuntu setup script and whats your output of uname -m?