6

As of May 2019 what are the options (if any) to install Ubuntu server on a smartphone device?

I don't need much of the smartphone functionality, I don't need desktop and touchscreen blows and whistles at all (the phone will be accessed mostly through SSH and USB, it would be nice to have a working terminal on the phone).

I intend to use my old device (originally Android, Nexus 4 or BQ Aquaris E5 or ASUS ZenFone 2) as a mobile LAMP server and run lxc containers on it (serving the apps).

Does anybody have any experience / ideas?

I looked at Ubuntu Touch / UBports solution, but it focuses mostly on smartphone functionality (supporting all hardware, installing Android apps, nice touch desktop etc.). I need more of a server - less of a smartphone... Not only me, perhaps.

BTW the most detailed answers related to Ubuntu Touch (for those who are interested) are gathered here: What hardware does Ubuntu Touch support?

Links to related questions / discussions:

  1. How to use Android SDK and smartphone vendor tools to boot another kernel?

  2. Ubuntu Touch (UBports) and Android support for LXC/LXD containers (for running Ubuntu): current state

  • 1
    UBports is actually your best bet because you need hardware support. Then, if the server features are available for that architecture (I'm really not sure), they can be installed. –  May 14 '19 at 08:49
  • Well, I need only WiFi and USB for connectivity and a touch screen with working terminal. I'm still reading info on UBports and trying to figure out how it would be possible to start a container. They have some sort of a container technology available (https://docs.ubports.com/en/latest/userguide/dailyuse/libertine.html) but it seems to be focused on user apps (running android apps) not server. – Dmitry Somov May 14 '19 at 08:57
  • 2
    For ARM you actually need the manufacturer to release the source code including the proprietary drivers. It's not the same as desktop PCs. –  May 14 '19 at 08:59
  • 1
    One of the mentioned devices is "BQ Aquarius 5" which was one of the Ubuntu Touch flagships back in 2015. It should have most of the source code open. – Dmitry Somov May 14 '19 at 09:01
  • Any supported device in Touch or UBports was done that way, with the source code. –  May 14 '19 at 09:03
  • 1
    Why? It is not their platform so why would they? Canonical's focus is on the cloud and servers with the desktop as a side effect. They tried with an Ubuntu phone with Ubuntu but that was not worth the investment and rightly ended that project. Making a replacement for Android is going to be expensive too: licenses need to be paid. Android does an excellent job with their software. So does Apple. Not even Microsoft can get a dent into their marketshare. And they did try. Several times. Anything Linux with phones is going to be a community driven event. Not an official event. – Rinzwind May 15 '19 at 06:39
  • Dear Rinzwind, did you read my question? I am not asking for full hardware support, I need a server first hand. I've been tracking Ubuntu Phone efforts since the very beginning. Those phones are all ARM-based architecture SoCs with proprietary hardware added (sound, cameras, giros, GPS etc.). No need to support that hardware, just the core ARM/RISC instruction set... We need that to make pocket servers from our old smartphones. Am I wrong? – Dmitry Somov May 15 '19 at 08:25
  • I tried to mount a bootable CD image on Ubuntu Phone (https://www.ubuntu.com/download/server/arm), but couldn't do it. sudo mount -o loop *.iso /media/iso doesn't work.

    I will try to utilize the netboot option (https://help.ubuntu.com/community/Installation/Netboot). Looking for success stories...

    – Dmitry Somov May 15 '19 at 12:39
  • Why not just get started by installing Ubuntu phone and fixing whatever breaks? I wouldn't do it but there is no reason you can't brick your phone and repair it – WinEunuuchs2Unix May 15 '19 at 12:39
  • The other option (which is not an option - just a test) would be trying to use Android tools like "Linux deploy" or "UserLAnd". I tried to install lxc/lxd on UserLAnd but hit into issue with 'sudo lxd init' command: 'Error: Failed to connect to local LXD: Get http://unix.socket/1.0: dial unix /var/lib/lxd/unix.socket: connect: no such file or directory'. This was expected (I wouldn't expect containers to work in a chrooted environment). – Dmitry Somov May 15 '19 at 12:40
  • To WinEunuuchs2Unix: on Ubuntu Phone I couldn't make lxc/lxd work and I couldn't mount an ISO file (http://cdimage.ubuntu.com/releases/18.04/release/ubuntu-18.04.2-server-arm64.iso) either. I was hoping to mount and just run the installer from it or boot from it as you would do on a PC. Again, my goal is to install server linux - not desktop. – Dmitry Somov May 15 '19 at 12:45
  • ...to Rinzwind: and I disagree about Canonical. Their focus has always been on the desktop (No.1 desktop linux). They put very much efforts on developing alternative desktop environments (PC and mobile) and were trying to find their way. It just came out that [hi-end] desktop and [hi-end] mobile are strongholds of a proprietary hardware-software world... The question is why didn't they think about huge amount of unused ARM/x86 devices (previous generation smartphones) as potential [low-end] servers or even [low-end] desktop units? – Dmitry Somov May 15 '19 at 14:24
  • Ask Ubuntu is not a discussion forum. Please take such discussion to one of the forums/reddit/etc… which are sites designed for longer discussions on such broad and opinionated topics. This is not the place to work out the design for a new derivative of Ubuntu that you wish to be created. Please stop arguing with the answers given to you, because they are not what you want to hear, and asking more and more questions which you will not like the answers to, only telling us to not answer them because you won't like the answers. – dobey May 22 '19 at 13:39
  • @DmitrySomov Just a note: You are moving into territory explored only by a few. That typically requires quite a lot of tinkering which in turn require quite a bit of experience to know what you are doing. You having to ask this question, imply that you don't have that level of expertise yet, and therefore you may have a better experience using another, more suitable device for what you want to do. – Thorbjørn Ravn Andersen May 24 '19 at 06:59

1 Answers1

5

{{ UPDATE 2 }}

The second part of the answer with more details on research path is given here:

How to use Android SDK and smartphone vendor tools to boot another kernel?.

{{ UPDATE 1 }}

AFTER A MORE DETAILED RESEARCH THE CONCLUSION IS SIMPLE:

MISSION IMPOSSIBLE

As of May-2019 it is impossible to install any of the mainstream linux server distros on smartphones (listed in the question and most likely any other) in a feasible way. If you have a decent 2-3 year old hardware (like ZenFone2 with 4-core 2.3Ghz 22nm 64bit Intel Atom CPU, 4Gb RAM and 64Gb flash drive and with scratched screen), just sell it for nothing, give it away or break it. The hardware you paid for has a very limited usage (compared to a PC).

There seem to be some initiatives but they are so weak and marginal that are barely worth mentioning. Only one link is enough to understand the situation: https://en.wikipedia.org/wiki/List_of_open-source_mobile_phones

Only ONE phone in the list (a honeypot? or a carrot? or both?) which is even not available at the moment have 'multiple community-driven' in the OS column. To me the situation is clear. No way guys)))

{{ ORIGINAL ANSWER }}

After a small research I found out that things are not as good as they could be.

Debian community instructions could be found here:

https://www.debian.org/releases/stable/armhf/ch02s01.html.en#armhf-armmp-supported-platforms

Section 2.1.3. Variations in ARM CPU designs and support complexity gives general view of the problem and possible solutions to it. It seems to be possible to install Debian server on a smartphone, but the process is rather painful.

Some examples:

1) http://julianwi.square7.ch/debian-on-smartphone/

2) http://bonedaddy.net/pabs3/log/2012/12/03/debian-mobile/

Ubuntu:

I managed to install UBports / Ubuntu Touch on Nexus 4 (ARMv7-A CPU) easily with the help of their wonderful user friendly ubports-installer (https://ubuntu-touch.io/get-ut). The process took 5 minutes or so (I had to activate developer mode on the phone and restart it 2 times), all things were handled automatically, the phone booted into working Ubuntu Touch OS nice and smoothly. However that was not the task. I needed ubuntu-server.

Then I found mentioning of another tool on UBports site (FAQ section), namely MDT (https://github.com/MariusQuabeck/magic-device-tool). It is no longer supported but its purpose is much closer - it was supporting various OS images (including Ubuntu Desktop 13.04!) and various smartphone models. Very sad that this tool is no longer maintained. It would solve the problem if ubuntu-server image for arm devices was supported. I am wondering whether the maintainers of UBports could extend their tool (ubports-installer) and add support of server images (perhaps use MDT tool codebase)...

I will try to install ubuntu-sever (or debian) manually, but unfortunately this is going to take more research / time than it could (if we had a working / maintained version of the installer). We don't need a gui version like ubports-installer, just a CLI version which would bundle working scripts maintained by people behind MDT project and UBports team.

  • 1
    Did you have a closer look at the Aquarius? It should be relatively well supported with the latest edition of ubuntu touch. – Thorbjørn Ravn Andersen May 21 '19 at 15:04
  • 2
    Would be cheaper to just buy a Raspberry Pi 3b+. You are sacrificing a lot going from a real host to a mobile phone though. If you want to save money, mobile phones as servers is not the way to go (or Google App Engine would be running on mobile phones in their DC). – dobey May 21 '19 at 15:07
  • @Thorbjørn Ravn Andersen I looked at BA Aquaris E5, Yes. I liked Ubuntu Touch, but it is unable to run native linux containers (lxc/lxd) on it. That was the task (I develop web apps inside containers running Ubuntu, currently using django-uwsgi-nginx stack). – Dmitry Somov May 21 '19 at 15:11
  • 1
    Ah missed the lxc bit. Then I agree on the Raspberry Pi 3+ suggestion - it can run docker images which may have better tooling than lxc. – Thorbjørn Ravn Andersen May 21 '19 at 15:13
  • @dobey That's an option but I would prefer to use the hardware I paid for. In terms of hardware I have two ASUS ZenFone 2 devices with very decent hardware. One of them is scratched (the screen was replaced but scratched again))) This is a 4-core Intel 64-bit (32bit physical / 64bit instruction set support) processor running @ 2.3Ghz, 4Gb RAM and 64Gb flash drive (yeap, this the weakest point since it is not a redundant nand flash array as used in SSD, but comparable to HDD in terms of speed and reliablity). This phone doesn't update to Android > 6. It is outdated in terms of software... – Dmitry Somov May 21 '19 at 15:17
  • ...besides it has a battery (3000mAh) and generally would make a nice home server. – Dmitry Somov May 21 '19 at 15:19
  • "This phone doesn't update to Android > 6" - here I meant official vendor updates of course. Technically it can run modern versions. – Dmitry Somov May 21 '19 at 15:29
  • 2
    What you paid for, is a phone though. And phones are not servers. Phones are not PCs, and you cannot take a generic image and install it on any phone, and have a new OS. You are welcome to try postmarketOS to run a more standard Linux, but it is off topic for Ask Ubuntu, and Ubuntu is not working to build. IMO though, you'd be better off selling or donating your phones to people who would use them as phones and help develop things like Ubuntu Touch, pmOS, LineageOS, etc… and buying something more fit for purpose. A hammer can't be used a socket wrench, simply because it's what you have. – dobey May 21 '19 at 17:13
  • @dobey Some questions / comments on your notes: 1) Who (what entity) owns full rights to a generic "mobile phone" or "smartphone" design (same as for "server" or "PC")? That's an open question. Please don't answer otherwise it will be mess. 2) It is related to Ubuntu since it is a major distro (and a major server distro) and it would benefit from the expansion of supported hardware list and from new use cases. 3) From the hardware point of view modern smartphone is a PC / server. Form-factor is the only difference. Use cases will follow. It's inevitable. – Dmitry Somov May 22 '19 at 06:13
  • @dobey That's a very toxic and aggressive way to reply and/or comment on this issue. There are several reasons why one would want do that. The hardware in general is way superior to that one of a Raspberry Pi 3/4 and more efficient. For PC it already works, you have one OS which runs on most devices w/o special drivers (Linux, Windows) out of the box. The Pi3 equivalent would be somewhere around smartphones of the 2017s highend smartphones, which isn't too bad. – Tseng Jul 23 '23 at 15:51
  • Also thinking into the future, the current Samsung S23 Phones are 8 times faster than the Pi 4B, so even with an updated Pi (that could run of Rockchip 3588 it would still be less powerful than the current gen phones. Its through and through valid use case, especially since most phones comes free or subsidized by the mobile carriers where you can get a new free phone every 18 to 24 months, there's no need to put free money to your ISPs pockets – Tseng Jul 23 '23 at 15:55