Linux Windows Subsystem for Linux (WSL) is now open source



 Windows Developer Blog:

Today we’re very excited to announce the open-source release of the Windows Subsystem for Linux. This is the result of a multiyear effort to prepare for this, and a great closure to the first ever issue raised on the Microsoft/WSL repo: Will this be Open Source? · Issue #1 · microsoft/WSL.

That means that the code that powers WSL is now available on GitHub at Microsoft/WSL and open sourced to the community! You can download WSL and build it from source, add new fixes and features and participate in WSL’s active development.

WSL component overview​

WSL is made of a set of distribution components. Some run in Windows, and some run inside the WSL 2 virtual machine. Here’s an overview of WSL’s architecture:

Windows Subsystem for Linux architecture.

WSL’s code can be broken up into these main areas:
  • Command line executables that are the entry points to interact with WSL
    • wsl.exe, wslconfig.exe and wslg.exe
  • The WSL service that starts the WSL VM, starts distros, mounts file access shares and more
    • wslservice.exe
  • Linux init and daemon processes, binaries that run in Linux to provide WSL functionality
    • init for start up, gns for networking, localhost for port forwarding, etc.
  • File sharing Linux files to Windows with WSL’s plan9 server implementation
    • plan9
Head over to https://wsl.dev to learn more about each component.

This comes as an addition to the already open sourced WSL components:
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)

Why open source now? A bit of history…​

WSL was first announced at BUILD back in 2016 and first shipped with the Windows 10 Anniversary update.

At that time WSL was based on a pico process provider, lxcore.sys, which enabled Windows to natively run ELF executables, and implement Linux syscalls inside the Windows kernel. This eventually became what we today know as “WSL 1”, which WSL still supports.

Over time it became clear that the best way to provide optimal compatibility with native Linux was to rely on the Linux kernel itself. WSL 2 was born, and first announced in 2019.

As the community behind WSL grew, WSL gained more features such as GPU support, graphical applications support (via wslg) and support for systemd.

It eventually became clear that to keep up with the growing community and feature requests, WSL had to move faster, and ship separately from Windows. That’s why in 2021 we separated WSL from the Windows codebase, and moved it to its own codebase. This new WSL first shipped as version 0.47.1 to the Microsoft Store, in July 2021. At the time, only Windows 11 was supported, and the package was marked as preview, only recommended to users that wanted to experience the latest and greatest of WSL.

We continued to develop this new “WSL package” until it was ready for general availability. That happened November of 2022, with WSL 1.0.0, which added support for Windows 10 and was the first “stable” release of this new WSL.

From there we kept on improving WSL, with the objective of fully transitioning all users to this new WSL package, and away from the WSL component that shipped with Windows. Windows 11 24H2 was the first Windows build that moved users from the “built-in” WSL to the “new” WSL package. We kept wsl.exe in the Windows image, so it could download the latest package on demand to make the transition easier.

As we kept on improving WSL, we eventually hit another milestone: WSL 2.0.0 (What are the three hardest problems in computer science? Off by one errors and naming things!).

WSL 2.0.0 introduced major improvements such as mirrored networking, DNS tunneling, session 0 support, proxy support, firewall support and more.

And that’s the milestone we’re still building on today! At the time of writing this article, WSL 2.5.7 is the latest available version out of our nine pages of Github releases since 0.47.1 4 years ago !

The community behind WSL​

Over the years we’ve been incredibly lucky to have a strong community supporting WSL from day 1. We’ve been blessed with people sharing their knowledge, and spending countless hours to help track down bugs, find the best ways to implement new features and improve WSL.

WSL could never have been what it is today without its community. Even without access to WSL’s source code, people have been able to make major contributions that lead to what WSL is now.

This is why we’re incredibly excited to open-source WSL today. 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.

Contributing to WSL​

Are you interested in learning how WSL works? Would you like to see how a specific feature works, or make a change? Head over to microsoft/WSL to learn more!


 Source:

 
Great news!
 

My Computers

System One System Two

  • OS
    Windows 11
    Computer type
    Laptop
    Manufacturer/Model
    HP Pavilion Laptop 15-cw1xxx
    CPU
    AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx
    Memory
    8.00 GB
    Graphics Card(s)
    AMD Radeon(TM) Vega 8 Graphics
    Sound Card
    Realtek High Definition Audio
    Monitor(s) Displays
    Generic PnP Monitor
    Screen Resolution
    1920x1080
    Hard Drives
    LITEON CV8-8E128-HP (SSD)
    WDC WD10SPZX-60Z10T0 (Hard Drive)
    PSU
    Microsoft ACPI-Compliant Control Method Battery
    Case
    Proprietary HP Pavilion Laptop 15 shell
    Cooling
    Active Fan Cooling
    Keyboard
    Standard PS/2 Keyboard
    Mouse
    ELAN Clickpad
    Internet Speed
    35.50 Mbps download 23.44 Mbps upload
    Browser
    Edge
    Antivirus
    Windows Defender
  • Operating System
    Windows 11 24h2
    Computer type
    PC/Desktop
    Manufacturer/Model
    Apple iMac "Core i5" 2.7 21.5" (Late 2012)
    CPU
    Intel® Core™ i5-3330S Processor
    Motherboard
    Ivy Bridge (LGA 1155)
    Memory
    8.00 GB DDR3 1600 MHz
    Graphics card(s)
    NVIDIA GeForce GT 640M
    Sound Card
    Cirrus Logic CS4206B (AB 90)
    Monitor(s) Displays
    Generic Monitor (iMac)
    Screen Resolution
    1920x1080
    Hard Drives
    APPLE HDD HTS541010A9E662 (Hard Drive 1TB)
    PSU
    Integrated
    Case
    iMac Aluminum Body
    Cooling
    Fan
    Keyboard
    HP SK-2085
    Mouse
    Lenovo
    Internet Speed
    90.8 Mbps download 23.4 Mbps upload
    Browser
    Google Chrome
    Antivirus
    Windows Defender

Latest Support Threads

Back
Top Bottom