by jchw | 2025-05-19 21:00:50+00:00
> The integration between Windows and the WSL VM is far deeper than a typical VM hypervisor.

Sure, but I never claimed otherwise.

> You cannot claim with a straight face that Virtualbox is easier to use.

I also didn't claim that. I wasn't comparing WSL to other virtualization solutions.

WSL2 is cool. Linux doesn't have a tool like WSL2 that manages Linux virtual machines.

The catch 22 is that it doesn't need one. If you want to drop a shell in a virtual environment Linux can do that six ways through Sunday with no hardware VM in sight using the myriad of namespacing technologies available.

So while you don't have WSL2 on Linux, you don't need it. If you just want a ubuntu2204 shell or something, and you want it to magically work, you don't need a huge thing with tons of integration like WSL2. A standalone program can provide all of the functionality.

I have a feeling people might actually be legitimately skeptical. Let me prove this out. I am on NixOS, on a machine that does not have distrobox. It's not even installed, and I don't really have to install it since it's just a simple standalone program. I will do:

$ nix run nixpkgs#distrobox enter

Here's what happened:

$ nix run nixpkgs#distrobox enter Error: no such container my-distrobox Create it now, out of image registry.fedoraproject.org/fedora-toolbox:latest? [Y/n]: Y Creating the container my-distrobox Trying to pull registry.fedoraproject.org/fedora-toolbox:latest... ... 0f3de909e96d48bd294d138b1a525a6a22621f38cb775a991974313eda1a4119 Creating 'my-distrobox' using image registry.fedoraproject.org/fedora-toolbox:latest [ OK ] Distrobox 'my-distrobox' successfully created. To enter, run: distrobox enter my-distrobox Starting container... [ OK ] Installing basic packages... [ OK ] Setting up devpts mounts... [ OK ] Setting up read-only mounts... [ OK ] Setting up read-write mounts... [ OK ] Setting up host's sockets integration... [ OK ] Integrating host's themes, icons, fonts... [ OK ] Setting up distrobox profile... [ OK ] Setting up sudo... [ OK ] Setting up user groups... [ OK ] Setting up user's group list... [ OK ] Setting up existing user... [ OK ] Ensuring user's access... [ OK ] Container Setup Complete! [john@my-distrobox]~% sudo yum install glxgears ... Complete! [john@my-distrobox]~% glxgears Running synchronized to the vertical refresh. The framerate should be approximately the same as the monitor refresh rate. 302 frames in 5.0 seconds = 60.261 FPS ^C

No steps omitted. I can install software, including desktop software, including things that need hardware acceleration (yep, even on NixOS where everything is weird) and just run them. There's nothing to configure at all.

That's just Fedora. WSL can run a lot of distros, including Ubuntu. Of course, you can do the same thing with Distrobox. Is it hard? Let's find out by using Ubuntu 22.04 instead, with console output omitted:

$ distrobox create --image ubuntu:22.04 ... $ distrobox enter ubuntu-22-04 ... $ sudo apt install openarena ... $ /usr/games/openarena

To be completely, 100% fair: running an old version of Ubuntu like this does actually have one downside: it triggers OpenGL software rendering for me, because the OpenGL drivers in Ubuntu 22.04 are too old to support my relatively new RX 9070 XT. You'd need to install or copy in newer drivers to make it work. There are in fact ways to do that (Ubuntu has no shortage of repos just for getting more up-to-date drivers and they work inside Distrobox pretty much the same way they work in real hardware.) Amusingly, this problem doesn't impact NVIDIA since you can just tell distrobox to copy in the NVIDIA driver verbatim with the --nvidia flag. (One of the few major points in favor of proprietary drivers, I suppose.)

On the other hand, even trying pretty hard (and using special drivers) I could never get hardware acceleration for OpenGL working inside of WSL2, so it could be worse.

That aside, everything works. More complex applications (e.g. file browsers, Krita, Blender) work just fine and you get your normal home folder mapped in just like you'd expect.