Easy Way to Install Ubuntu on Android | Termux
Introduction
Ubuntu is a beginner-friendly Linux distribution, easy to use and perfect for getting started. In this article, we'll guide you through installing Ubuntu on Android using Termux, without requiring root access. We'll also install a GUI, making it resemble a real Ubuntu desktop.
Prerequisites:
- Termux: Ensure you have Termux installed on your Android device.
- VNC Viewer: Install a VNC Viewer app from the Google Play Store.
Installation of Ubuntu
Step 1: Update Termux and Install proot-distro
pkg update -y ; pkg install proot-distro
Step 2: Install Ubuntu
proot-distro install ubuntu
Step 3: Login to Ubuntu and Update Repositories
proot-distro login ubuntu apt update ; apt install sudo nano
Step 4: Setup a Local User
export USER=> /etc/sudoers
Create a password for the new user when prompted.
Step 5: Switch to the New User
suInstalling GUI (Xfce Desktop)
Step 1: Install Xfce Desktop and Terminal
sudo apt install xfce4 xfce4-terminal xfce4-whiskermenu-pluginStep 2: Install Themes, Icons, Plank, and VNC Server
sudo apt install yaru-theme-gtk yaru-theme-icon plank dbus-x11 tigervnc-standalone-serverStep 3: Create Shortcuts for VNC Server
echo "vncserver -geometry 1280x720 -xstartup /usr/bin/startxfce4" >> /usr/local/bin/vncstart ; echo "vncserver -kill :1" >> /usr/local/bin/vncstop ; chmod +x /usr/local/bin/vncst*Adjust the `-geometry` flag to set your desired screen resolution.
Step 4: Start VNC Server and Connect
vncstartOpen VNC Viewer, create a new connection with `localhost:1`, and enter your password to access the Ubuntu desktop.
Optional: Setup Sound in Ubuntu
Step 1: Install PulseAudio in Termux
pkg install pulseaudioStep 2: Configure PulseAudio
nano ~/.bashrcPaste the following configuration:
pulseaudio --start \ --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" \ --exit-idle-time=-1Step 3: Apply Changes and Configure Ubuntu
bash echo "export PULSE_SERVER=127.0.0.1" >> ~/.bashrc ; bashAdditional Tips
Stop VNC Server
vncstopCreate a Shortcut to Start Ubuntu
proot-distro login --user> $PREFIX/bin **You're all set!** Enjoy your Ubuntu desktop on Android.