Ubuntu is the best Linux to get started as it is easy-to-use and beginner friendly, So In this article we will see how we can install Ubuntu on Android with Termux and the best part is that you don't need root access to do it. And we will also install GUI and will make it look exactly like real ubuntu desktop.
Prerequisite:
Installing Ubuntu
So first go to Termux and make sure that your repositories are up-to-date and also install proot-distro
pkg update -y ; pkg install proot-distro
Now it's time to install Ubuntu, execute following to install it
proot-distro install ubuntu
Login to it
proot-distro login ubuntu
Now first update it's repositories and install some basic packages
apt update ; apt install sudo nano
Next we need to setup a local user, as it is better to use a local user instead of root user
export USER=<Your username> ; adduser $USER ; echo "$USER ALL=(ALL:ALL) ALL" >> /etc/sudoers
It will ask you to set you password so just create your password and then keep pressing enter for rest of the questions.
Now login with the user you created
su <Your username>
Above change ubuntu if you change the username, while creating the user
Installing GUI
Here, we will be installing Xfce desktop as it is lightweight
sudo apt install xfce4 xfce4-terminal xfce4-whiskermenu-plugin
Next If you want to install Firefox browser you can watch this video 👇
Now we will install themes, icons, plank and vncserver to access GUI
sudo apt install yaru-theme-gtk yaru-theme-icon plank dbus-x11 tigervnc-standalone-server
Execute following to create a shortcut to start and stop vncserver
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*
Above -geometry flag is to set your screen resolution you can change it according to you.
Now we are all set, just execute following to start vncserver
vncstart
And now open VNC viewer app and click on + icon and create a connection with localhost:1 and Give any name you want. Then just click on connect and enter your password and that's it your Ubuntu desktop is ready to use.
Now if you want to make this desktop exactly like Ubuntu desktop, you can watch this video 👇
If you want to setup sound in it, install pulseaudio in Termux (not in Ubuntu)
pkg install pulseaudio
Open .bashrc file
nano ~/.bashrc
And paste following in it
pulseaudio --start \
--load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" \
--exit-idle-time=-1
Now just execute following
bash
And go to Ubuntu again and execute following,
echo "export PULSE_SERVER=127.0.0.1" >> ~/.bashrc ; bash
Now you will be able to get sound working in Ubuntu (VLC, Chromium), but will not work in Firefox if you to get sound working in Firefox watch this video 👇
To stop vncserver just execute
vncstop
If you want to create a shortcut to start Ubuntu just like we did for vncserver, execute following in Termux (not in Ubuntu)
proot-distro login --user <Your username> ubuntu >> $PREFIX/bin
Now you can login to ubuntu just by executing
ubuntu
Hope this helps you...