38

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
  • 1
    What version of Windows are you running. Be specific with the exact build number. If you are not running the current Insider Preview build for WIndows 11 you will likely have to build the kernel yourself and use a custom configuration file to use it. You can also just wait until the appropriate release of Windows includes the kernel update.
    – Ramhound
    Mar 12, 2022 at 4:52
  • Edition Windows 10 Enterprise Version 21H2 Installed on ‎03/‎12/‎2021 OS build 19044.1586 Experience Windows Feature Experience Pack 120.2212.4170.0
    – sjrm
    Mar 12, 2022 at 17:26

3 Answers 3

38

To be sure of getting updates to the WSL2 kernel:

  • Windows 10 : Open Settings > Update & Security > Windows Update.
    Windows 11 : Open Settings > 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.

3
  • Not sure why the downvote - It's a perfectly correct answer. Mar 12, 2022 at 17:55
  • @NotTheDr01ds - If you must know, I actually consider it incomplete, compared to your answer
    – Ramhound
    Mar 12, 2022 at 19:23
  • Small corrections; it's called "Update & Security" Jan 17 at 4:09
44

There are currently at least three ways to upgrade your WSL2 kernel:

  1. For recent Windows versions (Windows 10 21H2 and Windows 11), wsl --update is typically the best option, but realize that there is a slight lag between the time that Microsoft releases a kernel on Github and the time that they make it available for automatic updates.

    When this question was written:

    • 5.10.60.1 was the most recent available release for automatic update on Windows 11
    • 5.10.16 was the latest for Windows 10.
    • 5.10.102.1 was the latest available in the Github repository for the WSL2 kernel. It had just been released a few days earlier on March 8th. This is why wsl --update wasn't pulling it in (at the time) for the OP -- It was simply not yet available for wsl --update (or Windows automatic updates either).

    However, now, as of the time of this edit:

    • 5.10.102.1 is the latest stable kernel available via wsl --update (and automatic Windows updates) for both Windows 10 and 11 systems.
    • 5.15.57.1 has just been made available as the latest Preview release (on Windows 11 Insider builds).

    Note that you may need to run wsl --update in an Administrative session to update.

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

    wsl --update --rollback
    

    Regardless, I recommend renaming (or moving to another location) the previous kernel before updating, so that you can toggle between various kernels if needed using the .wslconfig file.

    Note: There is also currently a "Preview" release of WSL available in the Microsoft Store for Windows 11 users. If you are using this Store version, then wsl --update will not only update the kernel itself, but also the WSL Store package with the latest version. Because it is a user-level application, you no longer need to run wsl --update in an Administrative session. wsl --update --rollback is also no longer available in these releases.

  2. For older versions of Windows 10 that don't support wsl --update, please see @harrymc's answer. You can still opt in to automatic updates, and (when available) the new kernel will be upgraded via the normal Windows Update mechanism.

  3. Finally, you can certainly compile your own WSL2 kernel. It's best to start from the Microsoft sources, since it has the right selection of config options for the kernel to best operate in Windows/WSL2.

    Once you've compiled or obtained a custom kernel, you can specify it be used for all WSL2 instances by creating a .wslconfig with the appropriate section and kernel config.

3
  • i already run wsl --update and the kernel version keeps the same. I thought it was an error, because there was a newer version in the WSL Github rerpo. It means, the latest version in the repo is not necessarily the latest released to current Windows installations ?
    – sjrm
    Mar 12, 2022 at 17:29
  • @sjrm That's correct. Those "released" on Github aren't necessarily always pulled into WSL2 automatically. That's a fairly recent change, I believe. It looks like they are making more "incremental" changes in the repo, and only releasing to mainstream when there's a major new feature like USB/IP. Mar 12, 2022 at 17:57
  • 1
    Worth pointing out that the version of the WSL2 can and often is dependent on the Windows 10 version, so not all WSL kernel versions, will be released to Windows 10.
    – Ramhound
    Mar 12, 2022 at 19:08
19

For those, who can't update WSL kernel with wsl --update due to strict user update policy in their company, they can install a WSL-kernel manually. Read this

cd C:\Users\your_username\Desktop\
wsl --shutdown
wsl_update_x64.msi
wsl
uname -r

This should update the kernel and show you the latest running version.

5
  • 1
    I tried this but it installs it in the admin account and not for my user, if I run the msi without administrator permissions doesn't update anything Oct 19, 2022 at 9:59
  • Wokred for me, thanks for providing these instructions! May 16, 2023 at 17:05
  • 2
    Quite old releases
    – karadayi
    Feb 2 at 15:45
  • @karadayi Seems this catalog is abandoned: on github they list 5.15.146.1 as latest but you can also find 6.1.21.2 there Mar 7 at 5:50
  • 5.15 is not listed
    – KVM
    Mar 21 at 13:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .