-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running Desktop Env from proot (and DeX) #14039
Comments
Fold 4 user here. I have debian and xfce4 working just fine here. Let me run though my initial setup. Disabling Android 12+ background process limitYou must disable the background limit otherwise termux will crash eventually and it will be near impossible to run a proot distro at all let alone x11 apps. At the time of writing I have Android 12 and One UI 4.1.1. You can disable this background process limit quite easily even without a dedicated computer to run android-tools on with a adb settings flag. More information about that can be found from here: https://github.com/agnostic-apollo/Android-Docs/blob/master/en/docs/apps/processes/phantom-cached-and-empty-processes.md#commands-to-disable-phantom-process-killing-and-tldr The flag persists across reboots but you may need to undo the flag later for system updates by setting it back to true. The standard wayWould be to connect your device to a computer with android-tools installed, notably
From within termuxBut you can set the process limit flag from inside termux itself using adb wireless. Make sure you have only settings app and termux running, close everything else first. In termux you will want to install 'android-tools' and 'fakeroot' Then enable wireless debugging in developer menu, this is only Android 11+, you can get a pair code and everything. Settings > Developer Options > Wireless Debugging > Pair Code. You have to tap next to the switch to get into the menu where it will allow you to pair with a code once the option is turned on. Take note of the pair code and the port code it gives you in the menu, back in termux you'll need to run the following to connect first.
Once connected you can then disable the flag with
Starting from a freshly installed termux environmentOPTIONAL: you can clear a existing termux install by clearing the termux app data in android settings but backup what you want first. Installing what's neededEnsure termux is up to date
Install termux-x11, follow the guide presented at the main page https://github.com/termux/termux-x11Extra note, be sure to install the included .deb file in the termux system, not under the proot. Setting up prootYou'll want to install the utility proot-distro, it makes this process so much easier. I won't go into everything with proot-distro here but I did the following personally. This is just a idea of what to do, there maybe extra packages you want to install or even a different distro you might want to use. This is just literally what I did for my setup.
From inside the new proot shell Launching everythingFirstly you'll want to make sure I find that you might have to force close the termux-x11 companion app before or after each session to get things to launch correctly. I basically barrowed the script that @waldhef posted here termux/termux-x11#138 (comment) But I came across this for dbus, If you want audio to work you need to install pulseaudio inside of termux My updated script that works for me is below
Save as whatever you'd like, I called my file start-xfce.sh. Swap out with the user you created earlier, if you didn't you will probably want to. Make sure to give the file inside termux executable permissions. and then launch it.
As mentioned earlier, make sure termux-x11 companion app isn't running before running the script, it may fail if the termux-x11 app isn't running fresh. When you are finished with a session and want to close out of everything. Log out in your desktop environment, force close the termux-x11 app, and type |
Screen_Recording_20221221_200022_TermuxX11.mp4Video of it working |
Not related to |
This comment was marked as outdated.
This comment was marked as outdated.
This is amazing @ShapeShifter499 ! I should update my original posting to reflect this perhaps, but your guide essentially made my whole day/month/year. Some notes/comments? I can't seem to reliably get Another fun "struggle"... getting any DE other than Have you had success with any DE other than |
I had not heard of
The only other desktop environment I've tried with so far was Gnome. I couldn't get it working and it is possible it might not work unmodified as it's starting to rely more and more on SystemD. SystemD unmodified can't run in proot as it wants to start as PID 1. I've seen some efforts online to get Gnome working without SystemD but I've not tried those yet. But for the most part Gnome apps and others should work fine in XFCE as long as they don't rely on SystemD or dbus. For example I was using A cool thing to note. If you have set up android file permissions for termux and run That auto bind feature for the storage can be disabled by passing |
Have the same issue with running XFCE on a Surface Go 2/BlissOS with Debian proot. Can also render Firefox in termux-x11 (with poor performance), but when running |
Closing this as inactive. |
Abstract
Running a Desktop Env (DE) from within a
termux
proot
intermux-x11
is desirable for many reasons. Aproot
will often be a more complete and "standard" Linux experience offering many more X11 applications than currently available in stocktermux
. Currently, however, this is problematic, as in my anecdotal experience I can't seem to run any DE from theproot
, with success only if thetermux
host runs the DE. While a closed older issue did address running a DE from aproot
, the solution no longer seems to be working.Introduction
I've been trying (and failing) to successfully and reliably run a desktop env (DE) from within a
proot-login
. The reasons forproot-login
DE ability are of course obvious -- aproot
, being a more "conventional" Linux installation, offers considerably more DE envs and X11 applications than the standardtermux
env which only seems to havexfce4
and very few X11 apps (nofirefox
/thunderbird
for example).Sources
There are several documented solutions (none of which work for me as of late November 2022). Most relevant is the closed issue #138 but there are others -- udroid and various postings on reddit of varying utility here, I thought to open an issue here as a central place to keep track.
Environment
My setup is a Samsung Galaxy Z Fold 3, hooked up to an external monitor that triggers DeX. By default, any attempt at running
termux-x11
or even somevnc
type solution will almost always die within a few minutes being killed by Android. A hack solution seems to be settingmax_phantom_processes
-- see here and a solution here.Previously proposed solution (not fully working for reasons unknown)
The core solution offered entails running/starting the
termux-x11
Xwayland
server intermux
, and then sharing the relevant UNIX domain socket that is created in thetermux
$XDG_RUNTIME_DIR
with theproot
environment. In this manner, X11 apps in theproot
can communicate with theXwayland
server instance.In summary, in
termux
:Now, enter the
proot
. Critically, note the--shared-tmp
flag -- this is the magic sauce that allows theproot
to share the sametmp
directory ($XDG_RUNTIME_DIR
) between the host andproot
):Obviously, in my above example, my
proot
is an Arch linux chroot. Now, in thisproot
, assuming I have installedxfce4
, the concept is to simply runxfce4-session
and it should connect to theXwayland
server running in the hosttermux
:(Note that some documentation erroneously indicates to run
env DISPLAY=:0 startxfce4
-- howeverstartxfce4
is a wrapper that tries to start an X server. Since an Xserver is already running in the host, this will result in anX server already running
error).Observed behaviour
I haven't been able to ever get the
xfce4
(or any other DE) started in theproot
to connect to the hostXwayland
. What has worked for me is to run/start the DE intermux
. Sincetermux
only seems to offerxfce4
this is the only environment possible:Now, in the
xfce4
DE, I can open aterminal
and within that terminal I canproot-distro login archlinux --shared-tmp
. At this point, I'm in a DE in thetermux
, but my terminal is now open onto theproot
. I can thenwhich runs the
firefox
from theproot
and displays on thetermux
Xwayland
.Oddities?
Any application in the
proot
that wants to communicate ondbus
seems to fail. Luckilyfirefox
doesn't usedbus
but many other modern apps do (sognome-terminal
won't work, butterminator
will). This limits the space of available applications considerably, but does hint at the fact thatdbus
communication might be the issue?I have tried many permutations, without success:
UID
in theproot
to be the sameUID
as in thetermux
host. Doesn't helpchmod 777 /tmp/dbus*
to see if I can speak todbus
from theproot
. Doesn't helpOther annoyances
termux-x11
"window" opens full screen (without the DeX window decoration), but the colors seem "washed out". I can close the window and reopen it, and the colors seem fine, but the annoying Dex top window bar returns.termux-x11
always seems to have a very annoying button bar at the bottom withEsc
, and what looks like cursor directions. I can't seem to get rid of this and it is very annoying.The text was updated successfully, but these errors were encountered: