Can I flash Android devices under Linux?

Linux Use Linux on your smartphone - that's how it works

display

Linux can be used in different ways on the smartphone - even if it is not entirely trivial. In the following, we will show you the options and how to use Linux on your smartphone.

Overview of the possibilities

Smartphones are basically pretty powerful little computers. And Android is basically nothing more than a (very special) Linux distribution. What could be more obvious than using a normal Linux distribution on the smartphone? Unfortunately, it's not that simple.

There are alternative operating systems for smartphones, Linux can be used as a App run or as Remote desktop and alternatively you can just simply Linux tools on the command line. Everything has its advantages and disadvantages.

Linux as the operating system

The desire for a "real" Linux smartphone is not that easy to satisfy. Probably the most promising system like Ubuntu Touch which actually completely replaces Android. The installation is very simple using a guided installation wizard, but the problem appears on the "Devices" page: The compatible devices are listed here. And these are currently: OnePlus One, Fairphone 2, Nexus 4/5, two Meizu and three bq devices; In addition, the Moto G from 2014 is listed as a "Community Device".

The situation is similar with other approaches; at best, real Linux smartphones are only available for individual (rare) devices. This also applies to the Librem 5, which can only be pre-ordered.

Linux as an app

Linux can also run as an app directly under Android - and the best thing: without root! We want to show you two options: Debian noroot and the combination of GNURoot Debian and XServer XSDL. The first app provides the actual Linux system and the second ensures that its desktop environment lands on the display. In the meantime, GNURoot Debian has been discontinued. The successor UserLAnd is in no way inferior to the application and is referred to as a replacement for the app.

The variant with the app Debian noroot is trivial to set up: To install The app, wait a few minutes and a typical pop will pop up Linux desktop on. Unfortunately, a lot of things don't work here, at least on some devices. In addition, the tool, at least here on an Honor 6X, Extremely slow. Basically, it's only good for taking a quick look at Linux.

The second variant runs much more reliably and faster, but has to be set up a little more complex. First, install the two apps from Google Play. Then start XServer XSDL. The app initially only shows a blue screen with commands to be entered in the other app.

Switch to UserLAnd. Here you already have the running Debian, but still without any graphical user interface. First, update the system with the following commands:

apt-get update
apt-get upgrade

Then install the desktop environment LXDE, the "Audio output"(pulseaudio) and the graphical package manager Synapticin order to be able to install software later without the terminal:

apt-get install lxde pulseaudio synaptic

Last but not least, you have to UserLAnd still tell where graphics and audio output should end upwhat about the command "export"works. Enter the address as the IP of the smartphone on, in the example the "192.168.178.89". You can read them out via your router, via many network apps or directly in GNURoot Debian via the command "ip a". In the somewhat confusing output you will find the IP under the section"default".

export DISPLAY = 192.168.178.89: 0
export PULSE_SERVER = tcp: 192.168.178.89: 4712

Well you can finally too XServer XSDL switch - where you one LXDE desktop should expect. A tip for both variants: If you send the smartphone display to a monitor via Chromecast and then connect the mouse / keyboard to the smartphone via a USB OTG adapter, you basically have a complete desktop computer - if not that Fastest.

Linux as a remote desktop

display

If it is only about being able to use Linux on the go, for example, there is of course always a variant Remote desktop: Linux runs on the NAS at home, for example, and you just leave that Transfer the desktop purely graphically. This is sometimes quite jerky and nothing for everyday use, but at least you can also do computationally intensive tasks this way, after all, the smartphone only has to display the image, not run a second operating system. In the home network, the setup can be set up very quickly: On Linux, a VNC server run and on the smartphone VNC viewer.

For example, on Linux you can use the x11vnc server above "apt-get install x11vnc"install and then with"x11vnc"Start. On Android, for example, the VNC Viewer is ideal: Simple to install, one create a new connection, the IP address of the Linux computer specify and the desktop lands on the smartphone. But be careful: this is no secure connection - x11vnc will notify you of this after the start and the viewer will also notify you about this. hints about Protection by means of a password supplies x11vnc with the message. In a network in which other users are also located, you should only use this variant if you can trust all participants. Or you acquire in-depth knowledge of network security.

It gets complicated when this Linux-under-Android variant is to work via the Internet: You would have to so that your home network is always accessible from the outside at all Set up dynamic DNS. In short, this is a service that enables an address such as "meinrechner.dynmischer-dns-dienstleistungen.de" to always point to the current IP of your router. This IP changes, depending on the DSL provider, sometimes more often, sometimes less often - but it is not fixed. But dynamic DNS is another topic of its own.

Alternatively: Linux tools

If all of this is too much effort for you and you only need a Linux terminal every now and then, you can of course also do this without a complete Linux distribution. A wonderful tool that should not be missing on any Android smartphone is the free Termux app. Termux is a Terminal emulator, which brings a whole range of typical Linux tools with it. Basically, you can work in the same way as in front of your home computer. A very trivial example: The "htop" command can be used to call up a graphically prepared task manager that provides fairly precise information on how the system resources are being used.

You can also script and automate to your heart's content in the terminal. And then it is worthwhile to install the Termux extensions, especially Termux: API. The API function gives Termux access to the hardware features, such as vibration, camera or GPS data. And so, for example, scripts could be created that evaluate the GPS data and let the device vibrate when a certain point is reached.