Transform Your Android Phone into a Linux Desktop with Termux
Summary: This article explores how to transform an Android phone into a functional Linux desktop using Termux and the Termux-Desktops project. It delves into two primary methods—Termux Native and PRoot—highlighting their respective strengths in performance and application compatibility. Readers will learn how to set up a GUI environment like Xfce and run various Linux applications directly on their mobile device.
Key Takeaways
- Rootless Linux Desktop: Termux, combined with the Termux-Desktops project, enables running full Linux desktop environments like Xfce on Android phones without requiring root access.
- Performance vs. Compatibility: The Termux Native method offers superior performance but limited app compatibility, while the PRoot variant provides broader software support at the cost of some performance overhead.
- Repurpose Old Devices: Even older, budget-friendly Android phones can be effectively repurposed to run a Linux GUI, making them versatile tools for mobile computing and development.
Detailed Overview
Running a full Linux environment on an Android phone might sound like a complex endeavor, especially with Google's increasing restrictions on custom ROMs. However, thanks to tools like Termux and community projects such as Termux-Desktops by LinuxDroidMaster, it's surprisingly accessible to deploy and experiment with various Linux distributions and even full-fledged graphical desktop environments directly on your mobile device, often without needing root access.
Termux provides a powerful command-line interface, allowing users to tinker with different shells, package managers, and server management tools. While command-line tools meet many needs, the desire for a full GUI experience on a phone is strong. This is where Termux-Desktops comes in, offering scripts to set up desktop environments using the Termux X11 server add-on.
The Termux Native Route: Performance with Limitations
The Termux Native method offers a straightforward and fast way to get a rootless Linux GUI experience. This approach installs all necessary packages directly within the Termux environment on your phone, avoiding the overhead of virtualization. For older or budget-friendly devices, this method often provides the best performance.
The setup process involves a few simple commands:
- Install Termux and Termux X11: Ensure you have these installed, preferably from their GitHub releases for the latest versions.
- Install essential packages:
pkg install pulseaudio pkg install wgetpulseaudioenables sound playback for GUI apps, andwgetis needed to fetch scripts. - Install the Xfce desktop environment:
This command pulls all the necessary files for Xfce.pkg install xfce4 - Download and execute the Xfce startup script:
wget https://raw.githubusercontent.com/LinuxDroidMaster/Termux-Desktops/main/scripts/termux_native/startxfce4_termux.sh bash ~/startxfce4_termux.sh
Once executed, the GUI environment boots up within Termux X11. The interface is surprisingly smooth, and touchscreen gestures work well. For more extensive use, connecting a physical keyboard is recommended.
Installing Termux packages
Installing the Termux desktop packages
Installing Xfce desktop
Starting Xfce
Accessing the Xfce desktop
While impressive, the Termux Native method has a notable limitation: it doesn't support every GUI application. Many popular productivity apps like Joplin, Obsidian, or VS Code might not be available through the Termux repositories (like tur-repo). Although alternatives exist, this can be a drawback for users who rely on specific software. This method also supports Mobox for running classic Windows apps, but this adds significant overhead, making it less suitable for underpowered devices.
Overcoming Compatibility with the PRoot Variant
For broader software compatibility, the PRoot method is an excellent alternative. PRoot allows for setting up a pseudo-root environment, essentially running a full Linux distribution (like Debian) within an isolated container on your Android device. While it introduces some performance overhead due to this isolation, it significantly expands the range of applications you can install and run.
The installation process for PRoot is similar but involves a few extra steps:
- Install Termux and Termux X11: As with the native method, ensure these are installed.
- Install PRoot Distro:
pkg install proot-distro proot-distro install debian # Or your preferred distro like ubuntu, archlinux - Login to your PRoot environment:
proot-distro login debian - Inside the PRoot environment, install Xfce and the startup script:
apt update && apt upgrade apt install xfce4 wget https://raw.githubusercontent.com/LinuxDroidMaster/Termux-Desktops/main/scripts/proot_debian/startxfce4_debian.sh - Edit the startup script and make it executable:
nano startxfce4_debian.sh # Replace the placeholder username with your actual username chmod +x startxfce4_debian.sh - Run the desktop environment:
./startxfce4_debian.sh
The UI might feel a bit sluggish compared to the native method, especially on older phones, but it remains usable for basic tasks. The key advantage here is the ability to install a much wider array of applications, as you have more control over the Linux environment within the container. There's also a Chroot variant for rooted devices, offering even deeper integration and performance, but it requires a different setup.
Configuring Arch Linux on Termux
Conclusion & Resources
Running a full-fledged Linux GUI on an Android phone, even an outdated one, is a testament to the power of open-source tools like Termux and the ingenuity of developers like LinuxDroidMaster. The Termux-Desktops project offers compelling options to transform your mobile device into a versatile computing platform.
For optimal performance on budget phones, the Termux Native method with a lightweight desktop environment like Xfce is often the best choice. However, if application compatibility is paramount, the PRoot variant provides a robust solution, albeit with a slight performance trade-off. This capability not only extends the life of older devices but also opens up new possibilities for mobile development, learning, and productivity.

- Termux-Desktops GitHub Repository: https://github.com/LinuxDroidMaster/Termux-Desktops
- Termux App GitHub Repository: https://github.com/termux/termux-app
- Original Blog Source: https://www.xda-developers.com/your-old-android-phone-can-run-a-real-linux-desktop-and-termux-is-all-it-takes-to-get-started/