termux / proot

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

[Bug]: proot into container folder - accessing binaries and scripts 'cannot execute: required file not found' #301

Closed nathaneltitane closed 3 months ago

nathaneltitane commented 3 months ago

Problem description

Apologies in advance if this indeed an issue with my scripted routine

Cannot run any bound directory script,binary or utility through proot from container (Debian 12) - any attempt at calling any utility that resides under $PREFIX/bin ends in '...: cannot execute: required file not found' I have stripped my container-session script to hardcoded defaults to remove any possibility of it being the script and i still get the same issue.

This problem was not present a couple of months ago - matter of fact, I implemented termux-x11/virgl rendering in full into 'container-session' around late may 2024 / beginning june 2024 and it was running just fine.

Ref.: https://github.com/nathaneltitane/dextop

'container-session' : https://github.com/nathaneltitane/dextop/blob/main/container-session

Steps to reproduce

run session-basic script enter session attempt running any binary/script/utility that resides under $PREFIX/bin (ex.: termux-x11)

session-basic = stripped down version of container-session (script is in tar)

session-basic.tar.gz

Expected behavior

Running termux-x11 steps to a graphical interface or accessing any script, utility or binary from the 'termux side' of the install ($PREFIX/bin) should run normally and without rror as long as all requirements are fulfilled (architecture, libraries, etc)

Additional information

Termux Variables:
TERMUX_API_VERSION=0.50.1
TERMUX_APK_RELEASE=GITHUB
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=16831
TERMUX_IS_DEBUGGABLE_BUILD=1
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.1
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://packages-cf.termux.dev/apt/termux-main/ stable main
# root-repo (sources.list.d/root.list)
deb https://packages-cf.termux.dev/apt/termux-root/ root stable
# x11-repo (sources.list.d/x11.list)
deb https://packages-cf.termux.dev/apt/termux-x11/ x11 main
Updatable packages:
All packages up to date
termux-tools version:
1.43.2
Android version:
13
Kernel build information:
Linux localhost 4.19.113-27114284 #1 SMP PREEMPT Tue May 14 14:20:57 +07 2024 aarch64 Android
Device manufacturer:
samsung
Device model:
SM-T970
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
Installed termux plugins:
com.termux.x11 versionCode:15
com.termux.gui versionCode:7
com.termux.shell_loader versionCode:1
com.termux.api versionCode:51
com.termux.tasker versionCode:6
com.termux.styling versionCode:30

Normal behavior of a session when dextop is installed and running normally (Termux side, no proot or container)

https://github.com/user-attachments/assets/81b214bf-893c-4120-b53b-91df4e9153c3

Termux setup (green prompt runs perfectly fine, as expected)

Accessing the container side (red/fuschia prompt) results:

https://github.com/user-attachments/assets/505212ae-877e-4127-b333-4d0cc13f4114

Expected: container session should normally trigger the virgl server and termux-x11 the same way that it does on the termux side.

Biswa96 commented 3 months ago

calling any utility that resides under $PREFIX/bin ends in '...: cannot execute: required file not found'

Try to use strace -f to find which file is not found.

nathaneltitane commented 3 months ago

calling any utility that resides under $PREFIX/bin ends in '...: cannot execute: required file not found'

Try to use strace -f to find which file is not found.

missing.txt

EDIT: as stated above, any attempt at accessing any file under $PREFIX/bin results in that error - the binds are functional and BASH autocomplete does find the references: ex. typing termu..[TAB] does give all termux-* utils.