termux / proot

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

--shared-tmp do not work on Chromebook Android 9.0 version #285

Closed JanuszChmiel closed 10 months ago

JanuszChmiel commented 10 months ago

Problem description

When I Am using Termux version 0.119.1 available from The apkcombo site. And when I Am running this version of Termux on my Chromebook with Intel X64 Bit processor. Proot-distro and its --shared-tmp option do not allow Me to use Xvnc or Termux-x11 which run on Termux app. As a result, app do not work, it simply hang with no error messages. Is it possible to use Xvnc or Termux-x11 on Termux from Linux distro executed by using Proot also on Chromebooks? I know, that Chrome books are using Kqemu and virtual machine which host Android kernel and all necessary Android operating system components. May be, that this special variant of Android which run on Chromebooks is limited and it do not allow to share data between Proot and Termux app. https://apkcombo.com/termux/com.termux/

Steps to reproduce

I ave installed Termux 119 from The apk combo site by using adb command on My Linux virtual machine. After I have installed Termux 119, I have applied distribution upgrade. pkg update pkg upgrade When operating system has asked Me if I want to replace some configuration file by its new version, I have always answerred y Yes so all necessary changes was applied to The appropriate configuration files. Then I have installed my favourite Open ssh and proot-distro pkg install proot-distro openssh I have setup Termux login password by using passwd I have started Openssh by typing sshd I have connected to The termux session by using my second computer. I have installed debian proot-distro install debian I have run apt update apt dist-upgrade I have installed pluma text editor for testing. apt install pluma I have installed Termux-x11 latest available Beta release with multiple architectuure .so libraryes also for X86 X64.

I have enabled X11 repository on termux. And I have installed Termux-x11 nightly pkg install termuxx11-nightly I have installed Termux-x11 on my chromebook by using adb. I have started Termux-x11 from my Chromebook launcher. I have started debian to add janusz user name proot-distro login debian adduser janusz I have successfully completed janusz user account creation steps. I have terminated Debian exit I have started Termux-x11 companion from Termux shell by typing termux-x11 : & proot-distro login --user janusz debian --shared-tmp su janusz export DISPLAY=:0 pluma & Pluma load process hangs and no action appear.

Expected behavior

Pluma should be normally loaded or any available X11 app as on normal Android device which run standard non virtualised Android kernel.

Additional information

JanuszChmiel commented 10 months ago

~ $ termux-info Termux Variables: TERMUX_APK_RELEASE=GITHUB TERMUX_APP_AM_SOCKET_SERVER_ENABLED=true TERMUX_APP_PACKAGE_MANAGER=apt TERMUX_APP_PACKAGE_VARIANT=apt-android-7 TERMUX_APP_PID=5597 TERMUX_IS_DEBUGGABLE_BUILD=1 TERMUX_MAIN_PACKAGE_FORMAT=debian TERMUX_VERSION=0.119.1 Packages CPU architecture: x86_64 Subscribed repositories:

sources.list

deb https://packages-cf.termux.org/apt/termux-main/ stable main

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.39.0 Android version: 9 Kernel build information: Linux localhost 5.10.184-22867-gd7349b18658c #1 SMP PREEMPT Tue Aug 29 19:10:21 PDT 2023 x86_64 Android Device manufacturer: Google Device model: grunt LD Variables: LD_LIBRARY_PATH= LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so ~ $

twaik commented 10 months ago

Latest version is 0.118.0. The version you are using is probably malicious. It is recommended to remove it immediately.

sylirre commented 10 months ago

Why do you thing --shared-tmp is not working?

Run under Termux command touch $PREFIX/tmp/shared-tmp-test and then inside PRoot Distro ls -ld /tmp/shared-tmp-test. If file is available, then option work. If you get an error, then doesn't work.

Since this option is handled by PRoot Distro and not PRoot itself, in case if it really doesn't work I would like to see full trace of proot-distro:

bash -x proot-distro login --user janusz debian --shared-tmp

Yes, the 0.119.1 version was never released. Neither was released also 0.119.0. Do not install Termux outside of official distribution pages such as our GitHub or F-Droid. Reminding that Termux is open source and everyone can forge own releases with app name Termux and Android package name com.termux using our debug testkey.

The variable TERMUX_APK_RELEASE=GITHUB of termux-info is not proof of authenticity and is applicable to all user forged builds.

JanuszChmiel commented 10 months ago

But it uses very advanced technique. If The Pulseaudio play some multimedia data if an incoming phone call or Skype call occur, Termux my used version stop The Pulseaudio output. I will listen to your recommendation and I will rather stop to using this version 119. Somebody has added it to The app combo. But shared tmp has worked even on this malicious version on The phone. I even do not observe strange incoming phone calls or similar instalibity of The system. OK, I will be using version 118.0.

JanuszChmiel commented 10 months ago

But there is very important programmers advanced question. Is it technically possible to use The --shared-tmp option if user will use Termux, Proot and Android which is The part of Chromebook computer? If no, it will be good idea for Me to accept this fact and I will be only using those procedures for standard Android devices.

JanuszChmiel commented 10 months ago

I AM very sorry. I have came to The wrong assumption, that apps do not work thanks to wrong shared TMP support. I have installed Tigervnc to Termux I have executed Tigervnc from Termux by typing Xvnc :0 -SecurityTypes None & Then I have used BVNC Pro from GOogle Play store. I have connected successfully. And when I run dbus-run-session mate-session & from Fedora I Am getting The following output to The terminal but Mate modules are not being initialized. janusz@localhost ~]$ dbus-run-session mate-session &
[1] 18616
[janusz@localhost ~]$ client(600000): Reserved pid(18618).
client(600000): Reserved cmdname(mate-session) and cmdargs(NULL).
AllocNewConnection: client index = 3, socket fd = 10, local = 1
client(800000): Reserved pid(18618).
client(800000): Reserved cmdname(mate-session) and cmdargs(NULL).
AllocNewConnection: client index = 4, socket fd = 11, local = 1
client(800000): Released pid(18618).
client(800000): Released cmdline(mate-session) and cmdargs(NULL).

But no info about Dbus initialize various modules and Mate is not loaded. Also other apps refuses to work. some interprocess communication is break. GBut I do not know why? May be, that X64 Bit .so libraryes for Termux do not have all functions implemented. Or Chromium OS security routines are blocking some inter process communication. Very strange reality. It is not good, because I can not run X11 apps from Termux by using Proot. I have discovered, that all Termux apps which are not being executed by using Proot work smoothly. Including Vlc, ETC. So very probably, if AN distro which have been executed by using Proot want to transfer some data by using sockets for transferring data related to some graphical pp proces is being stopped. But Pulseaudio work on Termux,if AN app executed by Proot send some data. But if powerful Google company have implemented such tasks to their kernel, I must tell Proot and Proot-distro good bye on Chromebooks.