How to Install and Run Ubuntu in Android without Root

 Ubuntu OS is another version of linux, and its main focus is on customization, feature enhancements and funcionality.Ubuntu is favourite among linux community as it has features of linux distros and you can say that it is styled version of linux.

In android, If you want to run ubuntu, You need to have root privileges but due termux now we can run it in android without root and get all features of ubuntu on your palm of your hands.

To run ubuntu in android, you need to install a distro called proot or you say it as fake root, Proot is chroot with userspace implementation, proot uses mount --bind and binfmt_misc by which users dont need to have setup arbitrary directory as the new root file system. which means proot uses ptrace system call to fake root privileges.

To start a session or execute one command from from fake chroot you can use Proot command.

Proot-Distro is an utility for managing installation of the linux distribution in Termux.


Requirements:

  • Termux
  • Bvnc Viewer

Method:


Installation of Apps and other files:

  • Download and install above mentioned apps.



Setting up termux storage:

  • Open the termux, type the following commands:

  • Command:
termux-setup-storage


  • Command:
pkg update && pkg upgrade -y



Installation of proot-distro and ubuntu:

  • Now we need to install proot, inorder to install ubuntu, so type the following commands.

  • Command:
pkg install proot-distro -y

This command will install proot distro


  • Command:
proot-distro install ubuntu-18.04

This command will install the latest version of ubuntu, This installation may take a while as it will download the ubuntu in compressed file and unpacking the file may take time.


  • Command:
proot-distro login ubuntu-18.04

This command will be used to login in linux distro.


  • Command:
apt update && apt upgrade

Update the packages inside the linux distro by using this command.



Installation of udisk2:

  • Command:
apt install udisks2

This command will install udisks2 package.


  • Command:
rm /var/lib/dpkg/info/udisks2.postinst && dpkg --configure -a

This command will remove any udisk2 error.



Installation of Ubuntu theme and VNC:

  • Command:
apt install kubuntu-desktop tigervnc-standalone-server

This commad will install the ubuntu kubuntu theme gui and vnc server for ubuntu.



Setting up vnc server:

  • Command:
tigervncserver -xstartup /usr/bin/startkde -geometry 1920x1080

This command will start the vnc server.

Note: If you using this command for the first, you will be asked for the new password for the vnc, you have use this new password in vncserver app while connecting to ubuntu.


  • Command:
vncserver -k :*

This command will end the vncserver session.

Note: If you dont do this step, It will create a newsessions and you may need to create new ports in vnc app and it may create conflicts.



Fixing the browser:

  • Command:
export MOZ_FAKE_NO_SANDBOX=1


  • Command:
firefox

This command will start the firefox browser.



Setting up audio in ubuntu:

  • Command:
pkg install pulseaudio -y

This command will install pulse audio in termux.


  • Command:
pulseaudio --start --exit-idle-time=-1

This command will start the pulse audio in termux.


  • Command:
pacmd load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1

This command will add pulse audio server to the above ip.


  • Command:
export PULSE_SERVER=127.0.0.1

This command will connect the pulse audio to the ubuntu using the above mentioned server.

Conclusion:

So In this way you can run the Ubuntu OS in android without root and if you want to check the rooted version tutorial of kali installation, you can check from here.

You might be interested in running Ubuntu in android so check the video tutorial of this post below.