How can I update the kernel in WSL2 kernel to latest release?

The current kernel version in my WSL2 subsystem is:

5.10.60.1-microsoft-standard-WSL2

However, I see in the official Microsoft WSL GitHub repo there is a newer version of the kernel:

linux-msft-wsl-5.10.102.1

How can I update the kernel in my already installed WSL setup? I tried this:

wsl --update

But it does not update the kernel version.

2

2 Answers

To be sure of getting updates to the WSL2 kernel:

  • Open Settings > Update & recovery > Windows Update
  • Click on "Advanced options"
  • Enable "Receive updates for other Microsoft products when you update Windows"
  • Returning to the previous page in Settings, click "Check for updates".

This will allow Windows to install the latest Linux 2 kernel for WSL 2.

The presence of a later version on Github does not mean that it was yet incorporated into the Stable version.

2

While the method mentioned by @harrymc is true for older versions of WSL, recent versions (on both Windows 10 and Windows 11) support direct update without requiring you to opt-in to all other Microsoft Product updates.

Just use ...

wsl --update

If there is a new kernel, this will download it, backup the previous version, and install the new one.

If needed, you can revert to the previous release with:

wsl --update --rollback

I recommend renaming the previous kernel before updating anyway, so that you can toggle between various kernels if needed using the .wslconfig file.

At present, however, the 5.10.60.1 release is the most recent available for update on Windows 11. However, you can certainly compile your own from the later kernel source release available in the repo and update manually through .wslconfig if desired. It's fairly straightforward.

Side note for Windows 10 readers -- It looks like 5.10.16 may be the latest for WSL2 running on Windows 10. The primary change in 5.10.60.1 was USB/IP support. Microsoft has only "officially" supported it on Windows 11 at this point, but it does work properly on Windows 10 with the proper kernel updates.

3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like