termux / proot

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

What if I would use The following command line options when mounting not only Debian chroot by using Proot? #94

Open JanuszChmiel opened 4 years ago

JanuszChmiel commented 4 years ago

Debian and Dbus can work relatively well even while using complex multi process communication between several proceses at The same time, Dbus can not work reliably for app apps. Because I have not so good brain like MR Bednarski and others, my task have been focused on finding articles from other absolvents of informatic sciences. And I have got A little succes. But I Am not sure, if Proot will support The idea from The article. What would happen, if Ubuntu launching script, Debian and Arch Linux launching script would also contain The following series of command line options?

command+=" -b proc /proc proc/" command+=" -b /sys sys/" command+=" -b /tmp tmp/" command+=" -b /var/run/dbus run/dbus/" command+=" -b /var/lib/dbus var/lib/dbus/" command+=" -b /run/user run/user/" And here is The source of The article which have inspired Me to give you this question. I want to behave fear to all members of this community.

https://box.matto.nl/chrootxapp.html Do you think, that command line ooptions from this article can help Dbus to work better in chroots? I would like to emphasize important Dbus related command from The article.

dbus-launch --autolaunch=cat /var/lib/dbus/machine-id

ghost commented 4 years ago

command+=" -b /tmp tmp/" command+=" -b /var/run/dbus run/dbus/" command+=" -b /var/lib/dbus var/lib/dbus/" command+=" -b /run/user run/user/"

This will not work as such directories do not exist in Android OS. I'm suggesting to remove these bindmountings.

You may leave the line with /tmp if you want to share the one from host (Termux), but in such case you to modify it:

command+=" -b $PREFIX/tmp:/tmp"

And use full paths for target directory, for example tmp/ replace with /tmp.

JanuszChmiel commented 4 years ago

Oh so it is not good idea. Since it will not mean, that folders will be available for running Linux distro bz using Proot. it only mean, that those files or folders will be also accessible directly from Termux shell. So Proot do not work exactly as mount and I can not mount iportant folders for running Linux distro which is being executed by using Proot? I have also finally found out, that it is even possible to use service dbus start but I must modify default user name inside Dbus config file which is not Root it is some name which is not being used on my system. So may be, that it would be The best approach to run Dbus as service.

ghost commented 4 years ago

it only mean, that those files or folders will be also accessible directly from Termux shell.

Then correct syntax is:

command+=" -b $PREFIX/var/run/dbus:/run/dbus"
command+=" -b $PREFIX/var/lib/dbus:/var/lib/dbus"

Directory $PREFIX/run/user is not exist in Termux because systemd is not used.

So Proot do not work exactly as mount and I can not mount iportant folders for running Linux distro which is being executed by using Proot?

Why you need to mount them ? Do you think that Termux has dbus running ?

If you need to use D-Bus from Termux environment, a package dbus from x11-repo is necessary and -b $PREFIX/var/run/dbus:/run/dbus should be replaced with -b $PREFIX/tmp:/run/dbus due to different session socket directory.

Guide from https://box.matto.nl/chrootxapp.html only shows how to run an X application from chrooted environment on Linux host. It is not applicable to Termux.

JanuszChmiel commented 4 years ago

Oh, so I have not found good article. I AM getting Dbus errors from some X11 apps and I have been wrong and I have thought, that The article will help Me. I will try to edit Dbus config file from Ubuntu 19.10 ARM664 Bit edition. Original Chroot container from Canonical LTD did not worked as it should. Internet connection did not work. I have got bugs and I could not run apt update. So I have upgraded other container from 18.04 to 19.10 release by adding data to /etc/apt/sources.list As A result, I have Ubuntu 19.10 ARM64 with full Internet support. I will use Pluma text editor to find wrong user name od Dbus configuration file. But may be, that service dbus start will not work in Userspace mode of Linux so my work is also may be redundand.

michalbednarski commented 4 years ago

Dbus can not work reliably for app apps.

I have no idea what you mean by that. Please post which app had what behaviour. Error messages are important but are not substitute for reproduction steps


Internet connection did not work.

If internet connection doesn't work inside proot it usually means that DNS needs to be configured. Usually scripts installing proot distro do this, but if you've installed manually or particular installation script didn't do that you'd need to run following command in guest system

echo nameserver 1.1.1.1 > /etc/resolv.conf
JanuszChmiel commented 4 years ago

Thank you very much for yours advice. Lets have professionally Debian based script as our software base to setup reliable Dbus connection on Debian chroot.

https://github.com/sp4rkie/debian-on-termux

Sure. The first important question is, if Debian debootstrap setup all Dbus related thinks or if is it task which must be done as target Debian user. What I have allready found out?

To save Proot work times, I will use xserver-xorg-video-dummy instead of XVFB. I will continue to use X11vnc package. Because I do not see at all, picture is not important and it would save CCPU time, because Android client VNC app should only display empty screen. In fact, Android client app will be used XKB protocol to manage keyboard shortcuts. Sosproc/proc/stat GPU will not be used so ntensively. I have found amazing fact. when I Am using startx and when I Am using Openbox instead of Marco, It is possible to switch between windows by pressing ALT+ESC. Because fortunately, Openbox can work even without access to /proc/stat file. Yes, work around work, but it is better to use window manager which uses other technique than Marco. Next important fact. I AM even able to use Mozilla Firefox on Ubuntu 19.10 ARM64 Bit edition including full hot keys support from Orca. There are no intensive warnings about graphics critical issues from Firefox components. My console which uses SSH show minimal bugs. I could not use Firefox when I have used XVFB. By other words, full XORG will have singificant accessibility improvements. So is it necessary to manually setup installed Debian so Dbus will start correctly< Or is it allready correctly preconfigured by debootstrap? Sure. There is big problem that even after Android 8.0 update, Proot workaround must be still used. I do not want to shut id down, because it could cause other issues related to partial case file system insensitivity. So Pokedata workaround is finally not required by my model for now, which significantly improved load time of apps. But because kernel update did not fixed wrongly formateed internal file system, there is work around needed. As A result, Proot randomly display bug when startx have been executed. I will write exact bug on my next E-mail. Work around slow down The apps execution, so in some times, Dbus timeouts can be exceeded. Sure. It is also not A tragedy. It is possible to slightly increase some configuration values inside Dbus configuration files. By other words, if I would have device, which would not require Proot work around active at all, app execution speed would be even much more faster than now. But fortunately, AAndroid 8 update have brought Pokedata repair. So Proot is not being forced to use Pokedata work round and case file system insensitivity work around at The same time. By other words. If I will use real Xorg not XVFB I will be able to use much more accessible X11 apps with Orca. Dummi driver suppress error messages related to graphical bugs when working Firefox. Which also save some CPu time.

I only need to know, if it is necessary to setup Dbus manually after installing Debian so it will work reliably when using various X11 based GTK apps. Such as Ubuntu system updater or Language installation tool. .

JanuszChmiel commented 4 years ago

Because X11vnc have problems to find cookie file automatically, I have no idea how to fix it, when I run startx as root I Am getting The following bug from Proot.

proot warning: can't set tracee registers in workaround no such process The most sadness is, that XVFB do not ause this bug, but it send graphical output by using VNC protocol.

But some times, startx randomly cooperate with XVFB. Very strange issues.

JanuszChmiel commented 4 years ago

Oh. Finallz I Am able to run Xorg and X11vnc reliably find magic cookie file. I simply type xinit & and it is all. In this case, Proot do not display warning about work around and everythink work perfectly.