Running Linux apps on Android without rooting your phone
Phone as Linux PC
UserLAnd lets you run Linux applications on your Android phone – all without replacing Android OS.
Smartphones are getting more and more powerful. Is it time to start thinking of a smartphone as something more like a tablet or a real computer? Is it possible to set up an Android phone with a full version of Linux – connected to a monitor, keyboard, and mouse?
Android OS is based on a modified version of the Linux kernel. In theory, a hardware-compatible Linux should be able to run on systems that Android OS runs on, but the Android developers at Google have added lots of proprietary drivers and bits. Additionally, the complexity of the communication hardware means that Android has drifted quite a distance from what we think of as a conventional Linux. Still, the power of the GPL means that Android OS is available to the community in source code form [1], and of course, developers all over the world are always tinkering with Linux to make it do useful things. A number of independent distros have evolved to provide mobile alternatives based on both the Linux kernel and the Android kernel (see the box entitled "Linux on Android Distros").
Linux on Android Distros
Several Linux distributions bill themselves as replacements for Android in the mobile space. These distros are all at various stages of completion – some work for certain phones but not others, and some are still in preliminary stages of development. Be sure to check the hardware compatibility list and read as much as you can about these alternatives before you install. Examples include projects such as:
- Ubuntu Touch – a mobile version of Ubuntu. When Canonical backed off on their mobile initiative a few years ago, the UBports community took over the development and maintenance.
- postmarketOS – a mobile OS based on Alpine Linux.
- Sailfish OS – a commercial project that bills itself as "a European alternative to dominating mobile operating systems." Sailfish is based on the code from the old MeeGo mobile OS.
- Mobian – a project promising Debian for mobile devices.
Another class of distros retains the Android base system but removes the proprietary parts, thus creating what is basically an Android-based system that is free of Google. Distros such as LineageOS, Replicant, /e/, and GrapheneOS are examples of open source, non-proprietary systems based on Android.
A full install of a mobile-based Linux on your smartphone provides a complete escape from Google's walled garden and offers access to the wide range of applications provided with Linux. But it also comes with some risks. You'll need to root your phone to replace the factory-installed OS, which will almost certainly void the warranty. If anything goes wrong, you might not be able to restore the original system.
This article describes a less radical alternative for running Linux on your Android. UserLAnd is a compatibility layer for Android OS that lets you run selected Linux distros on Android – all without rooting you phone. Of course, you are not really replacing Android, so if that is your goal, one of the alternative Linux mobile systems would be a better choice. But if you're looking for the Linux desktop, UserLAnd delivers it with minimal disruption. I'll show you what worked and what didn't – and I'll explore how the performance of a UserLAnd Linux smartphone compares to an average home computer.
A note on the hardware used in this study: My smartphone is powered by a 2018 Qualcomm Snapdragon 845 with 8 cores and 4GB RAM, including an Adreno 630 GPU. I also tested my daughter's phone, with the successor Snapdragon 855 and 6GB RAM plus an Adreno 640 GPU.
Monitor
If you want to embark on the adventure of converting your smartphone into a PC, the first step is to equip it with the necessary components. First comes the monitor. An Android smartphone with a USB-C port can output the screen image on a monitor or TV. However, not all recent Androids support this option; some – by Sony, for example – fail to identify the adapter.
But that does not mean you have to give up. If you don't have a working port, you can always fall back on wireless screen sharing with Google Cast or another similar tool. I have also had some good experiences screensharing (also known as screen mirroring) with Miracast on LG and Sony devices. Miracast is a Wi-Fi Alliance standard that connects two devices wirelessly via Wi-Fi Direct and was integrated into Android versions from 4.2 and up to 6.0. Google's Chromecast took the place of Miracast in later Android versions.
Mouse and Keyboard
You can easily connect a mouse or keyboard via Bluetooth or with a suitable adapter. I use a combined USB-C Type-C-to-HDMI-HDTV adapter, which offers one HDMI, one USB-C, and one USB-A 3.0 port. Because the adapter gets very warm, I added a passive heat sink which was available from another project.
I plugged a small dual distributor into the USB-A port, which also has space for a microSD card. I had to make the distributor narrower on the side to make room for the wide HDMI connector. A small extension or a differently designed distributor would also solve the problem if necessary. There are also adapters that offer four independent USB-A ports.
Software
Android 10 comes with a new desktop mode that it enables when an HDMI adapter is connected. Depending on the manufacturer, this feature works more (Samsung, Huawei) or less (LG) well. You can also disable desktop mode in favor of simple screen mirroring. No matter what you decide on, the LG smartphones always output Full HD at 60Hz. Many Android apps still have to be adapted to this new desktop mode (wide format).
In order to run conventional Linux applications on Android, you need to emulate a Linux runtime environment on the smartphone. Luckily, the Linux community has a solution: the UserLAnd project, which is hosted on GitHub [2]. The software is also available on F-Droid and in the Google Play Store, or you could also compile it yourself – more on that later. Rooting is not required, and you do not need Google services.
The display of the smartphone's screen content is handled by a VNC viewer, which also runs on the smartphone and then sends the image to the external monitor (Figure 1). Various viewers are available for this; I can recommend bVNC Free and RealVNC. The VNC session runs in the smartphone on the localhost address 127.0.0.1:5951.
To completely fill the image area of the external monitor, you might have to set the format to 16:9. RealVNC v3.6.1 cannot cope with the Android 10 desktop mode at all, and bVNC always outputs an overly bright image; however, bVNC offers a well-scaled mouse pointer, at least in desktop mode. If the desktop is not completely visible or you want to enlarge a part of it, you can adjust with a two-finger gesture on the smartphone.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Juno Tab 3 Launches with Ubuntu 24.04
Anyone looking for a full-blown Linux tablet need look no further. Juno has released the Tab 3.
-
New KDE Slimbook Plasma Available for Preorder
Powered by an AMD Ryzen CPU, the latest KDE Slimbook laptop is powerful enough for local AI tasks.
-
Rhino Linux Announces Latest "Quick Update"
If you prefer your Linux distribution to be of the rolling type, Rhino Linux delivers a beautiful and reliable experience.
-
Plasma Desktop Will Soon Ask for Donations
The next iteration of Plasma has reached the soft feature freeze for the 6.2 version and includes a feature that could be divisive.
-
Linux Market Share Hits New High
For the first time, the Linux market share has reached a new high for desktops, and the trend looks like it will continue.
-
LibreOffice 24.8 Delivers New Features
LibreOffice is often considered the de facto standard office suite for the Linux operating system.
-
Deepin 23 Offers Wayland Support and New AI Tool
Deepin has been considered one of the most beautiful desktop operating systems for a long time and the arrival of version 23 has bolstered that reputation.
-
CachyOS Adds Support for System76's COSMIC Desktop
The August 2024 release of CachyOS includes support for the COSMIC desktop as well as some important bits for video.
-
Linux Foundation Adopts OMI to Foster Ethical LLMs
The Open Model Initiative hopes to create community LLMs that rival proprietary models but avoid restrictive licensing that limits usage.
-
Ubuntu 24.10 to Include the Latest Linux Kernel
Ubuntu users have grown accustomed to their favorite distribution shipping with a kernel that's not quite as up-to-date as other distros but that changes with 24.10.