The Windows Subsystem for Linux goes open source
Microsoft has officially open-sourced the Windows Subsystem for Linux (WSL), closing the very first issue ever filed on the Microsoft/WSL GitHub repository: “Will this be open source?”
WSL allows developers to run unmodified Linux command-line tools, utilities, and applications directly on Windows, without the overhead of a traditional virtual machine or dual-boot setup.
WSL architecture overview (Source: Microsoft)
The first version of WSL was introduced in 2016 and implemented as a compatibility layer within the Windows kernel. To improve system call compatibility and performance, WSL 2 was released in 2019, leveraging a real Linux kernel running in a lightweight virtual machine.
As the WSL ecosystem evolved, with support added for GPU acceleration, Linux GUI apps via wslg, and systemd, it became clear that WSL needed to be decoupled from the Windows OS. In 2021, WSL was split into an independent codebase and first shipped to the Microsoft Store as version 0.47.1.
Development continued on this standalone package, culminating in the first stable release in 2022. Windows 11 24H2 was the first Windows build that transitioned users from the built-in WSL to the new WSL package. Microsoft retained wsl.exe in the Windows image to facilitate on-demand downloads of the latest package, easing the transition.
WSL 2.0.0 introduced major improvements such as mirrored networking, DNS tunneling, session 0 support, proxy support, and firewall integration.
“We’ve seen how much the community has contributed to WSL without access to the source code, and we can’t wait to see how WSL will evolve now that the community can make direct code contributions to the project,” said Pierre Boulay from Microsoft.
The following components are still part of the Windows image and are not open sourced at this time:
- Lxcore.sys, the kernel side driver that powers WSL 1
- P9rdr.sys and p9np.dll, which runs the “\\wsl.localhost” filesystem redirection (from Windows to Linux)
Developers can now access the WSL source code on GitHub, build it from source, contribute fixes and features, and participate in its ongoing development.