24

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 https://aka.ms/wsl2kernel.

Kernel version: 5.10.102.1

PS C:\Users> wsl.exe --version
Invalid command line option: --version

How 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.

0

2 Answers 2

21

There are a few ways to determine 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 an in-box version of WSL (one that comes with Windows as a feature).

The --version option is only available in the Application version of WSL (installed from the Microsoft Store or a WSL Releases download).

  • Older, in-box/feature 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 in-box version at this time is 22000, which corresponds to the Windows 11 release. Even in Windows 11, 22H2, the in-box feature-set is still the same as in 22000.

    For in-box/feature versions (and older in-box 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, WSL became available in the Microsoft Store as an application package, first as a Preview, and with 1.0.0, as a generally-available release.

    These application packages are numbered with the point-release format you mention above, with the latest version currently being the 1.0.0 release. You can see a history of these releases in the WSL Github repo and even still download and install them if you wish.

    These releases of WSL does add a wsl --version/-v command 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.613
    

    You 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 application package (Store) version, you can update the full WSL release (including the kernel) with wsl --update.

However, in older, in-box 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 older, in-box versions of WSL:

--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.
1
3

You can type in your Windows terminal

wsl cat /proc/version

The output will look something like this:

wsl cat /proc/version
Linux version 5.15.90.1-microsoft-standard-WSL2 (oe-user@oe-host) (x86_64-msft-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220) #1 SMP Fri Jan 27 02:56:13 UTC 2023
1
  • 1
    And what part of that string is the WSL version as opposed to the kernel or distribution version?
    – Eph
    Commented May 21 at 15:30

You must log in to answer this question.

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