proot icon indicating copy to clipboard operation
proot copied to clipboard

proot error: ptrace(TRACEME): Operation not permitted

Open 0142929 opened this issue 5 years ago • 11 comments

hi all. i try to install fedora using termux-fedora.sh script, and got error. by way, i can not install any distro, only bare termux works. do anybody knows how to resolve this errors? thanks.

#---- All done! Start Fedora with 'startfedora'. Get updates with regular 'dnf update'. $ startfedora proot error: ptrace(TRACEME): Operation not permitted proot error: execve("/usr/bin/env"): Operation not permitted proot info: It seems your kernel contains this bug: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1202161 To workaround it, set the env. variable PROOT_NO_SECCOMP to 1. fatal error: see proot --help. proot error: can't chmod '/data/data/com.termux/files/usr/tmp/proot-8730-guNUhN': No such file or directory

#----

$ export PROOT_NO_SECCOMP=1

#-----

` $ startfedora proot error: ptrace(TRACEME): Operation not permitted proot error: execve("/usr/bin/env"): Operation not permitted proot info: possible causes:

  • the program is a script but its interpreter (eg. /bin/sh) was not found;
  • the program is an ELF but its interpreter (eg. ld-linux.so) was not found;
  • the program is a foreign binary but qemu was not specified;
  • qemu does not work correctly (if specified);
  • the loader was not found or doesn't work. fatal error: see proot --help. proot error: can't chmod '/data/data/com.termux/files/usr/tmp/proot-8997-VCvZXy': No such file or directory `

#----

using docomo(fujitsu) f-04k, android 9. #---- $ uname -a Linux localhost 3.18.120-gc4b7f3a #1 SMP PREEMPT Fri Feb 7 06:12:24 JST 2020 aarch64 Android

0142929 avatar May 23 '20 13:05 0142929

docomo f-04k, was upgraded today to android 10, but nothing changed. and any script or proot-distro give same result. proot error: ptrace(TRACEME): Operation not permitted

so, it seems to me that the problem is in proot and not in android...

0142929 avatar Jul 31 '20 16:07 0142929

ptrace(TRACEME) is very early in proot startup and would indicate that this device won't be able to run proot, though to be sure please check if you're able to use strace in Termux on that device (If strace also fails then proot won't be able to run, if strace works then probably this needs to be fixed on proot side)

michalbednarski avatar Aug 02 '20 15:08 michalbednarski

thanks for the answer, i try strace, but do not know how exactly test it in termux.

$ strace ls strace: test_ptrace_get_syscall_info: PTRACE_TRACEME: Operation not permitted strace: ptrace(PTRACE_TRACEME, ...): Operation not permitted strace: PTRACE_SETOPTIONS: Operation not permitted strace: detach: waitpid(5262): No child processes strace: Process 5262 detached $

0142929 avatar Aug 02 '20 15:08 0142929

So strace also doesn't work on that device (otherwise it wouldn't fail on tracing ls), so I think proot won't be able to work there either.

michalbednarski avatar Aug 02 '20 15:08 michalbednarski

then strace and proot does not work in this android, but maybe there are any other ways to run other linux distributions without root? or other proot run method...

0142929 avatar Aug 02 '20 16:08 0142929

@0142929 If ptrace() is fully SELinux'ed on your device, then only available method is to use emulators like qemu. It doesn't use special features which can be subject for restrictions on Android.

ghost avatar Aug 02 '20 16:08 ghost

it is unlikely that qemu will work in android, but i hope to find something. thanks for answers.

0142929 avatar Aug 02 '20 16:08 0142929

it is unlikely that qemu will work in android

It is available in Termux repo and works with no issues for Android 7.0 - 11.0 (emulation only, no KVM).

ghost avatar Aug 02 '20 18:08 ghost

i will try this, thanks

0142929 avatar Aug 02 '20 18:08 0142929

Hello. I had the same issuse here. Im trying to run termux with the BlueStacks

The first error:

proot error: ptrace(TRACEME): Operation not permitted
proot error: execve("/data/data/com.termux/files/usr/bin/tar"): Operation not permitted
proot info: It seems your kernel contains this bug: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1202161
To workaround it, set the env. variable PROOT_NO_SECCOMP to 1.
fatal error: see `proot --help`.

After i set PROOT_NO_SECCOMP to 1:

proot error: execve("/data/data/com.termux/files/usr/bin/tar"): Operation not permitted
proot info: possible causes:
  * the program is a script but its interpreter (eg. /bin/sh) was not found;
  * the program is an ELF but its interpreter (eg. ld-linux.so) was not found;
  * the program is a foreign binary but qemu was not specified;
  * qemu does not work correctly (if specified);
  * the loader was not found or doesn't work.
fatal error: see `proot --help`.

ptrace(TRACEME) is very early in proot startup and would indicate that this device won't be able to run proot, though to be sure please check if you're able to use strace in Termux on that device (If strace also fails then proot won't be able to run, if strace works then probably this needs to be fixed on proot side)

I tried that. Firstly the strace wasnt installed so i installed it and strace works here.

WizardlyBump17 avatar Nov 23 '21 13:11 WizardlyBump17

I'm having this is issue for official proot-distros. strace doesn't work. What's the underlying issue? What kind of ROM/Kernel is needed to make it work? Is there any other workaround?

devmsv avatar Aug 18 '22 16:08 devmsv