Using a Google Nexus 5 as a Linux phone, in 2020

Using a Google Nexus 5 as a Linux phone, in 2020

One of the main objectives of Linux is to give new life to older devices, and many projects are proving this by running (somewhat) modern UIs even on ancient smartphones like the Nokia N900. However, specifications increased very quickly in the subsequent years (2011-2013), bringing to much faster portable devices even for modern standards.

Ironically, the AllWinner A64 chip (bulk-priced at $5 in 2015) used in the PinePhone and several other Linux-aimed portable devices is approximately as powerful as the Snapdragon 800 used in the 2013 Nexus 5 and other flagship phones at the time, now sleeping peacefully in many of our drawers.

Given the love the Linux community has expressed for some of the mobile processors used at the time, our first question is: could a phone of this age be used as a pure, true-Linux phone for modern standards?

Nexus 5 running Ubuntu Touch – YouTube

The answer, in most cases, is still no. While the abovementioned Snapdragon 800 (msm8974) is surprisingly well supported by the Linux community, with mainline kernel support and several boards already in the Linus tree, only few phones, like the Sony Xperia Z1 and the Nexus 5, have a dedicated motherboard Device Tree ("hardware descriptor") file in the Linux kernel. And while the former is mostly untested, the latter is surprisingly supported by several Linux distributions, as if considered some sort of "must-have" device for Linux hackers. In fact, many pre-PinePhone era YouTube videos demonstrating Linux on mobile devices were done on the LG Nexus 5, thanks to its wide community and software support.

This sounded like a true-Linux phone enough to convince me to get one. Opening up eBay and checking the listings for some days made me observe an average price of €75 (~$90) for used/refurbished and working devices, with dips below €60 (~$72) including shipping happening very frequently. While still relatively expensive for a 2013 smartphone, this is a fraction of the price of a Linux phone, which is still kind of justified by the high appeal of this device to the hacker community. In fact, I eventually found mine a listing for one being sold for €35 including shipping, with some scratches on the (replaceable) back cover, but that is the exception rather than the rule. And so I got it.

Nexus 5 running (desktop) GNOME Shell – YouTube

Specs looked particularly promising, with acceptably modern hardware and potential support for high-quality camera, fast wireless connectivity and GPU, decent battery and even potential convergence (!) through the somewhat dated SlimPort interface:

  • System on chip: Qualcomm Snapdragon 800
  • CPU: 2.26 GHz quad-core Krait 400
  • GPU: Adreno 330, 450 MHz
  • Memory: 2 GB of LPDDR3-1600 RAM
  • Storage: 16 GB / 32 GB
  • Battery: 2300 mAh, 8 Wh with Qi wireless charging
  • Display: 4.95" 1080×1920px IPS LCD, with Corning Gorilla Glass 3
  • Camera: 8 MP f/2.4 Sony IMX179 OIS
  • Connectivity: Micro USB, SlimPort, NFC, Bluetooth 4.0, Wi-Fi 802.11ac

My first test on it included Ubuntu Touch, which offered a butter-smooth, somewhat Android-like experience, with clean-looking interface and a dedicated "app store" for games and utilities. Camera, calls, wireless and GPU all worked without hiccups.

"Open Store" in Ubuntu Touch on my Nexus 5

The user interface was overall very nicely designed, but still felt quite weird and counter-intuitive at times: the lock screen tended to display somewhat useless and also slightly intrusive messages ("8 photos shot today" - um, good to know?), the lack of a true "starting screen" to leave the phone in (always unlocking to some app, whenever there are any open, is quite distracting), the status bar divided in many vertical "tabs", most of which containing just a couple of elements, and some UI controls (e.g. the ✖️) being sometimes too small to get right at the first tap, and some other minor issues and bugs (e.g. keyboard-related) preventing this OS from being entirely comfortable to use in daily life

But this was not enough: as some of the most informed on this topic will know, Ubuntu Touch is not based on the "mainline" Linux kernel, but rather on the "downstream" (that is, highly patched) Android kernel that came with it originally, with an abstraction layer, halium, to adapt Android drivers and userspace to Linux systems. To have a full Linux system I had to go further, and compile a postmarketOS image for my device.

As usual, this procedure proved to be as smooth as inserting some simple parameters in a wizard-like interface, where I decided to try out the Phosh user interface first, using the "bleeding edge" repositories plus the proprietary wireless drivers. And then I flashed and booted my new "pure Linux" system for the first time.

The postmarketOS "Welcome" app

The first quirks in the mainline kernel appear just after booting up, due to the GPU driver being still at an unstable and freeze-prone stage. This is, however, an issue that is being fixed and should go away within some months, giving the Nexus 5 an almost stable overall kernel.

While much of the Nexus 5 hardware is already supported through kernel drivers, it is important to notice that some of these, like those governing the Qualcomm modem, are not open-source, so we cannot really speak about an entirely blob-less system. To be precise though, as said in an earlier article, not even the Librem 5 and the PinePhone can currently boast entirely open-source hardware, although they are getting very close to that.

All desktops that were tried were somewhat "mixed bags": Phosh was robust but quite limited, and had several small issues, Plasma Mobile felt quite complete in terms of functionality, very unstable and some of its apps would not work, and while GNOME Shell (desktop) was probably the stablest overall, thanks to the focus on touch-friendliness since its first day, its UI was quite heavy and far from mobile-ready. As you may expect, desktop-focused environments don't even need to be mentioned. In short, (most?) Linux UIs and desktops for phones show their very young age, and fall far behind the Ubuntu Touch "Lomiri" desktop, which feels overall surprisingly smooth and polished.

Plasma Mobile update: May-August 2020 (plasma-mobile.org)

What works, and what doesn't

Calls and mobile data do not currently work in a stable way in postmarketOS, except at a basic level, but they work perfectly in Ubuntu Touch, making it a much more realistic target for daily usage. I could not try either due to the lack of a properly sized SIM card, so the above is mostly based on the available data and may be outdated.

For daily usage tasks, such as using my Nexus 5 as a media player or browsing the web, Ubuntu Touch proved to be an overall much more stable and production-ready candidate, due to the lack of complete mobile support by several GNOME and KDE apps in postmarketOS.

While the Ubuntu Touch browser made simple tasks possible and relatively smooth, although lagging on heavier pages, on postmarketOS both Firefox (much faster!) and Epiphany tended to crash quite frequently, making web browsing basically impossible. KDE's Angelfish was also unusable due to continuous crashing issues which may have been caused by the shell itself.

However, what left me a little confused was the somewhat Apple-like nature of the Ubuntu Touch interface. Booting up a "normal" browser or Linux app, such as Epiphany or Gedit, was impossible, and the however nice built-in Qt mobile browser was still leagues away from Firefox or Chromium, both working quite nicely on touch devices nowadays, in terms of features and scalability on heavy pages.

In general, the issue was the difficulty to run "normal" Linux apps on it, since the relatively closed nature of the "Open Store" (pun not intended) did not leave "normal" Gtk apps from Ubuntu repositories such as Fractal, Firefox or Nautilus to be installed, except using the easy to setup, but far from flawless, Libertine containers. This decision is justified by security reasons, and has been widely discussed, which however does not really solve its limitations. Instead, postmarketOS is much more "direct" on this front, with the repositories for desktop Alpine being directly accessible for installing all kinds of programs.

The Ubuntu Touch UI feels very modern and polished, although UI controls have a small clickable area

The cameras of the Nexus are still acceptable even for modern standards, and possibly better than their counterparts used in "proper" Linux phones - but very far from being top-notch. The main issue is that the Nexus 5 sensor works only in Android and Ubuntu Touch at the moment, since no Linux driver for it has been (and may be never) made.

Battery life looks to be still worse than the Android in both cases - that is, somewhat (~30%?) lower in Ubuntu Touch, and much worse in postmarketOS, due to the mainline kernel still missing many power management drivers and other optimization bits. Several projects are working on this aspect, since it is a main concern of all Linux-based phones, but the road is still long.

The Phosh lock screen on my Nexus 5

In conclusion, can we say the Nexus 5 is probably the cheapest "proper" Linux-running phone around? In some sense, probably yes.

It was surely neither born with Linux, nor designed for it, and its community is still smaller than the one supporting the Librem 5 and the PinePhone and their Linux distributions, but it costs less than half the still low PinePhone price to get online, has more computational power, and will be able to give a full Linux experience to its users once the GPU driver and some other minor issues (e.g. displaying the correct battery level – an issue that can get really annoying) get fixed.

This does not mean, however, that it is, or will become anytime soon suitable for stable or daily-driver usage on mainline kernel. This device will probably get into the list of "community maintained" postmarketOS devices within months, which would be an indicator of active maintainance and usability to a certain extent - still far from being to be used as a "daily driver".

Nexus 5 running Plasma Mobile – YouTube

What we can say at the time of writing is that if you want a stabler, more supported Linux phone, the PinePhone or the Librem 5 are surely both safer bets. If, however, a very simple, working mobile Linux software playground with mainline kernel support is what you are after, the Nexus 5 may be a choice as well.

Finally, we would like to remind you that while this article has been written with the Nexus 5 in mind, there are several other ex-Android phones that can run mainline Linux with hardware acceleration just as well, if not slightly better. You can find the list of them here, in the Community section, while an example of mainline Linux kernel running on the Samsung Galaxy A3 2015 can be seen in the video below.

You can follow TuxPhones on Twitter and Mastodon, or join our subreddit to have the latest news about Linux smartphones.