Waydroid – Run Android containers on Ubuntu
waydro.id
waydro.id
* The good
- It is very responsive and smooth
- Install just following instructions described
- F-droid works
- Apps installed from F-droid works
- Full screen videos from Newpipe play smoothly
* The bad - Had to enable "invert colors" to get correct colors
- Mouse scroll is inverted
- Can't choose correct layout of physical keyboard because android thinks there's no physical keyboard connected
- Android gestures on the desktop are annoying
- Can't access whole screen of vertical apps and they appear sideways on my screen
- Multiwindow mode didn't work at first
* The ugly: - Nothing is actually ugly. Everything mostly works as expected - Sent from my waydroid- requires Wayland - does not seem to work with X11
This makes it a no-go for many a potential user.
It's still early days for Waydroid, but it's also decidedly a step forwards.
Here is on a OnePlus 6T running postmarketOS, for comparison: https://www.youtube.com/watch?v=I9qaD5YIPkc
So certainly lighter sounds good, and hopefully the future's bright - could be very useful in bridging the gap driving more Linux phone adoption. Some things just can't and won't be available (without way more adoption), like bank apps say, so being able to run the Android version smoothly would be a huge win.
I had a PinePhone. The performance of Anbox on it was slow, and apps were rendered at a low resolution and scaled up using bilinear scaling. And I had to configure zram/zswap (which was a good idea regardless of using Anbox or not), because otherwise the 1 gigabyte of RAM wasn't enough to fit Linux and Anbox, and Anbox would terminate from merely poking around in the settings app and trying to login to MicroG or something.
I hope that the scaling (and performance?) is fixed in Anbox, and that Waydroid performs faster than Anbox and uses less RAM. But I no longer have a functioning PinePhone to test further on.
I watched https://www.youtube.com/watch?v=bG0uAQqeqW4. Scrolling through the recent apps list has both a high latency and low frame rate (and PinePhone-native UIs like GTK Phosh and Plasma Mobile are not really better). And the gameplay had 150 or more milliseconds of latency between touch input and the screen responding, which is awful.
> It's more powerful than my first laptop
This speaks to how unoptimized and GPU-dependent today's software is (Xfce on a dual-core ULV Intel-based laptop from 2016 is more responsive than KDE Plasma on that laptop or a Zen 3 desktop PC, admittedly with a crappy GPU), and perhaps how today's screens are higher-resolution than old laptops.
> I think the comparison there is phones-now to laptops-back-then
The comparison is with "laptops from just a few years ago". My old laptop runs circles around my PinePhone, though I won't say it's better than good phones of today.
https://pineguild.com/pinephone-keyboard-first-impression-is...
Also, you can connect via ssh and use your computer's keyboard to manage the phone. Or buy a Bluetooth keyboard.
Do you know if the fxtec will offer the same? For a tinkerable Linux phone where you genuinely go distro-hopping, that's truly a game-changer.
With the PinePhone I can boot from external media (like SD-cards), and that's quite a big deal.
Yeah, it's not ACPI and UEFI and generic images running HW-discovery and magically "just working", but it's still way better than the options you have pretty most everywhere else in phone-space.
But that’s no reason for it not to work, it will just work more slowly ;)
Recently, my bank discontinued their website based deposit system for checks in favor of their app. I'm reluctant to keep an app with full access to my account on my phone, so a container system like Waydroid or Anbox would be great if I could just emulate the app when I need it. Has anyone else run into this issue and, if so, how have you dealt with it?
Due to vague security requirements most banking apps refuse to run if the phone has been rooted.
While definitely a heavyweight approach (yay, installing all of Android Studio - but you also install an update tool), I can confirm it works. (And you can fish out and save the qemu invocation from `ps axfww`, then launch it directly without needing to start anything else, although I think the idiomatic approach is using the `emulator` command.)
Why Telegram specifically, when it already offers both a web client and a FOSS Linux client?
edit: or if it's anything like signal, the mobile app has some extra functionality that is omitted from the desktop/web client...
[1] https://github.com/waydroid/waydroid/blob/bullseye/tools/hel...
"Waydroid uses Linux namespaces (user, pid, uts, net, mount, ipc) to run a full…" [see main page]
when in fact they simply use LXD, which uses all these features. Besides, it is a project dependency, which is not mentioned anywhere.
Edit: clarity.
A container-based approach to boot a full Android system on a regular GNU/Linux system like Ubuntu.
This could be simplified to:
WayDroid: Containerized Android for GNU/Linux
But as it is now, the title has been changed to be confusing.
I had bought firestick in past that is now stuck on boot loop for over a year. I have decided not buy these sticks or smart TV where I have little to no control over Software.
- Is it better/faster/more compatible than anbox?
- Runs on ARM?
- Does it allows me to watch DRM streaming services on my linux box?
- Can I install google play on it?
Should be able to still run them if you use binfmt_misc. Of course it will be slower but it's possible.
https://en.wikipedia.org/wiki/Binfmt_misc
> binfmt_misc can also be combined with QEMU to execute programs for other processor architectures as if they were native binaries.[9]
QEMU supported [ARM guest] machines: https://wiki.qemu.org/Documentation/Platforms/ARM#Supported_...
Edit: from "Running and Building ARM Docker Containers on x86" (which also describes how to get CUDA working) https://www.stereolabs.com/docs/docker/building-arm-containe... :
sudo apt-get install qemu binfmt-support qemu-user-static # Install the qemu packages
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes # Execute the registering scripts
docker run --rm -t arm64v8/ubuntu uname -m # Test the emulation environment
https://github.com/multiarch/qemu-user-static :> multiarch/qemu-user-static is to enable an execution of different multi-architecture containers by QEMU [1] and binfmt_misc [2]. Here are examples with Docker [3].
It's not a certified device, so.
There are a number of ways to build "multi-arch docker images" e.g. for both x86 and ARM: OCI, docker build, podman build, buildx, buildah.
Containers are testable.
Here's this re: whether the official OpenWRT container should run /sbin/init in order to run procd, ubusd,: https://github.com/docker-library/official-images/pull/7975#...
AFAIU, from a termux issue thread re: repackaging everything individually, latest Android requires binaries to be installed from APKs to get the SELinux context label necessary to run?
I think Intel has (or had?) a tool/library for translating ARM to x86 called Houdini. Can't seem to find it though, and it might require a license anyways.
What would have helped a lot more here is the default emulator in Android Studio is currently, and has been for a while now, x86. Since of course x86 to x86 virtualization is a lot faster than ARM to x86 virtualization.
ARM64 didn't do much to help with architecture-neutrality just like X86_64 didn't.
From the Anbox website:
> "We're reusing what Android implemented within the QEMU-based emulator for OpenGL ES accelerated rendering."
I'm not certain but I believe WayDroid more directly attempts to provide Android drawing subsystems on top of Wayland. This should be better/faster. Cross fingers.
Compatibility wise, I'm unsure. Anbox may be a more faithful Android platform perhaps. Waydroid feels like it's a closer integration to me, with less virtualized-machinery, which is a much wider support target since it's running directly atop a wide variety of hosts. But I for one am very glad we have a closer integrated option, one where Android apps are running more within the Linux desktop context.
There's probably a bunch wrong with my understandings here. Hoping some even better informed people can correct/supplement.
It's a container so the arch matches the host kernel.
In general on LineageOS it's possible to install gapps.
You won't be able to watch DRM streaming services that require Widevine higher than L3 support.
Netflix and prime and Pluto do, at least. That's all I use, so I am curious. I don't stream anything else, no Roku or Android-tv or whatever.
Admittedly, it's a bit cumbersome to do this, but it works very well. I've been watching Netflix on my Raspberry Pi 4 for over a year using it.
Also, according to this guy [0] you now seem to be able to just install libwidevine in Raspberry OS. I haven't tested this yet though.
[0]: https://lemariva.com/blog/2021/04/raspberry-pi-amazon-prime-...
It doesn't include a HSM, so if it does allow you to watch DRM content, it'll only be Widevine level 3 content, which most services restrict to 420p or sometimes 720p streaming.
I don't know how to word the install for wayland session manager.
And copy pasting the.... "export DISTRO="bullseye" && \ curl https://repo.waydro.id/waydroid.gpg > /usr/share/keyrings/waydroid.gpg && \ echo "deb [signed-by=/usr/share/keyrings/waydroid.gpg] https://repo.waydro.id/ $DISTRO main" > /etc/apt/sources.list.d/waydroid.list && \ sudo apt update"
...told me permission denied to modify some files, even if I did it as "sudo".
I think once I get past that point I'll be able to type in the rest of the commands to start running it.
I think it would be lots of fun to run Android apps on a FOSS Android module. I was running LineageOS in VMWare within Windows, and it was ok.
Thanks!
export DISTRO="bullseye"
with export DISTRO="focal" Get:4 https://repo.waydro.id focal InRelease [1,343 B]
Err:4 https://repo.waydro.id focal InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 959FE34E90E51522
Reading package lists... Done
W: GPG error: https://repo.waydro.id focal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 959FE34E90E51522
E: The repository 'https://repo.waydro.id focal InRelease' is not signed.
Is that an issue with the waydroid repository, or with my setup?"bash: /etc/apt/sources.list.d/waydroid.list: Permission denied"
I think it will become: "export DISTRO="bullseye" && sudo curl https://repo.waydro.id/waydroid.gpg > /usr/share/keyrings/waydroid.gpg && sudo echo "deb [signed-by=/usr/share/keyrings/waydroid.gpg] https://repo.waydro.id/ $DISTRO main" > /etc/apt/sources.list.d/waydroid.list && sudo apt update"
I don't understand why developers don't just use the output flag of curl instead of using file redirections like this. sudo curl -o [...] would've prevented all of that, instead of relying on someone being logged in as root (which is a terrible security practice I thought we as Linux users have been over already). I have to replace I/O redirections with sudo tee way too often, and it's impossible for any Linux beginner to understand what's going on here.
sudo curl https://repo.waydro.id/waydroig.gpg > /usr/share/keyrings/waydroid.gpg && echo "deb [signed-by=/usr/share/keyrings/waydroid.gpg] https://repo.waydro.id/ $DISTRO main" > /etc/apt/sources.list.d/waydroid.list && \ > echo "deb [signed-by=/usr/share/keyrings/waydroid.gpg] https://repo.waydro.id/ $DISTRO main" > /etc/apt/sources.list.d/waydroid.list && \ > sudo apt update bash: /usr/share/keyrings/waydroid.gpg: Permission denied
Maybe I'll leave the project for now until I get a better grasp of the terminal.
export DISTRO="focal"
sudo curl https://repo.waydro.id/waydroid.gpg > /usr/share/keyrings/waydroid.gpg
sudo echo "deb [signed-by=/usr/share/keyrings/waydroid.gpg] https://repo.waydro.id/ $DISTRO main" > /etc/apt/sources.list.d/waydroid.list
sudo apt update
DISTRO="focal"
sudo curl https://repo.waydro.id/waydroid.gpg -o /usr/share/keyrings/waydroid.gpg
echo "deb [signed-by=/usr/share/keyrings/waydroid.gpg] https://repo.waydro.id/ $DISTRO main" | sudo tee /etc/apt/sources.list.d/waydroid.list
sudo apt update
sudo apt install waydroidHowever, it gave me this error:
The following packages have unmet dependencies: python3-gbinder : Depends: python3 (< 3.9) but 3.9.4-1 is to be installed
How do I downgrade python?
But the front page doesn't make this too clear, can anyone confirm?
EDIT: Actually I tried it and this doesn't want to work in an instance of weston running on top of X; not sure where the failure is.
Obviously its no one's job to fix Wayland for me or anything like that, but I've literally never gotten Wayland to work on anything beyond a live distro. Now, of course, I haven't tried very hard because I have no use for it. But yeah.
What I believe doesn't matter of course, and I get that it's probably happening whether I like it or not; but this is the worst rollout of anything I've ever seen in the Linux world, and to me just violates the heck out of at least one of "the whole points" of using Linux.
Don't break backward compatibility! (and for me, e.g don't break my x2go)
Use containers to segregate any apps, e.g. web browser, maps, Signal/Telegram all in a separate container from each other.
Would this allow for less privacy-invasion from Google etc.?
It's better to use something like i.MX 8M Quad - you may want to take a look at the Librem 5; or if you want something lower-end than that then there's also the PinePhone which is based on A64.
With that said, I worry an rk3399 would run hot in a phone. Hopefully the thermals on the rk3588 are better. But rockchip is dedicating die space to a poorly supported "neural processing unit" now, so we will have to see.
Which ones? Librem 5 runs an FSF-endorsed OS and is recommended by the FSF: https://www.fsf.org/givingguide/v11/.
Purism solved the problem with the RAM here: https://puri.sm/posts/librem5-solving-the-first-fsf-ryf-hurd....
Purism has been tight-lipped about getting ryf certification. These maneuvers around memory and hdmi look more like cheating to me. According to the links I posted, i.MX8 cannot be deblobbed. I stand by what I say: I don't think the librem-5 will ever get ryf-certified.
Just below the picture of the phone, first sentence: While we're still waiting to get our hands on one, this device looks promising: https://www.fsf.org/givingguide/v11.
> These maneuvers around memory and hdmi look more like cheating to me.
Why does it matter to you that a secondary CPU which has no access to anything runs proprietary blobs to train the RAM? Do you also care about proprietary firmware of SSDs (and avoid them)?
> Just below the picture of the phone, first sentence: While we're still waiting to get our hands on one, this device looks promising: https://www.fsf.org/givingguide/v11.
I'd still argue that it is a bit different from "FSF did not certify the phone, because they did not receive the units yet".
> > These maneuvers around memory and hdmi look more like cheating to me.
> Why does it matter to you that a secondary CPU which has no access to anything runs proprietary blobs to train the RAM? Do you also care about proprietary firmware of SSDs (and avoid them)?
To makes things clear: I'm not opposed to the "secondary processor exception". In this case specifically, the firmware was artificially stored on a ROM chip, and copied from there to "a secondary processor" by the main processor to unlock a feature (train the RAM) to allow the main processor to work properly. This is a bit too much for me. Also, I'm not sure the HDMI initialization runs on a secondary processor.
Also, librem-5 getting ryf-certified would make me very very happy. I really would love to see this happen.
A better approach would be to require public documentation of which components are proprietary (for all processor ISAs, processors, other hardware, all firmware and all software) and what roles they play.
Documentation would be great of course anyway.
Android itself containerizes/isolates apps, with better & better security features in modern versions. LineageOS also adds their own layer of security (ex-PrivacyGuard) on top.
Granted, not all phones are created equal, meaning some of them will have restrictive bootloaders/need more proprietary drivers. It's possible some of them have spyware built in their bootloader/recovery/hardware, although I haven't heard of it. And of course there's 0 fully open-source android hardware phones.
Which, speaking of... this would be excellent on pinephone, which runs linux. Would allow running android apps on it, which is very very useful of course. I might finally bite the bullet and buy it...
They are not on par in terms of performance.
How good is the 3d support, ie: Does it support a modern version of OpenGL ES? Can it process that via host hardware support (a la angle or similar)? Can it do that headlessly without an window server running on the host? Can the video output of the app be easily captured by nvenc or intel/amd equivalent?
Is arm translation supported natively or does it require plugins for the abi translation?
Are google's libraries (play services, play store, webview) or alternatives easy to install/supported?
Can the app data and system volume be mounted externally?
Can the system details (cpuid/flags, device name/mfg/model, android OS specifics) be provided/spoofed?
Can sensor inputs (gps location, tilt, multi-touch gestures, battery level, network status, camera/s) be easily simulated or passed from host sensor to the guest app? Can bluetooth be passed through from the host?
Would love for somebody to crush this space and not pivot immediately into commercial offering.
- Arm translation is on the radar, and we have solutions in the works. Just nothing ready for the masses yet.
- No Google Play Services as of yet. Some of our builds do use MicroG, Aurora Store, and other FOSS apps & open-source GMS options.
- It uses LXC, so yes, you can mount whatever is needed, we just don't have an exemplary (easy) way to do it yet.
- We are using hardware passthroughs via binder, so eventually Waydroid (Android side) will be able to access the system details available to it. Same with sensor inputs.
- We would all love to get paid, doing what we enjoy. But for this project, we are not even collecting donations yet. Money isn't what is driving this project. That's not saying that collecting donations and sponsorships aren't on our radar, just that it's not a primary focus. Open-Innovation is.
That is like going to a used car lot, looking at a car with a tag price of 1000 dollars and asking is it electric, does it have doors that open like wings, does it have level 2 autonomous etc. Sure, you will take no for an answer, but why you be even asking that?
Asking about the existence of such things is not a suggestion that they must be provided at that price. It's simply the baseline criteria for some people to want to use it.
Considering the availability of the demanded product at the respective price points, I think that my analogy is much more accurate than yours.
>Asking about the existence of such things is not a suggestion that they must be provided at that price.
Sure, it is up to you to choose what product you want. But you should still have some awareness about the price of that product in the market. If someone offers a car for 5$ on ebay, I am going to assume it is a toy, not the real thing.
The whole point of the OP's questions is that they didn't want to assume anything! I don't see the harm in asking these types of questions, even if the most likely answer to each of them is "no".
There is no harm in asking whether the 1000$ car at the used car dealership comes with cars that open like wings either, but it would sound strange.
I believe Waydroid was originally "anbox-halium"—a rewrite with LXC to get closer to the metal.
Android ships with it's own init system that does a lot more than just starting/stopping services. And integrating those services manually into regular Linux desktop's init system would have been painful to say the least.
That's the reason Anbox runs the whole Android subsystem in it's own LXC container - to avoid having to patch the Android init system and various system libraries to load Android libraries from non AOSP paths. (Like /system/ , /vendor etc..)
From what i remember, The original Anbox used patched version of Android frameworks, that sent the application render data to the Anbox session manager running outside the container [1] , which then created the application windows and rendered it there. This was okay on desktop systems, but on mobile phones (Sailfish OS, Ubports devices) that were trying to use Anbox to provide app compatibility, this had a significant amount of overhead, that made it unusable.
Back then there was the sfdroid project, that tried to patch the Android frameworks running inside Anbox Container to directly create Wayland windows and render the applications directly (kind of like how Chrome OS used to do), instead of having the Anbox session manager do it [2,3], bringing back most of the lost performance.
From the looks of it, Waydroid seems to be doing something similar [4]
1. https://github.com/anbox/anbox/blob/master/docs/architecture... 2. https://github.com/sfdroid/anbox/ 3. https://www.youtube.com/watch?v=78N1C2-6t3I 4. https://github.com/waydroid/android_hardware_waydroid/blob/l...
You don't need ANGLE for that, Mesa supports OpenGL ES natively.
Pretty much any of the closed source emulators that can feasibly run games (i.e., be horribly abused en masse for botting games) are festering piles of crap.
Another super common thing in those low tier trash apps is using your computer as a proxy ala Hola. Pay-per-install for using you to run stolen card traffic.
I play a few games my kids got me addicted to, Williams Pinball, and miscellaneous niche games. They run fine. But I haven't tried some of the popular MMOs or games where farming is basically the point.
I played one of these once (some Final Fantasy thing) and the amount of manipulative social engineering, dopamine triggering sidegames, and manipulation by devs or employed super-players to "mix things up" to try to provoke people to fork over money was appalling.
Thankfully I used almost no money, I paid up for one or two things to see if they would be worth it (they weren't) before I could fully recognize the money extraction treadmill they were trying to get you one.
The games are a fascinating example of hyperinflation too.
Can you elaborate on what's fascinating?
The game devs have complete control over the value of things be it buildings, soldiers, items, etc. The ability to constantly release new tiers/soldiers/etc that instantly devalue previous invested time and work all in service to wring more real-world money from addicts...
Of course once too many new shiny things are released, suddenly the climb/intro for new players is too high.
So suddenly, new players are given far more of the original "currency" of gold and resource to skip past the beginning steps so they can come within shouting distance to where investing money would keep them alive.
Well, it's kind of like a perverse fiat currency and a central government with the power to impose regulations and print currency at will.
The fact that the "central government" started printing money / resources once several more tiers of buildings/soldiers/defenses were introduced devalued all that previous investment and work to startling degrees.
To me it was reminiscent of fiat currency and hyperinflation due to printing money.
> The apk files you will sometimes find on the internet tend to only have arm support, and will therefore not work on x86_64.
Suggesting that they don't provide cross-abi compatability. If/when they move to Android 11 as the underlying image - it has both x86 and arm translations built into the packaged abi. I suspect that it will be on the user to install any abi translation packages (libhoudini for example) in order to get arm apk's to run on x86 host without qemu.
I can't find anything about that use case in the description here, but if anyone has tried it I'd love to hear if Waydroid would be a fit for my use case.
Looks like a nice effort though. Is this some problem specific to 21.04 kernel config?
mount -t binder binder /dev/binderfs
https://brauner.github.io/2019/01/09/android-binderfs.html sudo modprobe binder_linux
sudo modprobe ashmem_linux
Where $version is the kernel version, for -generic kernels they are in the package "linux-modules-extra-${version}-generic" and for -lowlatency "linux-modules-${version}-lowlatency". On -generic the modules-extra may sometimes not be installed by default.Does it support arm64 emulation on an x86_64 host? That way I could just run the backed up apks directly.
You may need qemu.
Both are required to run Anbox and Waydroid so you have to switch to another kernel or build one yourself.
(As to what it’s now known as, I’m not actually certain: in most places it’s spelled Waydroid, but there are a number of places where it’s spelled WayDroid instead. Waaaaah! I can’t cope!)