The hell is a “drawbrige”?

You have to be crazy to use the new linux subsystem in Windows 10 for anything serious. But it’s so much fun. Like Microsoft (more specifically Microsoft Research, who came up with this) say: “Here have this thing. Go break it”. So I tried. Turns out though, that the linux subsystem is pretty stable by now, after three whole new Windows 10 builds worth of upgrades. For one, it doesn’t constantly run in root mode anymore and you now have pretty much what you’d expect when SSHing into any ubuntu system.

I didn’t touch my dual-booted elementaryOS (i.e. Ubuntu without the eye cancer) ever again since I first initialized a fresh ubuntu system in Drawbridge. Drawbridge is the experimental, bodged, system layer that glues specifically formatted OS containers to the actual Windows kernel (so, not quite ring0). And I’ve used it for everything that I’d do on linux without any major problems.

Wait what?!

OK, straight to the point:

Windows Subsystem for Linux (WSL) is the official term for the whole thing. I.e. a ubuntu system hosted by a LXSS manager service that translates linux syscalls using the Drawbridge protocol:

And indeed, if you sudo htop while in WSL, you’ll only get /bin/bash. The reason WSL is neither a VM nor an actual addition to the kernel is speed. WSL has to run fast. It also can’t deal with all that binary call translation. So to achieve the speed it delivers, every system process is actually running in “linux usermode”, but de facto it is executed in the Windows usermode ring as a picoprocess. Yes, you actually see WSL processes in your taksmanager.

LXSS hosting, syscall translation and general sandboxing is managed by Drawbridge. You can read all about how DB works and who’s behind it here. In short, this is how an isolated picoprocess is running:

It’s a pretty secure and blazingly fast way to host subsystems. Maybe, in future version, we can multiple subsystem hosts…

Wait, that sounds familiar!

Enter Docker

Installing something so complex as Docker is a sure way to break WSL completely (right now there’s no easy way to purge your Drawbridge system). Even though fairly complex things like Mono run, Docker is far more integrated into everything kernel.

The issues begin with missing packages, related to the kernel:

sudo apt-get install linux-image-virtual linux-image-extra-virtual

And all hell breaks loose. This tries to overwrite grub, among other things. That attempt is of course futile, since nothing is actually mounted in WSL. Well, that’s not exactly true, the Windows hard drive is somewhere in /mnt/ but that’s not relevant for grub.

So error after error is thrown. Let’s continue anyway, by installing:

sudo apt-get install docker.io

Great. Now you can run docker. Of course, nothing works, since WSL runs linux 3.4 and docker needs 3.8. So that’s it for now for docker. But maybe that’s a feature of a future Version of Drawbridge and we won’t even need docker.

More posts on WSL will come.