Transform your Android device into a fully functional Linux desktop โ with GPU acceleration, audio, Windows app support, and your choice of desktop environment.
| Feature | Description |
|---|---|
| ๐ฅ๏ธ 4 Desktop Environments | Choose XFCE4 (recommended), LXQt (lightweight), MATE (classic), or KDE Plasma (modern) |
| ๐ฎ Hardware GPU Acceleration | Auto-detects Adreno GPUs โ installs Turnip driver; others use Zink Vulkan-to-OpenGL translation |
| ๐ Audio Support | PulseAudio server pre-configured for Termux-X11 compatibility |
| ๐ช Windows App Support | Wine + Box64 integration for running x86_64 Windows applications (optional) |
| ๐ Python Dev Environment | Python 3 + Flask pre-installed with a hardware-accelerated demo server |
| ๐ Browser & Media | Firefox, VLC, Git, cURL, and essential dev tools included by default |
| ๐ SSH Access | Built-in OpenSSH setup guide โ control your Android Linux desktop from your PC |
| โ๏ธ CLI Flags | --skip-wine, --skip-gpu, --dry-run, --help for flexible, testable installs |
| ๐ Full Logging | Every step logged to ~/termux-setup-*.log for easy debugging |
| ๐งน Idempotent & Safe | Skips already-installed packages; graceful error handling; no broken states |
| Device | Android | GPU | Status |
|---|---|---|---|
| Samsung Galaxy A22 5G (SM-A226B) | 13 | Mali-G57 MC2 | โ Fully functional (Zink) |
| OnePlus 9 | 12 | Adreno 660 | โ Turnip acceleration |
| Xiaomi Poco X3 Pro | 13 | Adreno 640 | โ Turnip acceleration |
| Google Pixel 6a | 14 | Mali-G78 MP10 | โ Zink (software fallback available) |
๐ก Tip: Adreno GPUs (Qualcomm) get the best performance via Turnip. Mali/PowerVR devices use Zink with excellent compatibility.
| App | Source | Why? |
|---|---|---|
| Termux | F-Droid | Play Store version is deprecated and broken |
| Termux-X11 | GitHub Releases | Acts as your external display server (download app-arm64-v8a-debug.apk) |
โ ๏ธ Critical: Grant Termux Storage and Display over other apps permissions in Android Settings โ Apps โ Termux โ Permissions.
Open Termux and execute:
curl -O https://raw.githubusercontent.com/heyvoon/termux-linux-setup/main/termux-linux-setup.sh && \
chmod +x termux-linux-setup.sh && \
./termux-linux-setup.sh# Start the Linux desktop
~/start-linux.sh
# Open the Termux-X11 app to view your desktop!
# Stop the desktop when done
~/stop-linux.sh./termux-linux-setup.sh --help
# Skip heavy components for faster testing
./termux-linux-setup.sh --skip-wine --skip-gpu
# Preview commands without installing (dry-run)
./termux-linux-setup.sh --dry-runControl your Android Linux environment from your PC:
# On Termux (one-time setup)
pkg install openssh -y
passwd # Set a password
sshd # Start SSH server (port 8022)
ip addr show wlan0 | grep inet # Note your IP address
# Optional: Keep SSH alive when screen is off
termux-wake-lock# On your desktop (Linux/macOS/WSL)
ssh u0_aXXX@192.168.1.XX -p 8022
# Example: ssh u0_a123@192.168.1.45 -p 8022๐ Pro Tip: Set up SSH keys for passwordless login:
# On desktop ssh-keygen -t ed25519 ssh-copy-id -p 8022 u0_aXXX@192.168.1.XX
This isn't a generic script โ it's been battle-tested and refined specifically for Android/Termux:
| Issue | Solution |
|---|---|
โ plank package removed from repos |
Replaced with graceful fallback; auto-skips if unavailable |
โ vulkan-loader-android doesn't exist |
Uses mesa-vulkan-drivers + vulkan-tools (modern Termux standard) |
โ box64 requires game-repo |
Auto-adds game-repo; conditionally installs with fallback |
โ Heredoc syntax errors (unexpected token '}') |
All heredocs now use << 'MARKER' to prevent variable expansion bugs |
โ pkill -9 corrupting sessions |
Replaced with graceful TERM โ wait โ KILL sequence |
| Enhancement | Benefit |
|---|---|
โ
XDG_RUNTIME_DIR & PULSE_RUNTIME_DIR set to $PREFIX/tmp |
Fixes PulseAudio/D-Bus failures on Android's restricted filesystem |
โ
MESA_LOADER_DRIVER_OVERRIDE=zink + LIBGL_ALWAYS_SOFTWARE=0 |
Forces hardware acceleration path; prevents silent fallback to swrast |
โ
termux-x11 :0 (no legacy flag) |
Compatible with Termux-X11 nightly builds; clean input handling |
โ
Explicit dbus-daemon --session startup |
Resolves Failed to get system bus warnings in XFCE/MATE |
โ
XDG_SESSION_TYPE=x11 + XDG_SESSION_CLASS=user |
Silences ConsoleKit/UPower warnings (Android handles power natively) |
โ
Session cache cleanup (~/.cache/sessions/*) |
Prevents Plank/old configs from auto-spawning on restart |
| Feature | Why It Matters |
|---|---|
๐ Full logging to ~/termux-setup-*.log |
Debug installs without guessing; share logs for support |
| ๐ Idempotent package checks | Safe to re-run; skips already-installed components |
| ๐ซ Graceful fallbacks | Missing packages warn but don't abort the entire install |
๐งช --dry-run mode |
Test the script's logic before committing to installs |
๐ฆ Dynamic $PREFIX/$HOME paths |
Works on work profiles, secondary users, and external installs |
# Force clean restart
~/stop-linux.sh
rm -rf ~/.cache/sessions/*
~/start-linux.sh# Verify Zink is active
echo $GALLIUM_DRIVER # Should output: zink
# Force re-init GPU env
source ~/.config/linux-gpu.sh
~/stop-linux.sh && ~/start-linux.sh# Check PulseAudio status
pulseaudio --check -v
# Restart audio subsystem
pkill pulseaudio
pulseaudio --start --exit-idle-time=-1
export PULSE_SERVER="$PREFIX/tmp/pulse/native"# Verify Wine path
which wine
wine --version
# Re-init Wine prefix (first run only)
winecfg # Creates ~/.wine- Ensure Termux-X11 has Display over other apps permission
- Run
~/start-linux.shbefore opening the Termux-X11 app - Wait ~5 seconds after
Launching Termux-X11...before switching apps
Found a bug? Want to add a new desktop environment or tool?
- Fork the repo
- Create a feature branch (
git checkout -b feat/amazing-idea) - Test on at least one real device (emulators often miss Android quirks)
- Open a PR with:
- Device model & Android version tested
- Screenshots/logs of the change
- Clear description of the improvement
All contributions welcome โ especially from users with non-Qualcomm GPUs!
MIT License โ Use, modify, and share freely.
See LICENSE for details.
โ ๏ธ Disclaimer: This script installs complex software stacks on Android. While tested extensively, always backup important data. The authors are not liable for device issues arising from use.
Made with โค๏ธ for the Termux community
Last tested: Samsung SM-A226B โข Android 13 โข Termux 0.118.0 โข Termux-X11 nightly