Install Anbox on Windows 11 (Ubuntu WSL)

Solution 1:

My technical background is extremely limited

No worries, and that's actually useful information here. It helps me at least try to provide an answer that's matched to your experience level. That said, the reasons behind this are fairly technical, but you've done a great job of trying to work through some of them so far.

As I think you figured out, both of the first two errors you saw were because WSL does not support Systemd (and thus not Snaps). This is perhaps one of the biggest challenges people run into when attempting to use it as a one-for-one replacement for a "real" Linux system.

Systemd is the "standard" initialization system for most Linux distributions, but WSL uses its own /init as the startup, and for good reasons that I won't go into here.

But that does mean that some software that expects Systemd just won't work on WSL without additional effort. Snaps are a way of installing software into Linux that utilizes Systemd.

As the Anbox installation guide mentions:

To install Anbox your system need to support snaps. We do not officially support any other distribution method of Anbox at the moment but there are community made packages for various distributions (e.g. Arch Linux), but ...

There are workarounds for Systemd/Snap support on WSL, and Genie, which was your second attempt, is one of those. That said, I think you are using some outdated instructions for installing Genie. Check out the Genie github for the latest on that.

Based on the comments to my original answer here:

@moyadin *This link I posted up windowscentral.com is for replacing Amazon's Store with Google's Store. I succeeded in this regard.

Wow -- I'm pretty impressed, since that's pretty dang technical ;-). I originally thought you were referring to just using that guide to install WSL2. I've skimmed through it now to get an understanding of what you've done.

If you have that running, then you are using an early (but modified) version of WSA (Windows Subsystem for Android), which as far as I can tell should be isolated, since it runs in a virtual machine like WSL2. I'm probably not going to follow that particular guide myself, since it involves some fairly "beta" technology that isn't designed to be run on the "normal" version of Windows 11 just yet. BUT, I'm very conservative when it comes to my system.

I might, on the other hand, try it out in a Windows 11 VM I have.

I spent some time yesterday attempting to install Anbox on WSL2, and I wasn't successful. At the very least, you have to have:

  • Systemd running to a better degree than I did

  • As far as I can tell, you need to build your own kernel with support for the Anbox binder and ashmem kernel modules. I was, as far as I can tell, successful with this, but it did take two attempts to get it right.

  • Set WSL2 to use your custom kernel (again, I did this successful and verified that the Anbox modules loaded properly).

  • Install Anbox -- While I was able to install the Snap on WSL2, I was unsuccessful at actually running it, and I'm 95% sure that it's still due to Systemd issues.

    If I spent more time on it, I might be successful, but then I'd still have to do the next step in order to get to the Play Store ...

  • Run a very complicated script. It's ironically funny that I found this in the article Anbox: How To Install Google Play Store And Enable ARM (libhoudini) Support, The Easy Way. And after saying it's the easy way, they tell you (rightly):

    Warning: never run a script you didn't write without knowing what it does. Before running this script, check out its code. Unfortunately, understanding what that script is doing requires a high degree of Linux knowledge.

But if it requires that much extensive work for Anbox then I will just disregard the whole thing.

I'm going to say that's the right choice. My recommendation would be (a) stick with what you have running (b) it probably is as good or better than (and just as secure as) the Anbox solution.

My end goal is to download Android apps in an isolated environment where the apps can't access everything (Like those downloaded from Microsoft Store for example) and Android x86 on VMware is the option I am currently using.

Well, if you do have the WSA option working that Windows Central documented, then that's most likely just as safe. I'm sure that Microsoft will release more architecture information on WSA as they get closer to launch, but they have said it runs in a VM. I'm guessing it is very similar to WSL2 in its architecture.

What we really are waiting for is WSA to be released by Microsoft. Then, hopefully, we'll have some better options (although still unsupported) for using the Google Play Store.