Learn Ethical Hacking
Android

How to Install and Run a GNU/Linux OS on Your Android Device

Install Linux on Android Device
Written by Modou Sarr

Installing a GNU/Linux environment on your android device can enhance and increase its productivity. Although the Android OS runs on the same Kernel as GNU/Linux, the two Operating systems run on different programs.

A common caveat of android apps is that they are sometimes more limited when compared to desktop apps for example, and one way to get around that is installing a GNU/Linux environment, which can be applicable on rooted or non-rooted devices. This guide assumes a non-rooted device is being used.

GNU/Linux Setup on Android

To Set up a GNU/Linux environment you will need to download GNURoot Debian and Xserver XSDL followed by applicable Linux commands to complete the process.

GNURoot allows you to create a Linux environment within a host OS. Normally you would need Linux’s “Chroot” functionality to do this however, GNURoot uses “proot” a software that allows you to achieve the same function without proot privileges.

RedHat RHCSA and RHCE Certification Exam Study Ebook

The purpose of Xserver XSDL, is to provide an application that GNURoot connects to. An X server is needed to run software that is heavy on graphics.

Xserver XDSL provides options for customizing things like display resolution.

How To Install GNU/Linux on Android Device

1. Search and Install GNURoot Debian and Xserver XSDL from the Playstore.

2. After the download is completed run GNURoot Debian, however watch-out for a “root” shell, which is a fake root shell running in Andriod application sandbox, so ignore it.

Linux Shell on Android

Linux Shell on Android

3. To ensure you have the most recent upgrades run “apt-get update and apt-get upgrade”. You will need Apt-get to install software in a Debian/Ubunu Linux environment.

$ sudo apt-get update
$ sudo apt-get upgrade

4. The next step is to install a graphical environment. You can do this by running “apt-get install lxde” for the environment with all the tools, alternatively you can run “apt-get install lxde-core” for just the desktop environment.

$ sudo apt-get install lxde
$ sudo apt-get install lxde-core

5. What is left now is a way to provide access to the terminal when in a graphical environment, a software called XTerm is used for this.

  Use Bluetooth Tethering to Connect Ubuntu to Android's WiFi

Finally you will need Synaptic Package Manager as a front-end to apt-get drivers for audio play back with Pulseaudio.

$ sudo apt-get install xterm synaptic pulseaudio

6. As a final step start xServer XSDL and download all fonts then go back to GNURoot to run these commands:

$ sudo export DISPLAY=:0 PULSE_SERVER=tcp:127.0.0.1:4712
$ sudo startlxde &

After this, revert back to XServer XSDL and wait for the LXDE desktop.

Running LXDE Desktop on Android

Running LXDE Desktop on Android

Installing Linux Applications on Android

Now that you have Debian Linux on your Android device you will need apps to enjoy it fully. To access the large repository of Linux apps use the Synaptic Package Manager previously installed.

Access Run from the start menu and type in “synaptic”. Press the search button when the Synaptic Package Manager opens and key in the name of the app you are looking for then mark it for installation.

Synaptic Package Manager

Synaptic Package Manager

Images credit: xda-developers

With your apps installed, you are finally good to go! Remember however, that because this is a Linux environment running within Android, it will not run as seamlessly as you would expect from the whole Linux package, some apps may not run at all. Also, android apps do not necessarily work differently within a Linux environment so don’t expect more than the usually from your android apps either.

  Use Bluetooth Tethering to Connect Ubuntu to Android's WiFi

It is also important to remember that some games will not work especially those requiring hardware acceleration But all in all, most apps and simple games will work just fine!

We hope you find this guide easy to follow, let us know if you have any comments, tips or suggestions or simply to let us know you successfully installed Linux on your Android device with these guidelines!

Join Our Community Of 250,000+ Linux Lovers by liking us on Facebook, or follow us on Twitter, Google+ and Instagram.

If you liked this article, sign up for the fossmint newsletter for handpicked selection of stories from FossMint delivered to your inbox every day.


Top Deals

About the author

Modou Sarr

Modou Sarr is from the Gambia West Africa, he loves to read write and is an avid sportsman. He studied International Development studies and also Law and hopes to one day own a successful eCommerce business.

  • haiyuan lee

    Thanks for sharing

  • Colin Wilson

    Wonder if there’s a way to do this on old NowTV boxes… We’ve got several that could be of some use again as kodi servers

    • James LaBarre

      if anything, I’d see if it could be made to run on a Netgear NeoTV Prime (GoogleTV box). Can’t see the device having enough horsepower to do much of anything, although I’d try to make it work as an X-Terminal.

  • Anyone got audio working?