Problem: You want a real Linux shell – maybe even a desktop – on your Android phone, but you cannot or do not want to root the device.
Termux is an Android terminal emulator that runs a minimal Linux userland. By pairing it with proot-distro, you can launch a complete distribution (Ubuntu, Debian, Alpine, etc.) inside a confined environment. No root privileges are required because proot emulates the necessary system calls.
Why this matters: Termux provides the apt package manager and a sandboxed Linux userland that we will extend with a full distro.
apt update && apt upgrade -y
proot-distro and a few helper tools:
apt install -y proot-distro wget curl git
proot-distro --help
You should see a usage summary.These packages are the backbone: proot-distro downloads and launches the Linux rootfs, while wget and curl help fetch additional files.
proot-distro ships with ready‑made rootfs for several popular distros. For this tutorial we’ll use Ubuntu 22.04 LTS, but you can replace ubuntu-22.04 with debian, alpine, etc.
proot-distro list
proot-distro install ubuntu-22.04
The script downloads a ~300 MB tarball, extracts it, and registers the distro under the name ubuntu-22.04.
During download you’ll see a progress bar. If the connection drops, simply re‑run the same command – it will resume.
proot-distro login ubuntu-22.04
root@ubuntu:/#).apt update && apt upgrade -y
Why you see root: The proot environment runs as the unprivileged Termux user, but it pretends to be root inside the distro. This is safe because it never gains real root on Android.
Now you have a fully functional Ubuntu system. Here are a few common tasks:
apt install git vim htop/data/data/com.termux/files/home/storage is mounted inside Ubuntu as /root/storage. You can read/write to your shared storage from Linux.
ls /root/storage/downloads
apt install python3 and execute scripts just like on a PC.
If you need a GUI – for example a lightweight desktop like LXDE – follow these extra steps.
Display number: 0 and a TCP address (usually 127.0.0.1:0).apt install -y lxde-core lxterminal xauth xinit
export DISPLAY=127.0.0.1:0
startlxde &
The desktop should appear inside the XSDL window.
Note: XSDL runs in a separate Android app, so the performance is modest. For occasional GUI tools (e.g., gedit or gparted) it works well.
The Linux rootfs lives inside Termux’s private data directory. To exit the distro, simply type exit or press Ctrl‑D. The next time you want to continue, run the same proot-distro login ubuntu-22.04 command – all installed packages and files remain intact.
You can install more than one distribution side‑by‑side. For example:
proot-distro install debian
Each distro gets its own name; use proot-distro login debian to switch.
This usually means SELinux is enforcing a policy that blocks the bind‑mount. The fix is to enable the allow‑external‑storage option in Termux:
termux-setup-storage
Then restart Termux and try again.
startlxde.DISPLAY variable matches the address shown by XSDL (sometimes it’s 127.0.0.1:0, other times :0).xauth inside Ubuntu and run xhost + in the XSDL terminal.Termux’s internal storage is limited on devices with low internal memory. You can move the distro to external SD card (if your device supports it) by creating a symbolic link:
mkdir -p /sdcard/termux-distros
ln -s /sdcard/termux-distros $HOME/.local/share/proot-distro
After moving, reinstall the distro or copy the existing rootfs folder into the new location.
sudo or attempt to install a real root bootloader inside the proot environment – it has no effect and can confuse scripts.With a working Linux distro on your phone you can:
ffmpeg, git, or htop.All of this without ever rooting your device, preserving the warranty and the security model Android provides.
Enjoy your new Android‑based Linux workstation!









