Run Full Desktop Linux Applications on Android Using Termux and VNC (No Root)

15 min read Learn step‑by‑step how to install a Linux distribution in Termux, set up a VNC server, and launch full desktop applications on any Android device without rooting. October 08, 2026 10:00 How to Run Full Desktop Linux Applications on Android Using Termux and VNC (No Root)

Many Android power users reach a point where they need a real Linux desktop – perhaps to run vim, git, or a graphical IDE that simply isn’t available as an Android app. Rooting would open many possibilities, but it also voids warranties and introduces security risks. This tutorial shows how to achieve a full‑featured Linux desktop on any Android device **without rooting**, using only free, open‑source tools: Termux, proot-distro, and a VNC server.

Before you start

  • Device requirements: Android 7.0 (Nougat) or newer. Older versions may lack the required execve support for proot.
  • Storage space: Allocate at least 2 GB free on internal storage. A typical Ubuntu installation occupies ~1 GB, plus space for additional packages.
  • Battery: Keep the device plugged in or fully charged; the installation can take 15‑30 minutes and may heat the CPU.
  • Network: A stable Wi‑Fi connection is recommended for downloading packages (≈300 MB).
  • Permissions: Grant Termux storage permission (Settings > Apps > Termux > Permissions > Storage) so the Linux environment can read/write files on your device.

Overview of the workflow

  1. Install Termux and essential add‑ons.
  2. Install proot-distro and pull a Linux distribution (Ubuntu 22.04 LTS is used in this guide).
  3. Configure a lightweight VNC server inside the Linux distro.
  4. Install a desktop environment (XFCE) and a VNC client on Android.
  5. Launch the VNC server, connect with the client, and start using Linux GUI apps.

Step 1 – Install Termux and basic packages

  1. Open the F‑Droid page for Termux and install the latest version. (F‑Droid provides the most up‑to‑date build; the Play Store version is often outdated.)
  2. Launch Termux. The first run will download additional data – let it finish.
  3. Update the package repository and upgrade existing packages:
    pkg update && pkg upgrade -y
  4. Install the required tools:
    pkg install proot-distro wget curl tar git -y
  5. Optional but useful: install vim or nano for in‑terminal editing.
    pkg install vim nano -y

Why these steps matter: updating ensures you get the latest security patches, and installing proot-distro gives you a simple wrapper to download and manage Linux rootfs images without needing root privileges.

Step 2 – Pull a Linux distribution with proot-distro

  1. List available distributions (optional):
    proot-distro list
    You’ll see entries like ubuntu-22.04, debian-bullseye, etc.
  2. Install Ubuntu 22.04 (the default choice for this guide):
    proot-distro install ubuntu-22.04
    The command downloads a compressed rootfs (~300 MB) and extracts it under ~/.local/share/proot-distro/ubuntu-22.04.
  3. Start the newly installed distro to verify it works:
    proot-distro login ubuntu-22.04
    You should see a prompt like root@ubuntu:/#. Type exit to return to Termux.

If the download fails, check your Wi‑Fi connection or try a different mirror by setting the PROOT_DISTRO_MIRROR environment variable before running the install command.

Step 3 – Set up a VNC server inside Ubuntu

  1. Enter the Ubuntu environment again:
    proot-distro login ubuntu-22.04
  2. Update Ubuntu’s package list and install the VNC server and a lightweight desktop environment (XFCE):
    apt update && apt upgrade -y
    apt install xfce4 xfce4-goodies tightvncserver -y
  3. Run vncserver for the first time to set a password:
    vncserver :1
    You’ll be prompted for a view‑only password – you can skip it by pressing n.
  4. Kill the temporary VNC instance so we can configure it:
    vncserver -kill :1
  5. Edit the startup script to launch XFCE instead of the default twm:
    nano ~/.vnc/xstartup
    Replace its contents with:
    #!/bin/sh
    xrdb $HOME/.Xresources
    startxfce4 &
    Save (Ctrl+O) and exit (Ctrl+X). Make the script executable:
    chmod +x ~/.vnc/xstartup
  6. Start the VNC server again, this time specifying a geometry that matches your phone screen (e.g., 1080x1920):
    vncserver :1 -geometry 1080x1920 -depth 24
    You should see a message like New 'X' desktop is ubuntu:1.
  7. Leave the VNC server running and exit back to Termux:
    exit

Why XFCE? It’s lightweight (≈150 MB RAM) yet fully functional, making it ideal for devices with limited resources.

Step 4 – Install a VNC client on Android

Several free VNC clients exist on the Play Store and F‑Droid. For this guide we’ll use VNC Viewer (RealVNC) because it’s straightforward and supports password authentication.

  1. Open F‑Droid or Play Store, search for “VNC Viewer”, and install the app.
  2. Launch VNC Viewer. Tap the + button to add a new connection.
  3. Enter the address 127.0.0.1:5901. The :5901 part corresponds to VNC display :1 (5900 + display number).
  4. When prompted, type the VNC password you set in Step 3.
  5. Tap “Connect”. After a few seconds you should see the XFCE desktop.

If the connection fails, double‑check that the VNC server is still running inside Ubuntu (ps aux | grep Xtightvnc) and that you used the correct display number.

Step 5 – Install and launch graphical Linux applications

Now that you have a desktop, you can install any GUI package available in Ubuntu’s repositories.

  1. Re‑enter the Ubuntu environment:
    proot-distro login ubuntu-22.04
  2. Update the package index again (good practice after a long session):
    apt update
  3. Install a sample application – for example gedit (a simple text editor):
    apt install gedit -y
  4. Return to the VNC client on Android and open a terminal inside XFCE (Menu → Accessories → Terminal) or press Alt+F2 and type xfce4-terminal.
  5. Run the newly installed program:
    gedit &
    The & detaches the process so the terminal remains usable.
  6. Repeat the install step for any other GUI tools you need (e.g., firefox, thunderbird, code for VS Code). Keep in mind that heavy browsers may be sluggish on low‑end hardware.

Tip: Create a desktop shortcut for frequently used apps by right‑clicking the XFCE desktop, choosing “Create Launcher”, and filling in the command (e.g., gedit).

Optional: Persisting the VNC session across reboots

By default, the VNC server stops when you close Termux or reboot the phone. To make it start automatically:

  1. Create a simple shell script inside the Ubuntu home directory (e.g., ~/start-vnc.sh):
    #!/bin/sh
    vncserver :1 -geometry 1080x1920 -depth 24
    
  2. Make it executable:
    chmod +x ~/start-vnc.sh
  3. In Termux, add the script to the .bashrc (or .zshrc) so it runs each time you log into the distro:
    echo "~/start-vnc.sh" >> ~/.bashrc
  4. Now, whenever you execute proot-distro login ubuntu-22.04, the VNC server will start automatically.

Warning: Leaving a VNC server running all the time can drain battery. Consider disabling the auto‑start script if you only need occasional access.

Troubleshooting common issues

1. VNC shows a black screen

  • Ensure the xstartup script is executable and contains startxfce4 &.
  • Check that the display geometry matches the client’s expectations; mismatched resolutions can cause rendering problems.
  • Verify the VNC server logs (~/.vnc/*.log) for error messages.

2. “Connection refused” from the Android VNC client

  • Confirm the VNC server is running: ps aux | grep Xtightvnc. If not, start it again.
  • Make sure you used 127.0.0.1:5901 – the loopback address is required because the server runs inside the same Android process.
  • Some devices block loopback connections for security. If that happens, install termux-wifi-connect to create a local hotspot and connect via the device’s IP address (e.g., 192.168.43.1:5901).

3. Keyboard shortcuts don’t work inside the VNC session

  • VNC translates key events; enable “Send keyboard shortcuts” in the client settings.
  • Alternatively, use the on‑screen XFCE keyboard layout.

4. High CPU usage after launching a heavy app

  • Close unnecessary background apps on Android to free RAM.
  • Consider switching to a more minimal desktop like openbox if XFCE feels heavy.

Security considerations

  • The VNC connection is unencrypted by default because it runs on the loopback interface. If you expose the VNC server to a network (e.g., via a hotspot), wrap it with an SSH tunnel or use stunnel to add TLS encryption.
  • Never reuse the same VNC password for other services.
  • Because the Linux rootfs runs under proot, it has limited access to the Android kernel. Nevertheless, treat it as a regular Linux system: keep packages updated (apt upgrade) and avoid running untrusted binaries.

Advanced tweaks

Using Wayland instead of X11

Some modern Linux apps require Wayland. While proot-distro primarily supports X11, you can install weston and forward its socket over VNC using xwayland. This is an advanced setup and beyond the scope of this tutorial, but the principle is the same: start a Wayland compositor, then run an X server that captures its output for VNC.

Sharing the Linux home directory with Android

Termux stores its files under /data/data/com.termux/files/home. To make those files accessible to Android apps (e.g., a file manager), enable Termux’s storage access:

termux-setup-storage
Then create a symbolic link inside the Linux distro:
ln -s /data/data/com.termux/files/home/storage/shared ~/shared
Now you can open ~/shared from the Linux desktop and see the same files that Android apps see.

Cleaning up

If you later decide you no longer need the Linux environment:

  1. Stop the VNC server: vncserver -kill :1 (run inside the distro).
  2. Remove the distro with proot-distro remove ubuntu-22.04.
  3. Uninstall Termux packages you added (e.g., pkg uninstall proot-distro wget curl).
  4. Delete any leftover VNC client configuration from Android.

This frees up the storage you allocated earlier.

What you’ve accomplished

By following these steps you now have a fully functional Linux desktop accessible from any Android device, without needing root access. You can develop software, run scientific tools, or simply enjoy a familiar Linux workflow on the go. Because everything runs inside Termux, you retain the safety of Android’s sandbox while gaining the flexibility of a full Linux environment.

User Comments (0)

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