Android Desktop Environment Setup Guide
Created: 2025-05-13 02:10:40 | Last updated: 2025-05-14 20:55:50 | Status: Public
Prerequisites
First enable this in Developer Options:
- Navigate to Android Settings → System → Developer options → Disable child process restrictions
- This prevents killing of extra phantom processes (>32) and processes using excessive CPU
Installation
The source of most of this is from https://github.com/termux/termux-app
- Install termux
- Install termux-x11
Setup
- Open the Termux app
- Run update and upgrade commands:
pkg update -y
pkg upgrade -y
- Install required packages:
pkg install x11-repo
pkg install termux-x11-nightly
pkg install pulseaudio
pkg install tur-repo
- Install XFCE4 desktop environment:
pkg install xfce4
- Install browser of your choice:
- For Chromium:
pkg install chromium
- For Firefox:
pkg install firefox
- Install VS Code:
pkg install code-oss
- For ‘advanced coding’ [you wont need for basic usage]
pkg install rust
pkg install binutils
Desktop Launcher Setup
- Download the desktop launcher script:
pkg install wget -y
wget https://raw.githubusercontent.com/Iamnod/termux-own-desktop/main/xfce4.sh
- Make the script executable:
chmod +x xfce4.sh
- Run the script:
./xfce4.sh
Termux-X11 Settings
Open Termux-X11 app and go to PREFERENCES:
- Turn ON: Fullscreen on device display
- Turn ON: PIP mode
- Turn OFF: Show additional keyboard
Alternative Setup Using Proot-Distro
If you prefer using a Linux distribution:
pkg update && pkg upgrade -y
pkg install proot-distro
proot-distro install debian
proot-distro list # to see all available distros
proot-distro login debian # open the Debian environment
This is the content of xfce4.sh [you don’t need it]
#!/data/data/com.termux/files/usr/bin/bash
# Kill open X11 processes
kill -9 $(pgrep -f "termux.x11") 2>/dev/null
# Enable PulseAudio over Network
pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1
# Prepare termux-x11 session
export XDG_RUNTIME_DIR=${TMPDIR}
termux-x11 :0 >/dev/null &
# Wait a bit until termux-x11 gets started.
sleep 3
# Launch Termux X11 main activity
am start --user 0 -n com.termux.x11/com.termux.x11.MainActivity > /dev/null 2>&1
sleep 1
# Set audio server
export PULSE_SERVER=127.0.0.1
# Run XFCE4 Desktop
env DISPLAY=:0 dbus-launch --exit-with-session xfce4-session & > /dev/null 2>&1
exit 0