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 12 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[1]: Started Waydroid Container.
Oct 09 21:46:04 mobian waydroid[2883]: [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?
Thanks, Dave
Hey Dave,
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 upgrade
s 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 upgrade
didn't do anythingpython3-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
Hey Dave,
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:
ssh
into the phone and run $ sudo systemctl status waydroid-container.service
to confirm that the container service is running.waydroid session start
in a terminal session- this is when I see the errors from $ sudo waydroid --details-to-stdout log
I finally gave up on Mobian and installed Manjaro. Waydroid was easy to install and worked fine on the first try. I'm asking this question about Signal here because I know you've used Signal via Waydroid and I want to be extra cautious before I mess anything up. I've got Signal installed in Waydroid and it runs but I haven't set it up yet. I'd like to be able to move back and forth between phones by simply transferring the SIM card while I'm still experimenting with the PinePhone. I'm not too worried if my Signal chats get out of sync between the phones.
Do you think this process would work?
My hope is that I can simply move the SIM card back to Android anytime and start using Signal on that phone again. I assume that if I don't bother to backup Signal and transfer the file back to Android then I'll just lose any record of those messages on the Android phone.
Hey @Dave
I'm not familiar how backup and restore would work but if you can get that working it sounds like it may be good. If the backup is able to copy all your userdata from Signal thoroughly enough it might circumvent Signal's usual "one master device" system.
One of the top reasons I don't use Signal as my primary messenger is because of this "one master device" thing. If you were to simply install Signal on Waydroid and activate your number there, it would de-activate your other Android device; and when switching back to that other Android and activating it there, it would deactivate the Waydroid client. And this is annoying because Signal will re-roll your encryption keys each time and all of your contacts are notified that your key has changed and all your past chats are cut off (I'm not sure how it looks to your friends, if they keep the chat history with you contiguously or not -- but for you it's a clean reset and you lose all the chat history on your side).
So when I tested Signal in Waydroid I activated using my Google Voice number since I didn't wanna disrupt my Signal app on my Pixel. Give the backup and restore thing a try and let me know how it goes!
The good news is that transferring one Signal account between two phones using the same SIM card worked very easily. On the new Signal installation (PinePhone via Waydroid), I simply restored from a current backup file and then entered my phone number to get a verifcation text to activate Signal. That text didn't arrive for several hours but that was the only issue. Sending and receiving SMS messages via Signal on Waydroid seemed to work OK but I'm pretty sure I wasn't receiving messages when Waydroid wasn't running. Obviously I didn't get any Signal notifications if Waydroid wasn't running but I did get non-Signal texts via the built-in Linux text app. When Waydroid was open my battery didn't even last through one day so I didn't keep it running very often.
Transferring my active account back to the original phone was painless. I just clicked the link within Signal on my old phone to re-register that device and then received a verfication text within a few seconds. As expected, any text messages that arrived on the PinePhone do not show up on the original phone, but otherwise everything was as I left it a few days ago. One thing I didn't realize was that Signal works fine over WiFi in a phone without a SIM card.
The bad news is that my PinePhone experiment is over. My wife got tired of not being able to consistently contact me by phone or text, so I'm back to Android for now. It's been fun to play with but in my opinion it's a long ways from being ready for routine use.
Thanks for the update, Dave!
As of a couple days ago I'm attempting to "daily drive" the Pinephone again; I was waiting for a long time for Mobian to finally mainline the MMS support, but I got impatient and decided I would just compile things from source for now and see what I can get working. Where I landed on that, is: I can receive MMS picture and group chats well on the Chatty app, but I can't send out an MMS message yet; so replying to my group chat, nobody gets it, but that's okay enough for me -- as long as I know when I got an MMS, that's the important part anyway, and I could individually SMS people out-of-band if necessary to reply. After a week or so I'll post a blog about my experiences so far and with more details on MMS stuff. SMS, phone calls, 4G and hotspot sharing all work great for me on T-Mobile!
When Waydroid was open my battery didn't even last through one day so I didn't keep it running very often.
A balance I found with Waydroid is to stop it when I'm not using it. I had filed on their GitHub that Waydroid interferes with deep sleep, they gave me a command to try out, waydroid prop set persist.waydroid.suspend true
which only helped a little but my phone still kept waking up overnight when I didn't have it plugged in. I created a home screen launcher to stop Waydroid easily on demand:
[Desktop Entry]
Type=Application
Name=Waydroid Stop
Exec=waydroid session stop
Icon=/usr/lib/waydroid/data/AppIcon.png
Place it in your ~/.local/share/applications, it runs waydroid session stop
when activated. So when I'm done using Android apps I run that and save my battery life and sleep ability and it's easier than fully rebooting the phone which is what I used to do before!
One thing I didn't realize was that Signal works fine over WiFi in a phone without a SIM card.
Yep! And I don't even know whether Waydroid can handle SIM card/modem passthrough anyway.
One other fun thing I found: KDE Connect works really well to bridge the gap between Linux and Waydroid! Just install the app both places, they can see each other automatically and pair up, and I get Android notifications in my Phosh shell and I can push files from Linux into Android for easy sharing. I haven't tested whether SMS sharing works at all (it's plausible I can pair my Fedora laptop to my Pinephone also over KDE Connect, but I'm not sure whether it expects only Android devices can be SMS hosts or not - I guess I'll find out!)
The bad news is that my PinePhone experiment is over. My wife got tired of not being able to consistently contact me by phone or text, so I'm back to Android for now. It's been fun to play with but in my opinion it's a long ways from being ready for routine use.
For me I'm thinking that if the Pinephone doesn't pan out this time, I'm going to get a Pixel 6 and maybe put on GrapheneOS when they have it available.
And if it does pan out well (and especially when MMS support is fully realized), I'll be looking to get the Pinephone Pro for its boosted specs; should be more of the same, but faster!
Hello, thanks for the write-up. I'm curious whether you saw any significant or noticable dip in battery duration running Waydroid. Thanks!
Hey @jkepler
I'm curious whether you saw any significant or noticable dip in battery duration running Waydroid.
During the 2 minutes that it takes Waydroid to come up the first time I noticed my battery dips pretty fast. It was at 75% just now and by the time I got an Android app on screen it was down to 61% already!
During its initialization time it churns through CPU usage and has a lot of work to do. After it's warmed up it would probably be a bit nicer on battery, judging by how Android apps generally function smoothly without a lot of stuttering that could be indicative of heavy CPU consumption.
But Waydroid still has the problem where it prevents the Pinephone from suspending so I don't run Android apps very often, mainly just in the morning if I want to scroll Twitter for a while and have my power cable nearby to recharge the phone when I'm done.
It would be really neat to see a build of Tad / SkewedZeppelin / SubzeroCarnage's DivestOS for use on a PinePhone via Waydroid; built-in antivirus and f-droid, with a significant amount of effort having gone into making a secure and privacy-respecting FOSS version of AOSP / LineageOS.
0.0157s
.