Proot: Arch Linux
Relevant source files
The following files were used as context for generating this wiki page:
Arch Linux within the Termux-Desktops project is implemented using PRoot, a user-space implementation of chroot, mount --bind, and binfmt_misc. This allow users to run a full Arch Linux distribution on Android without requiring root access by intercepting system calls to simulate a different root directory.
The system integrates with Termux:X11 for graphical output and PulseAudio for sound, allowing for the installation and execution of complex desktop environments such as XFCE4, KDE Plasma, and GNOME directly on mobile hardware.
Sources: Documentation/terminology.md, README.md:65-71, Documentation/proot/arch_proot.md:20-30
Architecture and Installation Flow
The implementation relies on proot-distro, a management utility that handles the fetching and extraction of the Arch Linux rootfs. Once installed, the environment is accessed via proot-distro login archlinux.
System Setup Workflow
The following diagram illustrates the sequential process of establishing the Arch Linux environment from the initial Termux state.
Core Dependencies
To run the Arch Linux desktop environment, several critical host packages must be present in the native Termux environment:
| Package | Purpose |
|---|---|
proot-distro | Management of the Arch Linux container |
termux-x11-nightly | X11 server for graphical output |
pulseaudio | Audio server for sound redirection |
x11-repo | Repository for X11 related packages |
wget | Utility for downloading startup scripts |
Sources: Documentation/proot/arch_proot.md:17-25, README.md:46-55
Desktop Environment Support
The project provides specific configurations and scripts for three primary desktop environments within the Arch PRoot.
GNOME Implementation
GNOME requires specific fixes in PRoot because it relies on systemd-logind features that are unavailable in user-space containers. A manual fix is applied to remove conflicting login files.
# Fix GNOME login error in PRoot
find /usr -type f -iname "*login1*" -exec rm -f {} \; && mkdir /run/dbus
Sources: Documentation/proot/arch_proot.md:83-85
Desktop Comparison Table
| Feature | XFCE4 | KDE Plasma | GNOME |
|---|---|---|---|
| Packages | xfce4 | plasma-desktop, kwin-x11 | gnome, gnome-shell |
| Performance | Lightweight / Optimized | Resource Intensive | Moderate / High |
| User Setup | Required | Required | Required |
| Fixes Needed | Minimal | dbus initialization | logind file removal |
Sources: Documentation/proot/arch_proot.md:38, 59, 81, README_old.md:111-125
Hardware Acceleration
Hardware acceleration in Arch PRoot is achieved through translation layers and specialized drivers, particularly for devices with Adreno GPUs.
GPU Driver Stack
The following diagram shows how graphical calls are translated from the Arch Linux environment to the Android hardware.
Turnip Setup in Arch
For Adreno 610+ GPUs, hardware acceleration is enabled by installing the mesa-turnip-kgsl driver. This requires disabling the XFCE4 compositor to prevent black screens.
- Install Base:
pacman -S mesa vulkan-icd-loader - Driver Placement:
libvulkan_freedreno.sois moved to/usr/lib/. - Configuration: The
freedreno_icd.aarch64.jsonis placed in/usr/share/vulkan/icd.d/.
Sources: Documentation/HardwareAcceleration.md:162-178
Startup and Execution Logic
The project uses shell scripts to automate the complex launch sequence, which involves starting the X11 server, initializing audio, and logging into the PRoot container with specific environment variables.
Sequence of Launch Operations
User Configuration and Permissions
Arch Linux in PRoot defaults to the root user initially. For security and application compatibility, creating a standard user with sudo privileges is required.
Key Configuration Steps
- User Creation:
useradd -m -G wheel droidmaster - Password:
passwd droidmaster - Sudoers: Adding
droidmaster ALL=(ALL) ALLto/etc/sudoers. - Locales: Fixing locales is necessary to avoid "weird characters" in the terminal using
locale-gen.
Sources: Documentation/proot/arch_proot.md:62-72, Documentation/chroot/arch_chroot.md:118-131
Summary
The Arch Linux implementation in Termux-Desktops provides a robust, non-root Linux environment using PRoot. By combining proot-distro with specific driver configurations (like Turnip/Zink) and startup scripts, it enables high-performance desktop experiences on Android. The system's flexibility allows for multiple desktop environments, though manual configuration of users, sudoers, and hardware acceleration drivers is essential for optimal use.