< Alle Themen

WSL2+ Kernel V6.6 Howto for Windows 11

# WSL2+ Kernel V6.6 Howto for Windows 11  Version 2 03/07/2024 by toxwood (mail@rbconnect.eu) https://rbconnect.eu/kb/wsl2-kernel-v6-howto-for-windows-11/
# Instructions for building an x86_64 WSL2 kernel with an Ubuntu distribution (Howto uses Ubuntu 22.04.3 LTS) are as follows:

For testing you can dowload the precompiled Kernel Image from here: https://download.rbconnect.eu/Windows%20Pub/wsl2-linux-kernel-6-windows/bzImage.zip

Datei: bzImage.zip
SHA-256: 49cc85aa5b377f8a28d529eedaad9593a4db07153930c2a3c0983abcad07c17e
SHA-512: 44247897f00df4bc7572f3da201988d8d1e81f1cfd167dead9c6594dcd142a4480c1f1e67d5998774fb87d5c0e61ffbff1a8a9dde85d04d85523c7dab5cba6e9

# Ubuntu 22.04.3 LTS Requirements

Open a WSL terminal window and launch the distro of your choice.

Install the required packages to build the kernel:

sudo apt update && sudo apt upgrade && sudo apt install bc dwarvesbc pahole build-essential flex bison libssl-dev libelf-dev

# Get the Microsoft Linux Kernel Source from from GitHub:

wget https://github.com/microsoft/WSL2-Linux-Kernel/archive/refs/tags/linux-msft-wsl-

Datei: WSL2-Linux-Kernel-linux-msft-wsl-
SHA-256: 1799682e04a6ffd9d90afdd182365fd50d8b3eeca3cba39ebc0df5e07dc2ae49
SHA-512: 08780d024b69fad5f460be614793a4d4f8912d6b3f2175daf8bcd336e38e8c9dea9fe42f5e0f8e64f823d4c38a2c35e7cc250ab755b5ea77d801e3fe8f1e9346

or get it from my mirror

wget https://download.rbconnect.eu/Windows%20Pub/wsl2-linux-kernel-6-windows/WSL2-Linux-Kernel-linux-msft-wsl-

# Unzip it and Change directory to the kernel source code:

cd WSL2-Linux-Kernel-linux-msft-wsl-

# Build the Kernel (takes some time) !! You will be asked for the following !!:

Mitigations for CPU vulnerabilities (CPU_MITIGATIONS) [Y/n/?] (NEW) Y <- (choose „n“ for better Performance, but less Security Infos: https://docs.kernel.org/admin-guide/hw-vuln/mds.html#:~:text=SMT%20state%20unknown-,Mitigation%20mechanism,a%20kernel%20command%20line%20option. )

Analog Devices Generic AXI ADC IP core driver (ADI_AXI_ADC) [N/m/?] N <- (https://cateee.net/lkddb/web-lkddb/ADI_AXI_ADC.html)

sudo make KCONFIG_CONFIG=Microsoft/config-wsl

# Install the kernel modules and headers:

sudo make modules_install headers_install

# Installing the Kernel:

# Copy the kernel image to the Windows file system:

sudo cp arch/x86/boot/bzImage /mnt/c/kernel

# Open Windows Explorer copy the kernel from the “c:\kernel” folder to the root of C:\
(Windows security confirmation could be required).

Exit the WSL terminal window.

# Using the Kernel

# You can configure WSL to use it instead of the stock kernel as follows.
Create or edit the file `%USERPROFILE%\.wslconfig` with the following content:



# Open a PowerShell terminal window as Administrator and Stop the WSL instance:

wsl –shutdown

# Now you can now launch your WSL2 distro and check the kernel version as follows:

Open a WSL terminal window and launch the distro of your choice.

Check the kernel version:

uname -r

# You should see the following output:

Linux PCname #1 SMP PREEMPT_DYNAMIC Wed Jul 3 10:31:09 CEST 2024 x86_64 x86_64 x86_64 GNU/Linux

# Documentation

wsl2-kernel: https://github.com/microsoft/WSL2-Linux-Kernel

about-wsl2: https://docs.microsoft.com/en-us/windows/wsl/about#what-is-wsl-2

wsl-issue: https://github.com/microsoft/WSL/issues/new/choose

normal-bug: https://www.kernel.org/doc/html/latest/admin-guide/bug-hunting.html#reporting-the-bug

security-bug: https://www.kernel.org/doc/html/latest/admin-guide/security-bugs.html

submit-patch: https://www.kernel.org/doc/html/latest/process/submitting-patches.html

.wslconfig-inst: https://docs.microsoft.com/en-us/windows/wsl/wsl-config#configure-global-options-with-wslconfig