The wsl2-linux-kernel is the Linux kernel source code and build system for Windows Subsystem for Linux 2.
The project addresses the need for a customizable kernel that powers WSL2, allowing developers to build and modify the kernel to suit their specific requirements. The repository provides the kernel source alongside Microsoft's configuration files and build scripts that automate compilation into a VHDX artifact compatible with WSL2's expected layout.
Developers should adopt this tool if they need to customize the WSL2 kernel beyond the default distribution—whether to enable specific kernel features, apply patches, or optimize for particular workloads. The build process is straightforward for those familiar with Linux kernel compilation, requiring standard development tools and offering optional parallel builds for faster compilation. Custom kernels can be deployed through WSL's .wslconfig configuration file. This is primarily for advanced users; most WSL2 users will not need to build their own kernel.
The project maintains a clear separation of concerns: bug reports and feature requests are directed to the main WSL GitHub project rather than this repository, keeping the kernel source focused on code. Contributions are encouraged to flow upstream to the Linux kernel project itself, reflecting an integration-focused approach rather than maintaining divergent customizations.