explaingit

microsoft/wsl2-linux-kernel

10,390CAudience · ops devopsComplexity · 5/5LicenseSetup · hard

TLDR

The Linux kernel source code that Microsoft ships with Windows Subsystem for Linux 2 (WSL2), the actual kernel running under your Linux terminal on Windows, based on upstream Linux with WSL-specific patches.

Mindmap

mindmap
  root((wsl2-linux-kernel))
    Purpose
      WSL2 Kernel Source
      Microsoft Patches
    Audience
      Kernel Developers
      Power WSL2 Users
    Customization
      Build Config
      Custom Modules
    Upstream
      Linux Kernel
      WSL Bug Tracker
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Build a custom WSL2 kernel with different compile-time options to enable features not in the default configuration.

USE CASE 2

Inspect the kernel configuration Microsoft uses for WSL2 to understand what is included or excluded versus a standard Linux kernel.

USE CASE 3

Understand the WSL-specific patches Microsoft adds on top of upstream Linux when diagnosing WSL2 kernel issues.

Tech stack

CLinuxMake

Getting it running

Difficulty · hard Time to first run · 1day+

Requires a Linux cross-compilation environment, Microsoft does not accept issues or pull requests in this repo.

Governed by the GPL like the upstream Linux kernel, you can use, study, and redistribute the code, but modifications must also be released under the GPL.

In plain English

This repository contains the source code for the Linux kernel that runs inside Windows Subsystem for Linux 2, known as WSL2. WSL2 is a feature in Windows that lets you run a real Linux environment directly on your Windows computer, without needing a separate virtual machine or dual-boot setup. The kernel is the core of any Linux system: it manages hardware access, memory, processes, and communication between software and the underlying computer. Microsoft takes the standard Linux kernel from the official Linux project and adds the configuration and infrastructure needed to package it for WSL2. The result is what Windows actually runs under the hood when you open a Linux terminal on a Windows machine. Because it is based on the upstream Linux kernel, it gets the same updates and features as any other Linux system, with some WSL-specific adjustments on top. The repository is primarily a release and build infrastructure repo rather than an active development hub. Microsoft does not accept issues or pull requests here. If you have a problem with WSL2 or want to report a kernel-related bug, you are directed to the main WSL repository at github.com/microsoft/WSL. If you want to contribute to the Linux kernel itself, the project points you to the official Linux kernel contribution process. The README is sparse because this is a technical infrastructure repository, not a general-purpose project. Its audience is people who need to inspect, build, or understand the kernel configuration that ships with WSL2, not casual users or contributors.

Copy-paste prompts

Prompt 1
Show me how to compile a custom WSL2 kernel from the microsoft/wsl2-linux-kernel source and configure Windows to load it instead of the default.
Prompt 2
What WSL-specific kernel configuration options does Microsoft add that differ from a standard Linux kernel build?
Prompt 3
I want to enable a kernel module not included by default in WSL2. Walk me through editing .config, recompiling, and loading the module.
Prompt 4
How do I set up a build environment on Ubuntu or Debian to cross-compile the WSL2 Linux kernel from source?
Open on GitHub → Explain another repo

← microsoft on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.