Android is built on the Linux kernel, but the user‑space environment is heavily customized. Installing a full Linux distribution gives you access to familiar command‑line tools, package managers (apt, yum, pacman), and even graphical desktop environments—all without unlocking the bootloader or voiding warranties. This tutorial shows you how to achieve that using Termux (a terminal emulator) and proot‑distro (a lightweight user‑space container).
What you’ll get: a working Linux shell (e.g., Ubuntu) that runs side‑by‑side with Android apps, persistent file storage, and optional VNC‑based GUI.
If you have a custom ROM or heavy manufacturer skins, menu wording may differ slightly, but the steps remain the same.
Do not install Termux from the Google Play Store. The Play Store version is no longer maintained and may lack critical updates.
Termux ships with a minimal set of tools. Updating ensures compatibility with proot‑distro and the latest Linux packages.
pkg update && pkg upgrade -yThis command fetches the latest package lists and upgrades installed packages. Expect a few minutes of download time.
We need proot (the container engine) and git (optional, for custom distro scripts).
pkg install proot-distro git -yAfter installation, verify the versions:
proot-distro --versionYou should see something like proot-distro 2.5.0. If the command fails, repeat the pkg install step.
proot-distro ships with a handful of ready‑made images: ubuntu, debian, archlinux, alpine, and fedora. For most users, ubuntu offers the best balance of familiarity and package availability.
proot-distro listThe output will look like:
Available distros:
alpine
archlinux
debian
fedora
ubuntuInstallation downloads a compressed rootfs, extracts it, and creates a directory under ~/../usr/tmp/proot-distro. The process is fully offline after the download, so you can later start the distro without network access.
proot-distro install ubuntuTypical output:
Downloading Ubuntu rootfs (approx. 150 MB)...
Extracting... done.
Installation finished.If the download stalls, check your Wi‑Fi and retry. You can also specify a different mirror by editing ~/.proot-distro.conf, but the default works for most regions.
Once installed, start the distro with:
proot-distro login ubuntuYou will be dropped into a regular Linux prompt, e.g. root@ubuntu:~#. At this point you have a fully functional Ubuntu environment running in user space.
Run a few commands to make the environment comfortable.
apt updateapt upgrade -yapt install -y nano curlThese commands behave exactly as on a desktop Ubuntu system.
Termux mounts the shared storage at /data/data/com.termux/files/home/storage. Inside the Linux container, this directory is available under /root/storage (the exact path may vary; you can always check with ls /root).
To enable the storage shortcut, run in Termux before launching the distro:
termux-setup-storageAfter granting permission, you’ll see a storage folder inside your Termux home. When you proot-distro login ubuntu, you can navigate to /root/storage and see your Android downloads, pictures, etc.
If you want a GUI, you can install a lightweight desktop environment (e.g., XFCE) and serve it over VNC. This section is optional; the command‑line is fully functional on its own.
apt install -y xfce4 xfce4-terminal tightvncservervncpasswdvncserver :1 -geometry 1280x720 -depth 24127.0.0.1:5901. The :1 display maps to port 5901.When you’re done, stop the VNC server to free resources:
vncserver -kill :1Running a desktop consumes significant RAM and battery. On low‑end devices, you may experience lag or crashes.
Termux updates can wipe its private data directory, which would delete your Linux rootfs. To protect your work:
tar -czvf ubuntu-backup.tar.gz ~/.proot-distro/ubuntu (run from Termux, not inside the distro).tar -xzvf ubuntu-backup.tar.gz -C ~/.proot-distro/.Alternatively, keep a copy of the rootfs on a separate folder and reinstall with proot-distro install ubuntu --path /sdcard/ubuntu-rootfs if needed.
This means the proot-distro package wasn’t installed correctly. Re‑run:
pkg install proot-distro -yand ensure $PATH includes ~/.local/bin. You can add it manually:
echo 'export PATH=$PATH:~/.local/bin' >> ~/.bashrc && source ~/.bashrcPossible causes:
This usually indicates an incompatibility between the device’s CPU architecture (arm64 vs arm) and the downloaded rootfs. Verify your device architecture with:
uname -mIf you have an older 32‑bit arm device, install the ubuntu-armhf variant (if available) or choose alpine, which provides both armhf and aarch64 builds.
Make sure the VNC server is running inside the distro (check with ps aux | grep Xvnc). Also confirm you’re connecting to the correct localhost port (5901 for display :1). Some devices block loopback connections; in that case, use 127.0.0.1 explicitly instead of localhost.
nmap, curl, or ssh from the same environment you’d use on a laptop.To free up space, uninstall the distro cleanly:
proot-distro uninstall ubuntuThen, optionally, remove Termux itself via Android Settings > Apps > Termux > Uninstall.
By following these steps you now have a fully functional Linux distribution running side‑by‑side with Android, all without rooting or flashing. The environment is portable, sandboxed, and can be extended with GUI tools or custom scripts. Remember to back up your distro folder regularly and keep Termux updated to benefit from security patches.









