Desktop Environment Setup
This guide walks through installing the XFCE desktop environment inside your Ubuntu installation, configuring it to work with Termux:X11, and creating a launch script to start everything with a single command.
XFCE (XForms Common Environment) is a lightweight, full-featured desktop environment designed to be fast and low on system resources while remaining visually appealing and easy to use. It provides everything you expect from a desktop -- a panel, file manager, window manager, application menu, and system tray -- without the heavy memory and CPU demands of environments like GNOME or KDE Plasma.
For ADL, XFCE is the ideal choice for several reasons:
- Low resource usage -- XFCE typically uses 200-400MB of RAM at idle, leaving more memory available for your applications. On devices with 4-8GB of RAM, this matters significantly.
- Full desktop functionality -- despite being lightweight, XFCE includes a complete set of desktop tools: a file manager (Thunar), a terminal emulator, a text editor, a screenshot tool, and a settings manager.
- Stability -- XFCE has a long track record of reliable releases. It rarely crashes or introduces breaking changes, which is important when running on top of proot.
- Customizability -- panel layout, keyboard shortcuts, window behavior, and themes can all be adjusted through graphical settings dialogs.
For a deeper explanation of XFCE, how it compares to other desktop environments, and its architecture, see What is XFCE?.
Prerequisitesโ
Before starting, confirm the following:
- Ubuntu is installed via proot-distro and you can log in with
proot-distro login ubuntu - Termux:X11 is installed (both the Android APK and the
termux-x11-nightlypackage in Termux) - You have a working internet connection for downloading packages
- At least 3GB of free storage space on your device
You will be switching between two environments during this guide: the Termux shell (where you see a $ prompt) and the Ubuntu shell inside proot-distro (where you see root@localhost). Pay close attention to which environment each command should be run in -- running a command in the wrong environment is one of the most common setup mistakes.
If you have not yet installed Termux:X11, refer to Termux:X11 Setup for installation instructions. Samsung devices may silently block the Termux:X11 APK โ if the installer closes without installing the app, see Termux:X11 APK will not install on Samsung devices.
Step 1: Install XFCE Packagesโ
Log into Ubuntu from Termux. Your prompt should show root@localhost.
proot-distro login ubuntuFirst, update the package lists to make sure you are pulling the latest versions:
apt update && apt upgrade -yNow install XFCE along with its extras and the D-Bus X11 integration package:
apt install xfce4 xfce4-goodies dbus-x11 -yThis is the largest download in the entire ADL setup process. Expect approximately 800MB of packages to download and around 2-3GB of disk space to be used after installation. On a typical mobile connection, this takes 10-20 minutes. On Wi-Fi, it usually completes in 5-10 minutes. You will see extensive output as hundreds of packages download and configure. When finished, you are returned to the root prompt with no errors.
Here is what each package provides:
- xfce4 -- the core desktop environment including the window manager (xfwm4), the panel, the session manager, and the settings daemon.
- xfce4-goodies -- a collection of additional tools and panel plugins including a screenshot tool, a task manager, a clipboard manager, additional themes, and extra panel widgets. This is optional but strongly recommended.
- dbus-x11 -- provides the
dbus-launchcommand, which is required to start a proper desktop session. Without it, many XFCE components fail to communicate with each other.
Make sure your device has at least 3GB of free storage before running this installation. If you are low on storage, you can skip xfce4-goodies and install only xfce4 and dbus-x11, which reduces the footprint by roughly 500MB.
Step 2: Install Fontsโ
Without proper fonts installed, many applications display squares, question marks, or blank spaces instead of text. This is especially common with non-Latin scripts, but even some English-language interfaces rely on fonts that are not included in a minimal Ubuntu installation.
apt install fonts-noto fonts-noto-cjk -yThe font packages download approximately 150-200MB. After installation, applications render text correctly across Latin, CJK (Chinese, Japanese, Korean), and other writing systems. You see the package installation output followed by a return to the root prompt.
- fonts-noto -- Google's Noto font family, designed to cover all Unicode scripts. This ensures that every character has a visible glyph rather than appearing as a missing-character box.
- fonts-noto-cjk -- additional Noto fonts specifically for Chinese, Japanese, and Korean characters. These are large but necessary if you work with any CJK content, including some emoji and symbols that fall within CJK Unicode ranges.
If you need to minimize download size and only use Latin-script languages, you can install just fonts-noto and skip fonts-noto-cjk, saving roughly 100MB.
Step 3: Configure D-Busโ
D-Bus (Desktop Bus) is a message system that allows desktop applications to communicate with each other and with system services. In a typical Linux installation, D-Bus starts automatically at boot. Inside proot, there is no init system to start it, so it must be launched manually as part of the desktop startup process.
The dbus-launch command (provided by the dbus-x11 package installed in Step 1) handles this. It starts a D-Bus session bus and sets the necessary environment variables so that all applications launched afterward can find and use it.
Create the D-Bus machine ID, which some applications require:
dbus-uuidgen > /var/lib/dbus/machine-idNo visible output. The command silently creates a unique identifier file. You can verify it exists by running cat /var/lib/dbus/machine-id, which displays a 32-character hexadecimal string.
Create the D-Bus runtime directory:
mkdir -p /run/dbusThe D-Bus machine ID only needs to be generated once. It persists across sessions because the Ubuntu filesystem inside proot-distro is preserved between logins.
Step 4: Create the Launch Scriptโ
This is the most important step. The launch script ties everything together -- it starts the Termux:X11 display server, sets the display variable, and launches Ubuntu with XFCE in a single command.
This script must be created in Termux, not inside Ubuntu. Exit Ubuntu first by typing exit to return to your Termux prompt (you should see a $ prompt instead of root@localhost).
Create the launch script:
nano ~/start-desktop.shEnter the following content:
Save the file in nano by pressing Ctrl+O, then Enter to confirm, then Ctrl+X to exit.
Step 5: Make the Script Executableโ
chmod +x ~/start-desktop.shNo visible output. The command silently adds execute permission to the script file. You can verify by running ls -l ~/start-desktop.sh and confirming that the permissions include x (for example, -rwxr-xr-x).
Step 6: Test the Launchโ
Before running the script, open the Termux:X11 app on your Android device. It will display a black screen with a message about waiting for a connection -- this is normal.
Switch back to Termux and run the launch script:
~/start-desktop.shAfter a few seconds, switch to the Termux:X11 app. You should see the XFCE desktop loading. The first launch includes a setup dialog asking you to choose between an empty panel and a default panel layout. Select "Use Default Config" to get the standard XFCE panel at the top of the screen with an application menu, task list, and system tray.
If the desktop loads successfully, you have a working Linux desktop environment on your Android device. You can open applications from the Applications menu in the top-left corner of the panel.
To stop the desktop session, log out from XFCE through its menu (Applications > Log Out) or switch back to Termux and press Ctrl+C.
After confirming that the desktop loads successfully, consider adding a Termux widget shortcut or a bash alias to launch the script more conveniently. For example, you can add alias desktop="~/start-desktop.sh" to your ~/.bashrc file in Termux so that typing desktop starts the environment.
The first launch is noticeably slower than subsequent launches. XFCE generates configuration files, caches, and thumbnails on initial startup, which can take 15-30 seconds on mid-range devices. After the first launch, startup typically takes 3-8 seconds. If your device has a slower processor (such as a MediaTek Helio or older Snapdragon), expect longer initial load times but comparable performance once the desktop is fully loaded.
Troubleshootingโ
Next Stepโ
Your desktop environment is installed and running. Continue to Audio Setup to configure sound output so that applications inside Ubuntu can play audio through your Android device.