Installing Linux on an Android Phone
As a web developer, being able to run a Linux distro alongside your pre-existing mobile OS on your android phone is a very enticing offer. With a fully functional Linux program in your pocket at all times, you can begin to utilize your phone for various processes including powering a LAMP server and turning the device into a portable network, troubleshooting tool, and pen-testing device.
Furthermore, by utilizing LinuxOnAndroid’s shell scripts and Android app, as well as the open source app, Linux Deploy , you can host multiple Linux distros and boost them using the app, as well as install Linux on your rooted android device. From there, the scripts mount the Linux image within the Android filesystem and the SD card within the Linux filesystem.
Although more advanced Android devices may include the Samsung KNOX counter (leading to a warranty breach if you root the device), there is actually a way to install Linux on an Android phone without rooting . However, you can still utilize Samsung Kies or ODIN to flash a stock ROM, and not flag or trip the KNOX counter as well and, once the device is rooted, you can always ODIN back to stock to claim the warranty, as long as you do not encounter hardware failure before then.
In order to open up a shell for you to connect to the mounted Linux system, the scripts then change the root directory to the mounted Linux system by calling on chroot. After this is complete, they set up the cryptographic network protocol, SSH , in order to operate the network services securely over the unsecured network supplied to us by the Android phone. In doing so, it ensures that, despite installing Linux on a weak security device, you will not be breached or intruded upon during use.
Furthermore, the scripts set up VNC so you can use Remote Frame Buffer Protocol (RFB) to relay the graphical screen on Linux’s desktop for efficiency. Although these scripts simply set up the environment in which Linux will run on the device, the multiple Linux distros on the device are actually made up of ARM packages . This means that, instead of being forced to run on a virtual machine, the smaller-sized processor (as well as its ability to reduce complexity and lower power consumption) allows the ARM processor to run the distros on hardware on your Android phone instead.
By using Chroot , you can create an isolated environment, which does not interfere with the rest of the system and use the Linux Deploy app to install and run Linux on your device via a user-friendly interface provided by the app itself. However, before tackling the Linux installation, you must first install a VNC client as well as a terminal emulator so you can receive the graphical screen of the Linux desktop and access the Linux command line shell. Although there are several VNC and terminal emulator apps, VX ConnectBot and MultiVNC are both free apps that are extremely effective for this procedure likewise.
Develop using Red Hat’s most valuable products
Your membership unlocks Red Hat products and technical training on enterprise cloud application development.
Installing Linux Distros Using Linux Deploy
First, you will need to open the Linux Deploy app and click on the Properties button. In the Properties window, there is a list of configurable options and this is where you can choose the desired Linux distros from the Distribution list in the Deploy section. Next, you can choose specific versions of the distros being used in the Distribution Suite list.
Once this is complete, you may want to specify a mirror closer to you as the Linux Deploy app uses a mirror based in Russia, which may not be suitable for you. To do this, edit the Mirror URL setting, pick the mirror closest to you, and enter its URL. For instance, if you are installing Fedora in the United States, you will want to enter a URL such as this one (the closest to myself):
Once this is complete, you can choose how Linux Deploy installs Linux in the Installation Type list and decide whether you want to install it via an image file (most common), a specific folder, or even a separate partition. However, if your Android device does have an SD card slot, you can even install Linux on a storage card or use a partition on the card for that purpose.
Linux Deploy will also allow you to set up your graphical desktop environment as well so head over to the Desktop Environment list and enable the Install GUI option. After this is done, you can enable both the SSH and VNC options to connect to the running Linux instance as well as the desktop environment created by MultiVNC and then determine the color depth, desktop dimensions, and resolution of the VNC client app to improve your desktop view.
Now that you have successfully set up the app’s deployment of Linux, you can click on Install Item button and wait as it installs the configurations you have set up for Linux on your phone. Once it is complete, if done correctly, you will see this status on the screen:
Now, you can boot the installed Linux distro by clicking on the Start button then launch the VX ConnectBot app using the IP address of the running Linux instance. Once this is complete, you will want to establish an SSH connection to secure your unsecured device by using the IP address of the Linux instance as well as the default android username and enter the default changeme password when you are prompted to do so.
After you have set up the Linux instance, you will definitely want to change the default password by issuing a passwd command and change the user password as well as run sudo passwd root to assign the root password likewise. Lastly, you can connect MultiVNC to the running VNC server by using the default changeme password.
Although this is not the only way to install Linux on your phone, it is an efficient and free process, which increases the actual value of having Linux on your phone significantly. Although the AMR processor allows you to use low-grade phones, you may want to think about using a stronger cell service to boost the speed of the device when running web applications or troubleshooting. For instance, the first time I completed this process on my Samsung Galaxy Avant, I faced a major issue with my current carrier MetroPCS and its inability to run the Linux distros efficiently. However, multiple carriers have far stronger connectivity and would be much more efficient when doing this project. Since then, I have done the same project on an LG G Stylo connected to T-Mobile’s service and the results are much more efficient.
On top of this, with T-Mobile’s 4G-LTE plan turning into a 5G-LTE plan very shortly; this may be a perfect provider when trying to use a complex system such as Linux on an Android device. Furthermore, if you decide to choose a different launching app other than Linux Deploy, you can also utilize LinuxOnAndroid or Limbo PC Emulator , however, the Limbo PC Emulator is not extremely fast and, therefore, you may be better suited using the other 2 instead. Still, Limbo does have a High Priority option, which ultimately speeds up the VM (but may also affect the responsiveness of the Android device) as well as tips on improving specific distros on the project’s site.
Nevertheless, installing Linux on an Android device can help you to turn your simple phone into a highly useful tool for web development, troubleshooting, and various other procedures common in the IT industry. On top of this, using these open source alternatives can also allow you to complete the project without paying a dime and use a simple and easy-to-use interface likewise. In the end, you will ultimately have an entirely new way of using Linux always within reach and ready to go for those difficult situations that require Linux but may be hard to do via a computer.
Whether you are new to Linux or have experience, this cheat sheet can assist you when encountering tasks you haven’t done lately.
How to Run Linux on Android Devices
Want to run Linux on Android? Here are methods for both unrooted and rooted devices to get a Linux desktop running on your phone.
If you’re reading this, you’ve probably used Linux before, and know that it works on almost any piece of hardware. Meanwhile, you’ve got a phone in your pocket, and you know it’s versatile. So can your Android phone run Linux?
Yes, it can. Here’s what you need to know about running Linux on your Android smartphone or tablet.
Wait, Isn’t Android Already Linux?
Well, it is. and it isn’t.
Android is built upon the Linux kernel, a software stack that interfaces with the hardware of a device. It basically enables an operating system to communicate with the device—whether that’s a PC, a smartphone, or other hardware.
The Linux operating system should really be referred to as GNU/Linux. But over time, the word “Linux” has come to interchangeably describe the kernel as well as the various operating systems. These include Arch Linux, Ubuntu, Gentoo, and many others.
You’re interested in Linux and have read a few blog posts. Along the way, you’ve come across a funny name: GNU/Linux. But what does this mean?
So while Android uses the Linux kernel, it doesn’t offer a desktop environment. This is what most people are thinking about when considering ways to install Linux for Android.
Why Install Linux on Your Android Device?
So why might you want a Linux desktop environment installed on your Android phone or tablet?
You may wish to run an app that isn’t available on Android. But in most cases, you’ll simply want to gain access to some sort of desktop environment. Maybe you have a spare Android tablet you want to revitalize, and installing Linux on it is a good way to do this.
Current Android devices have ideal hardware for a PC-like experience, and installing Linux is a great way to enable this.
Of course, you may find that the tasks you want to perform in Linux also work in Android. The only hurdle holding you back might be simultaneous Android app multitasking. Fortunately, this is a feature that many modern Android devices support on the latest OS versions.
Running Linux running on an Android phone or tablet device isn’t easy. If you’re looking for improved multitasking, try upgrading to a recent version of Android instead.
Can My Phone or Tablet Run Linux?
To run Linux on Android, you have several choices. Which you should use is determined by whether your Android device is rooted or not.
In almost all cases, your phone, tablet, or even Android TV box can run a Linux desktop environment. You can also install a Linux command line tool on Android. It doesn’t matter if your phone is rooted (unlocked, the Android equivalent of jailbreaking) or not.
The following options to install Linux on your Android tablet or phone are available:
- To install Linux on Android without root:
- Debian Noroot
- For installing Linux on a rooted Android device:
- Use Linux Deploy
- Install Kali Linux for penetration testing
Several other methods will give you a Linux, or desktop-like experience, on Android. We’ll look at those, too.
Install Linux on Android Without Root
First, we’ll take a look at three ways to install Linux on your Android phone or tablet without rooting the device.
How to Run Linux on Android With Debian Noroot
The best way to get Linux running on your phone with minimum fuss is with Debian Noroot. You need Android 4.1 or later to run this.
The benefit of Debian Noroot is that it will install Debian Buster on your phone with a compatibility layer. This allows you to run Debian apps without having to root Android. Given how difficult rooting can be for some devices, this is useful.
Performance with Debian Noroot is not great, but it’s usable. For the best results installing Linux for Android, consider rooting your device first.
Download: Debian Noroot (Free)
Get Linux on Android With UserLAnd
An alternative to Debian Noroot, UserLAnd is an Android app from the Play Store that offers a choice of distros. In addition to Alpine, Arch, Debian, Kali, and Ubuntu, this tool lets you install apps.
You can install tools like GIMP, Firefox, and LibreOffice before you install Linux on Android. Simply run the app, agree to the permissions, and select a distro to install. There’s a choice of viewing the installed Linux version over SSH (command line) or using a VNC app (for desktop).
It’s surprisingly simple to set up and use. Thus, if you’re looking for a solution for running Linux on Android, try this.
Download: UserLAnd (Free)
AndroNix Installs Linux on Android
Shipping with eight distros, this useful tool also offers modded versions of some Linux operating systems for improved performance. The standard eight distributions are:
Of these, Ubuntu, Debian, Ubuntu, and Manjaro have modded versions available for Android devices with ARMv8 chipsets and later.
To install a Linux operating system on Android with AndroNix, simple tap the distro you want, then hit Install. You’ll need to follow the steps to copy a command into a Termux terminal window, as well as choose a desktop environment.
The video above outlines the process in more detail. Just be sure to have Termux and a VNC viewing app (like VNC Viewer) installed. You’ll need VNC to use your chosen Linux desktop.
AndroNix is free, but features a premium upgrade which removes ads and introduces additional (non-vital) features. This includes support for offline downloading of operating systems.
Download: AndroNix (Free, in-app purchases available)
3 More Ways to Run Linux on Android Without Root
While we’ve covered a few good options to run Linux on your Android device, other methods are available:
- DeX: If you own a modern Samsung device, you have the option of switching your hardware to desktop mode with DeX. While not exactly a Linux operating system, this is a desktop environment with a Linux kernel.
- Remote Desktop to a system running Linux, using the app Splashtop.
- Termux: This self-contained Linux environment based on the command line lets you run Linux apps on Android. Thus, it’s literally Linux on Android!
Root Android and Install Linux
For rooted users, or anyone happy to take the time to root their Android device, installing Linux is simpler and faster.
How to Install Linux on a Rooted Android Device
If you have a rooted device, you can install various versions of Linux on Android using the Linux Deploy tool. This is best done by first connecting your phone to a Wi-Fi network.
Start off by installing BusyBox, which provides some enhanced root capabilities. Next, install Linux Deploy. On first run, tap Start to ensure the root permissions are enabled, then tap Settings in the bottom-right corner.
Use the displayed options menu to select your preferred Distribution. Debian, Ubuntu, Gentoo, Fedora, and many more are available to install. We used Arch Linux.