There are currently at least three ways to upgrade your WSL2 kernel:
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 forwsl --update
(or Windows automatic updates either).
However, now, as of the time of this edit (and for a while now), 5.10.102.1 is available via
wsl --update
(and automatic Windows updates) for both Windows 10 and 11 systems.:- 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 anyway, 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 runwsl --update
in an Administrative session.wsl --update --rollback
is also no longer available in these releases.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.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.