Debian 8 on the Nexus 5
Pocket Linux
Maru OS provides a desktop Debian on a smartphone.
Today's Android devices have plenty of RAM and viable processors: How great would it be to present the software directly on smartphones on an actual Debian system? Maru OS [1] makes this a possibility.
The system created by American developer Preetam D'Souza combines two operating systems in one firmware. Its custom ROM (v0.2.3 at press) for the Nexus 5 (it only works on this device so far) is available for download under a free license, providing both Android 5.1 in the Android Open Source Project version and Debian 8 "jessie." The Debian system only comes into play if the user connects the Nexus 5 to an HDMI-capable monitor via an adapter.
This solution immediately offers several advantages over the classic Android system: It is much easier to use Debian on a larger monitor than Android, which is particularly optimized for small displays and touchscreens. Additionally, basically all applications provided in the Debian project for the ARM platform start on the Debian system. Along with LibreOffice (v4.3), this also includes tools such as Gimp or the popular Apache web server. Even some rather exotic programs like Blender and LaTeX run on the Android smartphone.
Not surprising, however, is that the focus is more on the use of lightweight applications. The Nexus 5 might have plenty of memory with 2GB of RAM, but the built-in Snapdragon 800 CPU proves a bit weak when it comes to processor-intensive tasks.
For comparison, an Intel i5-5200U processor takes about 1.2 seconds to convert a 60-second WAV file (16-bit, 44.1kHz) into Ogg Vorbis format with the encoder call oggenc -q 10
. The Snapdragon 800, on the other hand, needs more than six seconds to work on this task (Figure 1).
Download and Installation
Maru was still in a (closed) beta phase, when tested for this article, but it was already easy to use the system on the Nexus 5. Anyone wanting to use Maru on a daily basis still has a few hurdles to overcome. For example, the Android part of Maru OS (Figure 2) can currently only be updated by reinstalling the system. The developer cannot provide Android's usual over-the-air updates. Users need to be flexible because the system is evolving rapidly.
Another drawback is that Maru uses Android 5.1, but Android 6 "Marshmallow" has been available for the Nexus 5 since October 2015. Additionally, the audio routing doesn't seem to work on the Debian system. When tested, the Nexus 5 didn't provide an audio signal via the HDMI output. The audio output works as usual on Android.
The source code was only available for beta testing when this article went to press, but you can now get a ZIP archive of around 700MB on the website's Downloads page [1]. This includes all the necessary system images and the tools required for the installation such as the Android Debug Bridge (adb
) and fastboot
.
The best approach for users is to activate the developer options on the Nexus 5, unzip the ZIP file in a folder, and access the install.sh
script. If necessary, this will unlock the smartphone's bootloader. Caution: This will delete all the data on the Nexus 5.
The ZIP package contains the installer and an uninstall.sh
script that, on request, re-equips the Nexus 5 with the original firmware from Google [2]. An unzipped version of the original firmware needs to exist on the computer for this to work. The script still expects the absolute path to the Nexus 5 firmware to then start the installation there. Running the uninstall.sh
script will erase all data on the smartphone.
How Does It Work?
Although previous attempts by Motorola, Ubuntu, and other manufacturers used virtualization or emulation and failed because of too little RAM in most cases [3], Maru uses the LXC lean container system from Linuxcontainers.org [4]. The Debian system thus directly accesses Android's kernel v3.4, rather than jessie's standard kernel (3.16). This kernel is then solely responsible for the complete virtualization. It acts toward the Debian system as if it is a PC based on the ARM architecture.
Separation from the Android system takes place through special kernel control groups (cgroups) that hierarchically assign all LXC container processors to a Linux process. Put more simply: LXC is a cross between a simple chroot
and a complete virtualization such as Xen or KVM. It uses fewer resources but can't, for example, simulate any other operating system, because it is still just a Linux kernel.
Practicality
Initially, the Android system is just pure Android (Figure 3). Anyone who also needs typical Google apps, such as the Play Store or Google Maps, should also download and load onto the Nexus 5 one of the images for the ARM platform and Android 5.1 from Open GApps [5]. The images provided there differ from many Google Apps. F-Droid [6], a free app store for Android apps, is an alternative software source. You can, at the very least, install a useful email client and a handful of practical tools.
The Debian system is pure Debian with Xfce as a desktop. Unlike a desktop installation, many tools are missing – although users skilled in using Debian can retrofit them using apt-get
. The lean system has proven to be advantageous. The only restrictions occur when no Debian package is available for ARMv7. Because Nexus 5's Snapdragon 800 isn't an ordinary x86 or x86_64 processor, it doesn't accept any i386 or x64 command sets.
When tested, no significant problems occurred when using LibreOffice, Gimp, ImageMagick, or several other tools. It was also possible to use Blender, as mentioned in the introduction (Figure 4); however, a powerful PC should probably be used for rendering.
Maru is only suitable on the go when used together with selected accessories. Users need a Bluetooth keyboard or a Bluetooth mouse, or both, and a special adapter for converting the Nexus 5's micro-USB port into an HDMI port. Carrying these devices around all the time would be almost as annoying – or even more annoying – than taking a small netbook. However, Maru is a very useful tool for anyone who has a Bluetooth keyboard with an integrated touchpad and the SlimPort adapter.
The question of how to use the application still remains. Monitors with HDMI input abound – almost every modern hotel room has one. Meeting rooms also often have a projector with HDMI input. Therefore, you could, for example, start a presentation created in LibreOffice natively (provided no sound is needed). Another scenario involves various work in the shell or programming. Whether you use Emacs or Vim, it is easier to work in Debian using a keyboard than on the Android system (Figure 5).
However, Maru users shouldn't simply trust their system with sensitive data, because there are no safeguards to protect the Debian container against unauthorized access. If the Nexus 5 is connected to an HDMI-capable monitor, the Linux system starts without asking for a password. However, you could create a TrueCrypt container in Debian or send encrypted mail using Mutt and GnuPG.
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 Computers Launches Another Linux Laptop
If you're looking for a powerhouse laptop that runs Ubuntu, the Juno Computers Neptune 17 v6 should be on your radar.
-
ZorinOS 17.1 Released, Includes Improved Windows App Support
If you need or desire to run Windows applications on Linux, there's one distribution intent on making that easier for you and its new release further improves that feature.
-
Linux Market Share Surpasses 4% for the First Time
Look out Windows and macOS, Linux is on the rise and has even topped ChromeOS to become the fourth most widely used OS around the globe.
-
KDE’s Plasma 6 Officially Available
KDE’s Plasma 6.0 "Megarelease" has happened, and it's brimming with new features, polish, and performance.
-
Latest Version of Tails Unleashed
Tails 6.0 is based on Debian 12 and includes GNOME 43.
-
KDE Announces New Slimbook V with Plenty of Power and KDE’s Plasma 6
If you're a fan of KDE Plasma, you'll be thrilled to hear they've announced a new Slimbook with an AMD CPU and the latest version of KDE Plasma desktop.
-
Monthly Sponsorship Includes Early Access to elementary OS 8
If you want to get a glimpse of what's in the pipeline for elementary OS 8, just set up a monthly sponsorship to help fund its continued existence.
-
DebConf24 to be Held in South Korea
Busan will be the location of the latest DebConf running July 28 through August 4
-
Fedora Unleashes Atomic Desktops
Fedora has combined its solid distribution with rpm-ostree system to make it possible to deliver a new family of Fedora spins, called Fedora Atomic Desktops.
-
Bootloader Vulnerability Affects Nearly All Linux Distributions
The developers of shim have released a version to fix numerous security flaws, including one that could enable remote control execution of malicious code under certain circumstances.