At the moment the latest WSL2 version is 0.58.3. I just run wsl.exe --update and now I would like to know which version of WSL2 I'm running. I've tried both --version and --status flags without success:
PS C:\Users> wsl.exe --status
Default Distribution: Ubuntu
Default Version: 2
Windows Subsystem for Linux was last updated on 6.5.2022
The Windows Subsystem for Linux kernel can be manually updated with 'wsl --update',
but automatic updates cannot occur due to your system settings.
To receive automatic kernel updates, please enable the Windows Update setting:
'Receive updates for other Microsoft products when you update Windows'.
For more information please visit
Kernel version: 5.10.102.1
PS C:\Users> wsl.exe --version
Invalid command line option: --versionHow can I check my current WSL2 version? Please note that I know I can use wsl.exe --list --verbose to see if I'm using WSL 1 or 2.
1 Answer
There are a few ways to get the installed WSL version, depending on how it was installed. Given that your installation does not have the --version command available, it's most likely you are running a released version of WSL. The --version option is (at this time) only available in Preview versions:
Released versions of WSL are installed with Windows releases/updates, and are versioned after their Windows build.
Older Preview versions (under Windows 10) also follow this versioning and were released with Insider/Preview builds of Windows. It's extremely unlikely that you are running a Windows 10 Preview version at this point, since all Developer/Insider builds have currently expired.
The latest released version at this time is 22000, which corresponds to the Windows 11 release.
For released versions (and older Preview versions), you can find the version by either:
Using File Explorer to navigate to
C:\Windows\System32\wsl.exe, right-click, select Properties, go to the Details tab, and look for the File Version.Or, from PowerShell:
(get-item C:\windows\system32\wsl.exe).VersionInfo.FileVersion
Starting soon after the Windows 11 release, Preview versions of WSL became available in the app Store. These versions are numbered with the point-release format you mention above, with the latest preview version currently being 0.58.3.
The Preview version of WSL does add a
wsl --version/-vcommand which shows something like:WSL version: 0.58.3.0 Kernel version: 5.10.102.1 WSLg version: 1.0.33 MSRDC version: 1.2.2924 Direct3D version: 1.601.0 Windows version: 10.0.22000.613You could also get just the WSL version by checking the Appx package that is installed from the Store through PowerShell:
(Get-AppxPackage | ? Name -eq "MicrosoftCorporationII.WindowsSubsystemforLinux").Version
Related: In the latest released/preinstalled versions of WSL, the wsl --update command will only update the WSL2 kernel to the latest release. Note that this may or may not correspond to the latest available on Github, as I believe these are usually given a test-run through the Preview before being made generally available.
wsl --help shows the following information --update on non-Preview versions:
--update [Options] If no options are specified, the WSL 2 kernel will be updated to the latest version. Options: --rollback Revert to the previous version of the WSL 2 kernel.In the Preview version, however, the help does say:
--update Update the Windows Subsystem for Linux package.While I haven't had the Preview installed long enough to know for sure, it sounds like this will actually update the Store package. It's not clear to me if this has any effect if Automatic Updates are enabled for Store packages, however.
It's also not yet clear whether Microsoft will continue to provide Released versions only with Windows updates (and leave Previews to the Store) or if they will fully transition to the Store version at some point. Currently, there are some limitations with Store apps that give them slightly less functionality -- The Preview version of WSL cannot be launched in a Windows SSH session. So at least until that is released, I believe we'll continue to see WSL production-ready releases only with Windows 11 updates.
1