The WSL2-Linux-Kernel repo contains the kernel source code and configuration files for the WSL2 kernel.
If you discover an issue relating to WSL or the WSL2 kernel, please report it on the WSL GitHub project. It is not possible to report issues on the WSL2-Linux-Kernel project.
If you're able to determine that the bug is present in the upstream Linux kernel, you may want to work directly with the upstream developers. Please note that there are separate processes for reporting a normal bug and a security bug.
Is there a missing feature that you'd like to see? Please request it on the WSL GitHub project.
If you're able and interested in contributing kernel code for your feature request, we encourage you to submit the change upstream.
Instructions for building an x86_64 WSL2 kernel with an Ubuntu distribution are as follows:
- Install dependencies:
$ sudo install build-essential flex bison libssl-dev libelf-dev
- Prepare/Update the default kernel config:
$ make prepare KCONFIG_CONFIG=Microsoft/config-wsl
- Make/Compile a kernel using the updated config:
$ make KCONFIG_CONFIG=Microsoft/config-wsl -j{core numbers}
You may want to see the documentation on the .wslconfig configuration file for information on using a custom built kernel.
For a quick example:
- Install kernel modules:
$ sudo make modules_install
- Create a kernel folder in your Windows FS:
$ mkdir -p /mnt/c/wsl/kernel
- Copy your kernel image:
$ cp arch/x86/boot/bzImage /mnt/c/wsl/kernel/{your kernel name}
- Add a WSL config file:
$ nano /mnt/c/Users/{your username}/.wslconfig
- Add line there:
kernel = c:\\wsl\\kernel\\{your kernel name}