Skip to main content
Redhat Developers  Logo
  • Products

    Featured

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat OpenShift AI
      Red Hat OpenShift AI
    • Red Hat Enterprise Linux AI
      Linux icon inside of a brain
    • Image mode for Red Hat Enterprise Linux
      RHEL image mode
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • Red Hat Developer Hub
      Developer Hub
    • View All Red Hat Products
    • Linux

      • Red Hat Enterprise Linux
      • Image mode for Red Hat Enterprise Linux
      • Red Hat Universal Base Images (UBI)
    • Java runtimes & frameworks

      • JBoss Enterprise Application Platform
      • Red Hat build of OpenJDK
    • Kubernetes

      • Red Hat OpenShift
      • Microsoft Azure Red Hat OpenShift
      • Red Hat OpenShift Virtualization
      • Red Hat OpenShift Lightspeed
    • Integration & App Connectivity

      • Red Hat Build of Apache Camel
      • Red Hat Service Interconnect
      • Red Hat Connectivity Link
    • AI/ML

      • Red Hat OpenShift AI
      • Red Hat Enterprise Linux AI
    • Automation

      • Red Hat Ansible Automation Platform
      • Red Hat Ansible Lightspeed
    • Developer tools

      • Red Hat Trusted Software Supply Chain
      • Podman Desktop
      • Red Hat OpenShift Dev Spaces
    • Developer Sandbox

      Developer Sandbox
      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Secure Development & Architectures

      • Security
      • Secure coding
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
      • View All Technologies
    • Start exploring in the Developer Sandbox for free

      sandbox graphic
      Try Red Hat's products and technologies without setup or configuration.
    • Try at no cost
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • Java
      Java icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • API Catalog
    • Product Documentation
    • Legacy Documentation
    • Red Hat Learning

      Learning image
      Boost your technical skills to expert-level with the help of interactive lessons offered by various Red Hat Learning programs.
    • Explore Red Hat Learning
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

Installing Linux on an Android Phone

March 16, 2017
Samantha Donaldson
Related topics:
Linux
Related products:
Red Hat Enterprise Linux

Share:

    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.

    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):
    http://mirror.math.princeton.edu/pub/fedora/linux/releases/25/Everything/x86_64/os/

    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:

    <<<  end: install

    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.

    Last updated: May 31, 2024

    Recent Posts

    • How to run a fraud detection AI model on RHEL CVMs

    • How we use software provenance at Red Hat

    • Alternatives to creating bootc images from scratch

    • How to update OpenStack Services on OpenShift

    • How to integrate vLLM inference into your macOS and iOS apps

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue