Using Latest Kernel Linux on WSL 2

KVM? Yeah, on x86_64 you can have it


Thinking on using the latest Linux kernel on WSL 2? You can build it directly from the Linus Torvalds repository, not without some caveats.

Now in August 2025, the latest kernel v6.16, does not include yet the Microsoft dxgkrnl, aka DirectX kernel driver. So, does not expect to have GPU HW acceleration on WSL 2 using mainline kernel.

Microsoft maintains a fork of the Linux kernel with the necessary modifications for WSL 2, including the dxgkrnl driver. But, they maintains a stable branch, now in August 2025 v6.6.

Another point is that Microsoft builds of the kernel does not have KVM, needed for have HW acceleration for virtual machines, support out of the box.

󰇳 MicroHobby to the Rescue

So, with the points above in mind, I decided to maintain a fork of the mainline, Linus Torvalds tree, kernel repository, with the necessary modifications to have dxgkrnl. Also, is not everyone that want to dig into how to build a kernel, it can sounds scary at first glance. So, I decided to build it and provide a pre-built latest kernel binaries for WSL 2 users.

󱃱 Pre-built WSL 2 Kernel Binaries

You can download the latest pre-built kernel binaries from the cookbook-kernel-wsl repo. The bzImage is used for the x86_64 and the Image is the one used for arm64.

To use the pre-built kernel, you need to download the zip file, decompress it, and set it on the WSL 2 configuration file. The configuration file is located at C:\Users\<your-username>\.wslconfig. If the file does not exist, you can create it. Follow my example below:

[wsl2]
kernel=D:\\wsl\\kernel\\WSL\\mainline\\616\\bzImage
nestedVirtualization=true

 Note that I’m using the bzImage for x86_64 architecture. If you are using arm64, you should use the Image file instead. Always use the absolute path to where you placed the kernel file.

 Note that I’m also using the nestedVirtualization option set to true, which is needed to enable KVM support on WSL 2. The pre-built kernel has KVM support enabled by default, but only for x86_64 architecture. Even though we could enable the KVM support for arm64 under the build, it is not supported by WSL 2 for arm64 architecture right now.

These are the print screen of the binaries running on the WSL 2 on my machines:

Asus TUF Gaming Intel 12th Gen i7 caption-show

Lenovo Yoga Slim 7x with Snapdragon X Elite caption-show

 Extra bits

You could note that I’m linking the download of the pre-built kernel binaries to the cookbook-kernel-wsl repo. And maybe you are wondering that there is no kernel source code there. The repo is a “cookbook”, or a bunch of recipes, to build the kernel using Gaia Build System. Gaia makes my life easier by providing all the dependencies and automated recipes for build the Kernel. The recipe that has the reference to the kernel source code is the recipes-kernel/linux. You can see the follow:

    "source": "https://github.com/microhobby/linus-tree",
    "support": [
        "linux/amd64",
        "linux/arm64"
    ],
    "ref": {
        "linux/amd64": "29041d364da0cceb09283da594d08d8c8bc0bc70",
        "linux/arm64": "29041d364da0cceb09283da594d08d8c8bc0bc70"
    },

So, it means that the kernel source code is located at the microhobby/linus-tree and being built from the commit 29041d364da0cceb09283da594d08d8c8bc0bc70 for both x86_64 and arm64 architectures.

 Conclusion

So there you have it! Using the latest Linux kernel from mainline on WSL 2 is totally doable, but you’ll need to make some trade-offs. You get all the shiny new kernel features, but you’ll have to say goodbye to GPU acceleration for now.

I’ve been maintaining these pre-built binaries because, honestly, not everyone wants to learn and compile their own Linux kernel. If you’re curious about the latest kernel features or need KVM out of the box for your virtualization work, give these builds a shot. The microhobby/linus-tree repo keeps everything up to date with Linus latest work, so you’re getting the real deal + dxgkrnl support.