Proot: Ubuntu
Relevant source files
The following files were used as context for generating this wiki page:
The Ubuntu Proot implementation within the Termux-Desktops project provides a method to run a full Ubuntu Linux distribution on Android devices without requiring root access. It leverages proot-distro, a user-space implementation of chroot, mount, and binfmt_misc, to create an isolated environment where users can install standard Linux packages and Desktop Environments (DE).
Sources: README.md:52-58, Documentation/proot/ubuntu_proot.md:20-25
This module is part of a broader collection of scripts designed to launch various Linux environments with full audio support and optional hardware acceleration via Termux X11. It serves as a moderate-performance alternative to Termux Native and Chroot methods, offering high compatibility with standard Linux applications.
Sources: README.md:1-4, README.md:68-81
Installation and Setup
Setting up an Ubuntu Proot environment requires a specific sequence of package installations within the base Termux application followed by the distribution-specific configuration.
Initial Package Requirements
Before installing the Ubuntu distribution, several core components must be present in Termux to handle the display, audio, and containerization.
| Package | Purpose |
|---|---|
x11-repo | Provides repository access for X11 related tools |
termux-x11-nightly | The X server for Android display output |
pulseaudio | Handles audio streaming from the proot environment |
proot-distro | The management tool for proot containers |
wget | Utility for downloading setup scripts |
Sources: Documentation/proot/ubuntu_proot.md:21-25, README_old.md:179-185
Distribution Deployment Flow
The following diagram illustrates the lifecycle of setting up the Ubuntu environment from within Termux.
The user first installs the management tools, downloads the Ubuntu image, and performs initial administrative setup like creating users and updating repositories.
Sources: Documentation/proot/ubuntu_proot.md:27-37, README_old.md:187-198
Desktop Environments
The project supports multiple desktop environments within the Ubuntu Proot container, with specific configurations for GNOME and XFCE4.
GNOME Installation
GNOME requires specific workarounds due to its dependency on systemd-related components (like login1) which do not exist in the proot environment.
- Package Installation:
sudo apt install dbus-x11 ubuntu-desktop -y - Login1 Fix: A loop must be executed to remove files containing "login1" to prevent startup failures.
- Snapd Disablement: Since
snapdis incompatible with the Termux environment, it is pinned to a negative priority to prevent APT from installing it.
Sources: Documentation/proot/ubuntu_proot.md:46-77, README_old.md:214-230
XFCE4 and Others
Other environments such as XFCE4, Mate, and LXDE follow standard installation patterns similar to the Debian Proot implementation. XFCE4 is noted for being efficient and using fewer resources.
Sources: Documentation/proot/ubuntu_proot.md:92-98, Documentation/proot/debian_proot.md:82-89
Execution Scripts
The project provides specialized shell scripts to bridge the gap between the Proot container and the Termux X11 display server.
The scripts automate the setting of environment variables such as DISPLAY=:0 and PULSE_SERVER=tcp:127.0.0.1:4713 to ensure the GUI and audio are routed correctly to the Android host.
Sources: Documentation/proot/ubuntu_proot.md:39-43, README_old.md:232-235, Documentation/chroot/ubuntu_chroot.md:120-125
Hardware Acceleration
Performance in Ubuntu Proot can be enhanced through various hardware acceleration drivers, specifically VirGL, Zink, and Turnip.
Driver Configuration
Users can choose between different drivers based on their hardware (specifically Adreno GPUs).
| Driver | Description | Command Variable |
|---|---|---|
| VirGL | Virtual OpenGL renderer | GALLIUM_DRIVER=virpipe |
| Zink | OpenGL over Vulkan | GALLIUM_DRIVER=zink |
| Turnip | Vulkan driver for Adreno 6XX/7XX | MESA_LOADER_DRIVER_OVERRIDE=zink |
Sources: Documentation/HardwareAcceleration.md:45-65
Performance Logic
To use acceleration, a graphical server must be initialized in Termux before logging into the Ubuntu Proot.
Critical Configuration and Fixes
| Issue | Resolution |
|---|---|
| Snap Packages | Must be disabled via /etc/apt/preferences.d/nosnap.pref because snapd requires a kernel not available on Android. |
| GNOME Startup | Requires removal of *login1* files using find /usr -type f -iname "*login1*" -exec rm -rf {} \;. |
| Browser Support | Firefox is recommended via the mozillateam/ppa for the ESR version, as the default Ubuntu version is often a snap package. |
Sources: Documentation/proot/ubuntu_proot.md:65-87, README_old.md:214-230