An introduction to WSL 2

The Windows Subsystem for Linux gets a major overhaul; now adding a full Linux kernel

At its recent Build conference Microsoft introduced the second version of its Windows Subsystem for Linux. It’s a major reworking of the original WSL concept, moving away from translating Linux system calls to Windows to shipping a complete Linux kernel that runs alongside Windows’ own kernel.

The reasons for doing this are many, but the main one is simple: It’s impossible for an emulator that ships twice a year to keep up with the changes in the Linux kernel, changes that Linux binaries depend on. If Windows is to support developers building Linux apps for the cloud, then it needs to be more than consistent, it needs to be compatible.

Introducing WSL 2

Two major developments have shaped WSL 2. The first is Microsoft’s focus on using its Hyper-V virtualization tool as an isolation layer in Windows, turning it into a general-purpose hypervisor service. The second is the closely related collaboration with Docker, Linux Containers on Windows, known as LCOW.

LCOW is where it all starts, using Hyper-V to host a thin Linux kernel to run Docker containers with Linux apps on Windows servers. A lot of work went into making LCOW a seamless environment that could be accessed by Windows development tools (especially Visual Studio Code’s new remote development feature), running containers in a way that lets them still perform as if they were native Windows code.

To continue reading this article register now