Linux Fu: The Linux Android Convergence

Linux Fu: The Linux Android Convergence

The Android phone that you carry in your pocket is basically a small computer running Linux. So why is it so hard to get to a usable Linux environment on your phone? If you could run Linux, you could turn your cell phone into an ultra-portable laptop replacement.


Of course, the obvious approach is just to root the phone and clean-slate install a Linux distribution on it. That’s pretty extreme and, honestly, you would probably lose a lot of phone function unless you go with a Linux-specific phone like the PinePhone. However, using an installer called AnLinux, along with a terminal program and a VNC client, you can get a workable setup without nuking your phone’s OS, or even having root access. Let’s see what we can do.


AnLinux


AnLinux takes advantage of the fact that Android is really Linux underneath. It lets you mount an image file that contains a root file system from any of several distributions including Ubuntu, Kali, Fedora, CentOS, OpenSuse, Arch, Alpine, and others. In addition to creating a script that does a chroot to “mount” the image, the installer also uses PRoot to simulate root access.


PRoot intercepts any calls you make that would normally require root access and makes them work in the current context. It uses the ptrace system call to effectively debug your software in order to do this. With PRoot, you can do things like a chroot without being root and PRoot also provides fake user permissions on your pseudo-file system.


AnLinux itself isn’t a big program. It installs operating system images and creates scripts that can start the environment for you. Then you’ve got a fake Linux computer running inside your Android phone while Android ..

Support the originator by clicking the read the rest link below.