First impressions of WaydroidThe goal of being able to run Android apps on a laptop computer or on a GNU/Linux distribution has been the driving force behind several projects. The Android-x86 project seeks to run Android itself on common laptop and workstation hardware while projects like Anbox try to run Android apps on a GNU/Linux desktop using container technology. Today I'd like to look at another project which has the goal of running Android apps on both desktop and mobile GNU/Linux distributions. This young project is called Waydroid and its website suggests we can run many Android apps as though they were regular desktop applications.
There are some caveats to this wonderful plan of running Android apps on a desktop Linux distribution. One of the limitations is Waydroid needs to run in a Wayland graphical session. This essentially limits Waydroid to running on systems running recent versions of KDE Plasma or GNOME with compatible hardware. Though I had trouble finding specifics, it seems as though Waydroid needs specific kernel options to be enabled at build time - options which I'm told are incompatible with the Fedora family of distributions, unless we want to build a custom kernel.
Getting set up
According to the Waydroid website the supported options are to run Debian 11 "Bullseye", Ubuntu 20.04 "Focal", or Ubuntu 21.04 "Hirsute" with a Wayland session. We also need to have Python 3, cURL, and the LXC Linux container software installed. Most mainsteam distributions include Python these days, but cURL and LXC usually need to be installed through the package manager.
The distribution I was using this week was running MATE 1.24 which does not offer Wayland support so I had to look elsewhere. For the sake of my test I decided to install Kubuntu 21.04 which includes a KDE Plasma session running on Wayland. (Wayland is not the default session, but it can be selected from the login screen.) Once Kubuntu was installed I added the LXC and cURL packages, then confirmed Python 3 was available. Finally, I confirmed I really was in a Wayland session and began installing Waydroid.
The Waydroid website has step-by-step install instructions at the bottom of the main page. These walk us through setting up a new package repository, installing a Waydroid package, and then using that to download what appears to be a copy of an Android build. The Android software is installed by running "sudo waydroid init" and worked smoothly for me. The initial package is tiny, less than 1MB in size. The Android image is quite a bit larger, about 750MB in size. I feel it worth mentioning the Android image is unpacked in the /var directory so we should make sure we have plenty of free space in that part of the filesystem.
At first, when I tried to start the Waydroid service and launch a new session, the software claimed it could not start because it was not running on a Wayland session. I confirmed again my session was Wayland (provided by KDE Plasma's Kwin window manager). I then got the idea to restart the computer and, when Kubuntu came back on-line, I was able to start the Waydroid service and launch a session. The "waydroid status" command confirmed it was up and running, correctly identified my user ID, and that I was running a Wayland session.
At this point I tried to launch the Waydroid software from the application menu and, after a lot of disk activity, nothing happened. When I tried running the command "waydroid show-full-ui" which is suggested on the project's website, again nothing happened.
My system monitor showed the Waydroid container software was running and I could access the Android filesystem by running "sudo waydroid shell", giving me the chance to run commands in the Waydroid container. However, I could not get any graphical applications or controls to show up.
I next tried installing a package, the F-Droid software centre, which the Waydroid documentation recommends. The software installed and I could confirm the package was on the system by running "waydroid app list", but anytime I tried to run F-Droid nothing happened.
I went digging further through the Waydroid documentation and discovered that while both GNOME and KDE Plasma desktops should work, Waydroid recommends versions of Plasma "after 5.21". I was running version 5.21.4, which seemed likely to qualify, but perhaps the documentation meant the latest version of Plasma (5.22) was required? The documentation mentions GNOME running on Pop!_OS, Fedora, or Ubuntu should work. Earlier I mentioned there were comments on various forums that Fedora's kernel was not compatible with Waydroid, so I decided to try Ubuntu 21.04.
Starting over with a clean slate
I wiped Kubuntu from my system, set up Ubuntu 21.04 with GNOME, installed the LXC and cURL software, and confirmed I was running a Wayland session. Once again I installed the Waydroid software and once again its service failed to start until I had rebooted my computer.
Once again I was able to confirm Waydroid was running, I could access its shell and filesystem, and I could get the F-Droid software centre package to install. I then tried to run the Waydroid launcher from the application menu and nothing happened. I also tried running "waydroid show-full-ui" which results in a lot of disk activity, followed by nothing.
Checking on Waydroid's status and processes (full image size: 361kB, resolution: 1360x768 pixels)
The Waydroid documentation explains how to install a new Android package from the command line, but is unclear about what should happen when we try to launch the same package, or whether we should refer to the app by its full name (org.fdroid.fdroid) or its simple name (fdroid). I tried both and, in both cases, nothing appeared to happen. However, I could confirm the software (along with several default Android apps such as the settings panel and clock) were installed in the container by running "waydroid app list".
I tried running the clock, settings panel, and software centre - all without any visual results. I did see these programs show up in the list of processes when I ran top or ps, meaning the programs were running somewhere, I just couldn't see them.
Waydroid seems like a good idea and a useful concept. It's even relatively easy to set up, assuming you are running a distribution with the necessary kernel features and a modern Wayland session. The command line syntax for Waydroid is quite straight forward and it even has little helpful blurbs on what options are available. In short, the Waydroid project seems to be doing several things well.
While I could install Android apps into the container and even run them (according to my system monitor), I was unable to ever see any Android apps or interface. Perhaps I'm missing a key component, perhaps it's a bug. I looked through the Waydroid log (kudos to the team for making logging and debugging a key feature right from the start), but I was unable to find any problem. There was a warning at times about Waydroid not being able to identify the "host_user", but the "waydroid status" output also showed it correctly found my username and ID.
I've browsed through the project's issue reports and discovered several other people with the same problem, though we do not appear to have a common distribution, video card, or error messages. In other words, Waydroid seems like a good idea and (based on other reports I've read) Waydroid is working for some people. However, it's not ready for general use yet. It's close, but most people will probably need a more friendly installation process, a little more specific documentation on installing and running apps, and (in my case) to be able to see the apps we're running in the container.
Waydroid is close and I've heard it's already running pretty well on some distributions on the PinePhone, but it still has a little ways to go before I can recommend it to people who want to run Android software on their laptop or GNU/Linux phone.