Install Ubuntu Desktop on Android Using Termux and VNC (No Root)

14 min read Step‑by‑step guide to run a complete Ubuntu desktop on an Android phone with Termux, proot‑distro and a VNC client – no rooting required. October 10, 2026 17:30 How to Install a Full Ubuntu Desktop on Android Using Termux and VNC (No Root)

Running a full Linux desktop on an Android phone used to require a rooted device or a custom ROM. Today the Termux app together with proot‑distro and a VNC server makes it possible to launch Ubuntu (or other Debian‑based distros) entirely in user space. This tutorial walks you through the entire process – from preparing your phone to connecting a VNC client – and explains why each step matters.

Before you start

  • Device requirements: Android 8.0 (Oreo) or newer, at least 2 GB of RAM, and 2 GB of free internal storage for a minimal Ubuntu install. More RAM and storage improve performance, especially if you install a full desktop environment.
  • Network: You’ll need Wi‑Fi or mobile data for downloading packages (≈300 MB). A stable connection avoids corrupted downloads.
  • Battery: Keep the device plugged in or ensure >80 % charge. The installation can take 15‑30 minutes of continuous CPU work.
  • Permissions: Termux needs storage access. We’ll request it early to avoid later prompts.
All commands are typed inside Termux. If you see a # prompt, you are in the Linux shell; a $ prompt indicates a normal user shell.

Step 1 – Install Termux and grant storage permission

  1. Open the Google Play Store (or F-Droid) and install Termux.
  2. Launch Termux. The first run will download its minimal runtime – wait until the prompt appears.
  3. Grant storage access so Ubuntu can read/write files on your shared storage:
    termux-setup-storage
    You will be asked to allow Termux to access photos, media, and files. Tap Allow.

Why this matters: proot‑distro creates a Linux root filesystem inside your internal storage. Without the permission, any attempt to write files outside Termux’s private directory fails.

Step 2 – Update Termux packages

  1. Refresh the package list and upgrade existing packages:
    pkg update && pkg upgrade -y
    This ensures you have the latest proot and openssl binaries, which improves compatibility.
  2. Install the core utilities we’ll need:
    pkg install proot-distro wget curl tar -y

Step 3 – Install the Ubuntu distribution with proot‑distro

proot-distro is a wrapper that fetches a rootfs tarball, extracts it, and runs it inside a proot container. It works on all Android devices without root.

  1. List available distributions to confirm Ubuntu is present:
    proot-distro list
    You should see ubuntu-20.04 (or a newer release) among the options.
  2. Install Ubuntu 20.04 (the LTS version is the most stable for this workflow):
    proot-distro install ubuntu-20.04
    The script downloads a ~200 MB rootfs, extracts it to ~/../usr/var/lib/proot-distro/installed/ubuntu-20.04, and sets up a basic environment.
  3. Verify the installation by starting a shell inside Ubuntu:
    proot-distro login ubuntu-20.04
    You should see a prompt like root@localhost:~#. Type exit to return to Termux.
If the download fails due to a network timeout, retry the install command – it will resume from the last good chunk.

Step 4 – Install a lightweight desktop environment (XFCE)

Running a full GNOME or KDE stack on a phone is impractical. XFCE provides a good balance of functionality and resource usage.

  1. Enter the Ubuntu container again:
    proot-distro login ubuntu-20.04
  2. Update the package index inside Ubuntu:
    apt update
  3. Install XFCE and some basic utilities:
    apt install xfce4 xfce4-terminal dbus-x11 -y
  4. Install a VNC server (tightvncserver is lightweight and works well):
    apt install tightvncserver -y
  5. Set a VNC password (required on first run). The command will prompt you twice:
    tightvncserver :1
    After setting the password, you’ll see a message like New 'X' desktop is ubuntu:1. Stop the server for now:
    tightvncserver -kill :1
  6. Configure the VNC server to start XFCE automatically. Create (or edit) ~/.vnc/xstartup:
    #!/bin/sh
    xrdb $HOME/.Xresources
    startxfce4 &
    
    Make it executable:
    chmod +x ~/.vnc/xstartup
  7. Exit the Ubuntu shell:
    exit

Why we use :1: The :1 display number tells the VNC server to listen on TCP port 5901. This is the default port most VNC clients expect.

Step 5 – Create a convenient launch script

Typing the whole login and VNC start sequence each time is cumbersome. We’ll add a small wrapper script in Termux.

  1. Open a text editor (nano is preinstalled) and create ~/start-ubuntu-vnc.sh:
    nano ~/start-ubuntu-vnc.sh
    Paste the following content:
    #!/data/data/com.termux/files/usr/bin/bash
    # Launch Ubuntu in proot and start VNC on display :1
    proot-distro login ubuntu-20.04 --shared-tmp -- bash -c "
      export DISPLAY=:1
      tightvncserver :1 -geometry 1280x720 -depth 24
    "
    Save with Ctrl+O, then exit with Ctrl+X.
  2. Make the script executable:
    chmod +x ~/start-ubuntu-vnc.sh
  3. Run the script to start the desktop:
    ~/start-ubuntu-vnc.sh
    You’ll see a few lines of output as the VNC server starts. Keep the Termux session open – closing it will kill the VNC process.
Do not close the Termux window while the VNC server is running, otherwise the Ubuntu session ends and any unsaved work is lost.

Step 6 – Connect with a VNC client on Android

Several free VNC viewers are available; we’ll use VNC Viewer by RealVNC because of its clean UI.

  1. Install VNC Viewer from the Play Store.
  2. Open the app and tap the + button to add a new connection.
  3. Enter the address 127.0.0.1:5901 (or localhost:5901) and give it a name like “Ubuntu Desktop”.
  4. When prompted, enter the VNC password you set earlier.
  5. Tap Connect. After a few seconds you should see the XFCE desktop running inside the VNC window.

Tip: Rotate your device to landscape for a more desktop‑like aspect ratio. The VNC app supports pinch‑to‑zoom, which helps on smaller screens.

Step 7 – Optional – Install additional Linux tools

Now that the desktop is running, you can install any Debian package you need. Common additions include:

  • sudo apt install git vim curl – development tools.
  • sudo apt install python3-pip – Python environment.
  • sudo apt install libreoffice – office suite (requires more RAM).

Remember to use sudo inside the VNC session; the default Ubuntu user in proot-distro is root, so you can omit sudo if you prefer.

Step 8 – Managing the session (start/stop)

Because the VNC server runs inside the Termux process, you control it from Termux.

  • Stop the desktop: In the Termux window where you launched start-ubuntu-vnc.sh, press Ctrl+C. This kills the VNC server and returns you to the Termux prompt.
  • Restart later: Simply run ~/start-ubuntu-vnc.sh again.
  • Kill a stray VNC process (if the script crashed):
    pkill -f tightvncserver

Step 9 – Performance and storage tips

  • Resolution: The -geometry flag in the launch script determines the virtual screen size. Lower it (e.g., 800x600) if the UI feels sluggish.
  • Swap: Android already manages swap, but you can create a swap file inside Ubuntu for memory‑intensive tasks:
    fallocate -l 512M /swapfile
    chmod 600 /swapfile
    mkswap /swapfile
    swapon /swapfile
    
    Remember to add /swapfile none swap sw 0 0 to /etc/fstab if you want it to persist across reboots.
  • Disk space: The Ubuntu rootfs lives in Termux’s private storage, which is limited on some devices. If you run out of space, move the distro to external storage:
    proot-distro install ubuntu-20.04 --path /sdcard/ubuntu
    Then adjust the launch script to use the new path (add --path /sdcard/ubuntu to the login command).

Troubleshooting

1. VNC shows a black screen

  • Ensure the xstartup file is executable and contains startxfce4 &.
  • Check that the VNC server is actually running: ps | grep Xtightvnc inside the Ubuntu shell.
  • If you see Cannot open display :1, the DISPLAY variable may not be exported. Edit the launch script to add export DISPLAY=:1 before starting tightvncserver.

2. "proot‑distro: command not found"

This means the proot-distro package wasn’t installed. Run pkg install proot-distro again and restart Termux.

3. "apt: command not found" inside Ubuntu

Sometimes the Ubuntu rootfs is corrupted. Remove the installation and reinstall:

proot-distro remove ubuntu-20.04 && proot-distro install ubuntu-20.04

4. VNC client cannot connect (connection refused)

  • Confirm the VNC server is listening on port 5901: netstat -tlnp | grep 5901 inside Ubuntu.
  • Make sure you used 127.0.0.1:5901 (not the device’s external IP) in the VNC app.
  • Some devices block loopback connections for security. If that’s the case, use localhost instead of 127.0.0.1, or install a tiny port‑forwarding app like Port Forwarder Lite to map 5901 to 127.0.0.1.

Safety and privacy considerations

  • The VNC connection is not encrypted. Since it only travels over the loopback interface (your own device), the risk is minimal, but never expose port 5901 to external networks.
  • Running a full Linux distro gives you root access inside the container. Avoid installing untrusted binaries – they could compromise the container and, in rare cases, affect the host Android environment.
  • If you plan to use the Ubuntu instance for sensitive work (e.g., handling passwords), consider adding an SSH server inside Ubuntu and tunneling VNC over SSH. That adds encryption without much extra setup.

What you’ve achieved

By following this guide you now have a functional Ubuntu 20.04 desktop running entirely in user space on your Android phone. You can compile code, run Python scripts, edit documents, or experiment with Linux tools without rooting or flashing your device. Because everything lives inside Termux’s sandbox, you can delete the installation at any time by running proot-distro remove ubuntu-20.04 – leaving your Android system untouched.

Enjoy the flexibility of a Linux desktop on the go, and feel free to explore other distributions (Debian, Alpine) using the same workflow. The same steps apply; just replace ubuntu-20.04 with the desired distro name in the proot-distro commands.

User Comments (0)

Add Comment
We'll never share your email with anyone else.