This week, some news about Waydroid made its way to the r/linux subreddit and in the comments I saw a Pinephone owner write about their experience with Waydroid and none of his complaints had anything to do with it being slow or clunky or broken, which is about what my experience was the last time I tested out Anbox about a year ago.
So it prompted me to check Waydroid out, and... it works remarkably well! It really surprised me. Waydroid makes use of containers to run Android directly on your own Linux kernel, without emulation, and so it performs very well -- some Android apps even run more smoothly than their native Linux counterparts!
I wasn't expecting that the Pinephone was ever going to be able to run Android apps smoothly on a GNU/Linux system, but now that it does, and does so this well, this is a game changer in terms of the Pinephone being "daily driver" ready. Finally, I have a way to use Slack and Discord from my Pinephone, something that was basically not possible at all before!
Now, to be clear: even without Android, there are a very good collection of Linux apps that already work well on the Pinephone. Having the option of Android for the odd proprietary app like Slack or Signal is nice to have. Read on to the full blog post for how Waydroid works right now, what are some of its pain points still, and a few screenshots of my Phosh app drawer showing everything I have installed on my Pinephone.
This is how Waydroid behaves once installed:
There is a "Waydroid" app launcher in my drawer and this brings up the "Full UI" screen for Waydroid -- you see the LineageOS home screen and can see the home screen apps, swipe up for the Android app drawer, swipe down for the Android notifications drawer, and the Android task switcher works to switch between the various running apps.
In addition to this Full UI launcher, every Android app installed also gets a launcher icon directly in your Phosh app drawer, alongside your other Linux apps. You can directly run the apps from here as normal.
The window manager in Phosh generally separates the Android apps into distinct tasks as you'd expect, one window per app. It's sometimes a little janky, you'll switch to the Slack window but Discord came up instead.
LineageOS comes with a handful of "redundant" apps such as Contacts, Calendar, Clocks, Settings, and others that are similar to GNOME apps and clutter my app drawer; but you can remove their launchers from your ~/.local/share/applications folder and clean that up. For the Android apps I would literally never want to launch from Phosh they can be removed this way; you can always reach them from the "Full UI" and going thru the Android apps drawer.
Waydroid is still in development and many of the below issues will surely be resolved over time. But Waydroid is already working way better than I ever expected at such an early stage!
The Mobian wiki has instructions how to set up Waydroid. Apparently, the upstream project hosts their own dpkg repo for Ubuntu and Debian which is nice - so I'll get updates directly from the source as they're released.
A few strange quirks that Waydroid currently has:
And on the topic of keyboards: Android will use its own keyboard for Android apps, and the Phosh keyboard doesn't currently interact well with Android anyways. So while you are using Android apps you'll keep your Phosh keyboard hidden away, and the Android keyboard will appear when needed. It's a little weird having two keyboards, but oh well! Since Waydroid doesn't resize its window your Phosh keyboard would appear "on top" so even if you could type into Android apps with it, you wouldn't see the text you were writing because the text box is at the bottom of the Android screen, "below" your Phosh keyboard!
Waydroid uses a minimal LineageOS image as its Android base.
In Waydroid you can install the F-Droid app store and, through that, install the Aurora Store -- a third-party client for the Google Play Store. With Aurora you can download all your usual Android apps such as Slack, Discord, Netflix, and so on.
Like any de-googled Android ROM, some apps from the Play Store won't function without the Google services and other apps may have limited functionality. See my Degoogle Wiki for some of my notes on de-googling Android and some apps that still work fine without the Play Services.
Notable apps that will not work on Waydroid include:
But many apps that I personally use will work fine without Google services.
Slack was the first one I installed. My workplace uses it and it's a crucial app for me to have so I can stay responsive to work in case I'm away from my laptop for a while. There was previously NO good way to use Slack from the Pinephone -- their mobile website just directs you to the Play Store, and their desktop web app isn't optimized at all for the phone's screen size; you need to zoom out the page quite a ways to see the UI properly but then text size is very small. Workable in a pinch but not great. I have looked at Pidgin plugins and Matrix bridges for Slack but options are not good. It is very nice having the Android Slack app easily runnable on the Pinephone!
Discord also works well -- see the screenshot at the top of this blog post. Keep in mind that the camera and microphone aren't working yet, but for just chat and sharing files and pictures all is fine!
Bank of America works (updated Oct 11 2021), this has been my bank for ages and they have a fully functional mobile website that would work in Firefox but also their Android app works in Waydroid. I had trouble searching in Aurora Store for the app but used the link from their website and installed it; could sign in and everything. On de-googled Androids I've tried the BofA app even supports the fingerprint reader! The Pinephone doesn't have one of those (yet) and I wouldn't expect Waydroid to pass it thru yet even if it did but all the basic features of the BofA app are working!
Signal works fine. I needed to manually download the .apk from Signal's website because the Aurora Store said the app "wasn't compatible" with my phone - but it works fine! The manually downloaded APK even has a work-around for the lack of push notifications. I was able to activate a new account (using my Google Voice number) within Waydroid on Pinephone and send messages.
Telegram also works -- and it works better than the native Linux client does! Under Mobian, Telegram Desktop takes a very long time to log on whereas the Android app comes right up (provided Waydroid is warmed up already).
Spotify works -- I could log in and play music. I tested this app to verify whether DRM-heavy apps will function, and it seems to! I have not tested Netflix or Hulu though, as I have little interest to watch video on my phone and there is no Chromecast support anyway.
Twitter works great. They have a mobile website too which is OK and there were already a few options to access Twitter on the Pinephone without Android. Even on my Pixel phone I prefer Twitter in a web browser over their native app, but the web browsers on Pinephone struggle a bit with their website, so it is nice to have the native app available.
VLC Media Player works! It plays videos back really well too, at least for the h.264 encoded video I tested it with. Your mileage may vary with other video codecs. While VLC has built-in Chromecast support, it does not seem to work under Waydroid.
Jellyfin doesn't really work. Its in-built Chromecast feature, too, can not detect any actual Chromecast on my network. When I stream a video, I can hear the audio but the video output is just black.
The Pinephone was already getting close to "daily driver ready" before Waydroid and now it's even better! Here are the full set of apps I currently have installed on my Pinephone, a few of which now are Android apps!
The app list in text form:
53 native Linux apps to 13 Android apps - not a terrible ratio to have!
All of the above apps work well on the Pinephone except where noted otherwise.
There are 5 comments on this page. Add yours.
Hi Noah, Thanks for this post about your experience with Waydroid. I've been hoping to run some Android apps such as Signal on my PinePhone but haven't had much luck with Anbox, so Waydroid sounds very promising. I have a clean Mobian/Phosh installation on a 64 Gb SD card and followed these installation instructions: https://docs.waydro.id/usage/install-on-desktops Everything seemed to install fine but when I try to open Waydroid nothing happens on the phone. 'sudo systemctl status waydroid-container.service' shows that it is running but that command shows this error after trying to open Waydroid:
Oct 09 21:45:22 mobian systemd: Started Waydroid Container. Oct 09 21:46:04 mobian waydroid: [21:46:04] Failed to add service waydroidhardware: -1
The output from $ waydroid log > ~/waydroid-log.txt shows lots of problems (edited for length):
(002822) [21:45:59] Failed to get service waydroidplatform, trying again... (002076) [21:45:59] Failed to get service waydroidplatform, trying again... (002903) [21:45:59] Starting waydroid session (002903) [21:45:59] Save session config: /var/lib/waydroid/session.cfg (002903) [21:45:59] UserMonitor service is not even started (002903) [21:45:59] Clipboard service is not even started (002883) [21:46:00] % /usr/lib/waydroid/data/scripts/waydroid-net.sh start (002076) [21:46:00] Failed to get service waydroidplatform, trying again... waydroid-net is already running (002883) [21:46:00] % umount /var/lib/waydroid/rootfs/vendor/waydroid.prop (002883) [21:46:00] % umount /var/lib/waydroid/rootfs/vendor (002883) [21:46:00] % umount /var/lib/waydroid/rootfs (002883) [21:46:00] % mount /var/lib/waydroid/images/system.img /var/lib/waydroid/rootfs (002883) [21:46:00] % mount -o remount,ro /var/lib/waydroid/images/system.img /var/lib/waydroid/root fs (002883) [21:46:00] % mount /var/lib/waydroid/images/vendor.img /var/lib/waydroid/rootfs/vendor (002072) [21:46:01] Failed to get service waydroidplatform, trying again... (002822) [21:46:01] Failed to get service waydroidplatform, trying again... (002883) [21:46:01] % mount -o remount,ro /var/lib/waydroid/images/vendor.img /var/lib/waydroid/root fs/vendor (002883) [21:46:01] % mount -o bind /var/lib/waydroid/waydroid.prop /var/lib/waydroid/rootfs/vendor/ waydroid.prop (002883) [21:46:01] % chmod 777 -R /dev/ashmem (002883) [21:46:01] % chmod 777 -R /dev/dri (002883) [21:46:01] % chmod 777 -R /dev/fb0 (002076) [21:46:01] Failed to get service waydroidplatform, trying again... (002883) [21:46:01] % chmod 777 -R /dev/video3 (002883) [21:46:01] % chmod 777 -R /dev/video2 (002883) [21:46:01] % chmod 777 -R /dev/video1 (002883) [21:46:01] % chmod 777 -R /dev/video0 (002883) [21:46:01] % lxc-start -P /var/lib/waydroid/lxc -F -n waydroid -- /init (002883) [21:46:01] New background process: pid=2941, output=background lxc-start: waydroid: cgroups/cgroup2_devices.c: bpf_program_load_kernel: 348 Invalid argument - Fail ed to load bpf program: (null) (002883) [21:46:01] Save session config: /var/lib/waydroid/session.cfg (002903) [21:46:01] Failed to start Clipboard manager service, check logs (002072) [21:46:02] Failed to get service waydroidplatform, trying again... (002822) [21:46:02] Failed to get service waydroidplatform, trying again... (002883) [21:46:04] Failed to add service waydroidhardware: -1 (002903) [21:46:04] Failed to add service waydroidusermonitor: -1 (002072) [21:46:05] Failed to get service waydroidplatform, trying again...
Do you have any ideas about how to resolve these issues?
Waydroid has been finicky like this for me each time I upgrade, it seems. My Mobian install is currently upgraded to the bookworm (testing) branch, and I realized I had originally installed Waydroid using their bullseye (stable) repo; so I corrected that and then Waydroid was failing to start.
I found two common issues that come back now and again:
One is that the Waydroid container fails to start, and
waydroid log says that it failed to mount tmpfs on /usr/lib/x86_64-linux-gnu/lxc/mnt_extra and when this happens the solution is to run
sudo waydroid upgrade to download the latest LineageOS base. This has happened to me on at least two
apt upgrades of Waydroid, so they seem to break something often here.
Another problem was in case every Waydroid command would say: "Run 'waydroid log' for details." and even when you run
waydroid log it says the same instead of showing you the log. This turned out to be a log file ownership problem and how I eventually got it working was: I had to add
--details-to-stdout to all waydroid commands and could manually start the container, session, and show-full-ui.
Waydroid worked great on my last upgrade a couple of days ago, I'll try a latest apt upgrade on bookworm and update if any such tweaks were needed. Their install and manual troubleshooting documentation and checking their issue tracker I can usually get it running again; it does suck during times when I can not.
Update: after an upgrade and a reboot (there was no Waydroid update for me today), was able to just launch the Full UI with no fussing about on the CLI. Try
sudo waydroid upgrade to ensure the Android base is updated or try a reinstall from scratch.
Thanks Noah. Unfortunately I still haven't gotten it working and I'm not sure what to try next. Here's what I've tried:
sudo waydroid upgradedidn't do anything
python3-pyclip, but I don't think that fixed anything significant.
It appears from the logs that the key problem is related to bpf. Maybe I need to try a different kernel?
(010821) [13:52:22] % lxc-start -P /var/lib/waydroid/lxc -F -n waydroid -- /init (010821) [13:52:22] New background process: pid=10869, output=background lxc-start: waydroid: cgroups/cgroup2_devices.c: bpf_program_load_kernel: 334 Invalid argument - Failed to load bpf program: (null) (010821) [13:52:22] Save session config: /var/lib/waydroid/session.cfg (010836) [13:52:26] Failed to add service waydroidusermonitor: -1 (010836) [13:52:26] Failed to add service waydroidclipboard: -1 (010821) [13:52:26] Failed to add service waydroidhardware: -1 lxc-start: waydroid: conf.c: run_buffer: 323 Script exited with status 126 lxc-start: waydroid: start.c: lxc_end: 996 Failed to run lxc.hook.post-stop for container "waydroid"`
This is what I have now:
mobian@mobian:~$ uname -a Linux mobian 5.10-sunxi64 #1 SMP PREEMPT Sat Aug 7 12:10:38 UTC 2021 aarch64 GNU/Linux
I'm running the same kernel as you, I'm not sure what the bpf thing is about and didn't find much on Google; here are some details from my Pinephone:
[kirsle@pine ~]% cat /etc/debian_version bookworm/sid [kirsle@pine ~]% uname -a Linux pine 5.10-sunxi64 #1 SMP PREEMPT Sat Aug 7 12:10:38 UTC 2021 aarch64 GNU/Linux [kirsle@pine ~]% lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux bookworm/sid Release: testing Codename: bookworm [kirsle@pine ~]% waydroid --version 1.1.1 [kirsle@pine ~]% md5sum /usr/bin/waydroid e74e7a364382cc301a182050655da4d5 /usr/bin/waydroid [kirsle@pine ~]% cat /etc/apt/sources.list deb http://deb.debian.org/debian bookworm main [kirsle@pine ~]% cat /etc/apt/sources.list.d/mobian.list deb http://repo.mobian-project.org/ bookworm main non-free [kirsle@pine ~]% cat /etc/apt/sources.list.d/waydroid.list deb [signed-by=/usr/share/keyrings/waydroid.gpg] https://repo.waydro.id/ bookworm main
Software all up to date, today I had some upgrades for
appstream apt-config-icons flatpak gir1.2-flatpak-1.0 libappstream4 libflatpak0 but nothing new for Waydroid or kernels. I last installed Mobian from the 2021-05-16 installer image and don't think I've installed a bunch of weird things since then (development libraries etc., most my apps were from Flathub or apt installs).
Thanks for the quick reply. Everything you listed above is identical to my phone. The only difference is that I had some packages held back for some reason. I manually upgraded them with
apt but that didn't change anything.
I would assume this is the same on your phone:
mobian@mobian:~$ md5sum /var/lib/waydroid/images/* 86ad0eafb86a528ee2f6f6c3ff6036b7 /var/lib/waydroid/images/system.img 3caf5a31f3574c7f9ecb490007f55df7 /var/lib/waydroid/images/vendor.img
I also used a Mobian image from that same date. The only thing I can think of at this point that might differ is that I used the full disk encryption image (mobian-installer-pinephone-phosh-20210516.img.gz).
Here's how I try to start Waydroid:
sshinto the phone and run
$ sudo systemctl status waydroid-container.serviceto confirm that the container service is running.
waydroid session startin a terminal session- this is when I see the errors from
$ sudo waydroid --details-to-stdout log