Setting Up a Desktop Environment on Android Using VNC and Termux-X11

June 11, 2025 · View on GitHub

This guide will walk you through setting up a desktop environment on your Android device using either VNC or Termux-X11. By running a Linux distribution (such as Debian or Ubuntu) in a chroot environment within Termux, you can display a full desktop interface on your phone or tablet.

Prerequisites

Before you begin, ensure you have the following:

  • Termux App: Download it from F-Droid or GitHub.
  • chroot-distro Setup: Install chroot-distro and set up a Linux chroot environment (e.g., Debian or Ubuntu). Follow the official guide if you need help with this step.

Part 1: Using VNC for the Desktop Environment

1. Install a VNC Viewer App

To view the desktop, install a VNC viewer app on your Android device. Here are some recommended options:

2. Install Required Packages

In your chroot environment (e.g., Debian or Ubuntu), open a terminal and run these commands:

apt update -y && apt upgrade -y 
apt install tightvncserver sudo dbus-x11 xfce4 xfce4-goodies xfce4-terminal -y 

3. Configure the Desktop Environment

Set up the desktop with these steps:

# Set the default terminal emulator
update-alternatives --config x-terminal-emulator
# A menu will appear. Type the number for `xfce4-terminal` and press Enter.

# Start the VNC server to generate configuration files
vncserver

# Stop the server after the files are created
vncserver -kill :1

# Edit the VNC startup file to launch XFCE4
echo 'startxfce4 &' >> ~/.vnc/xstartup

4. Launch the Desktop

Start the VNC server and connect to it:

# Start the VNC server
vncserver
# Note the address it provides, e.g., `localhost:1`.

# Connect using your VNC viewer app
# Enter the address (e.g., `localhost:1`) and tap "Connect."

# To stop the server later
vncserver -kill :1

Example Screenshots

  • Debian via VNC:
    Debian GUI
  • Ubuntu via VNC:
    Ubuntu GUI

Part 2: Using Termux-X11 for the Desktop Environment

  • Parrot Security via Termux-X11:
    Parrot GUI

1. Install Termux-X11

Download and install Termux-X11 from the official repository.

2. Install Required Packages in Termux

Open the Termux app and run these commands:

pkg update -y && pkg upgrade -y 
pkg install x11-repo root-repo -y
pkg install tsu ncurses-utils termux-x11-nightly pulseaudio virglrenderer-android -y

3. Install the Desktop Environment in the Chroot

Inside your chroot environment, install XFCE4:

apt install sudo dbus-x11 xfce4 xfce4-goodies xfce4terminal -y
# Installs the XFCE4 desktop and tools

# Optional: Install an audio server
apt install mpd
# Edit `mpd.conf` if audio setup is needed (e.g., for music playback).

4. Launch the Desktop

Use a script to simplify the process:

  1. Download the script chroot-xfce.sh from here.
  2. Make it executable:
    chmod +x chroot-xfce.sh
    
  3. Run it from Termux:
    ./chroot-xfce.sh
    
    or
    bash chroot-xfce.sh
    

Note: The script includes a menu to launch XFCE4 with audio support via Termux-X11.
Screenshot of Script:
chroot-xfce.sh


Additional Tips

  • Run apt commands inside the chroot environment, not Termux directly.
  • If audio doesn’t work, check the mpd.conf file for configuration issues.
  • For more help, see the chroot-distro documentation.

This guide is designed to be clear and easy to follow, whether you're a beginner or an advanced user. Enjoy your Android desktop experience!