Currently, there are two versions of WSL available: WSL 1 and WSL 2. WSL 2 offers most of the eye-catching features, including Linux GUI app support, which is a great improvement over WSL 1.
To find out which WSL version you are using, run this command in the Windows terminal.
wsl --version
There is more to it and I'll be briefly discussing WSL versions and how you can switch between WSL versions.
Checking the WSL version
There are a couple of methods for getting the version of WSL you are running in your Linux distribution. Both of these include the command line. You can either use the built-in terminal or install and use PowerShell for Windows.
![Open a terminal by searching for it in the start menu](https://itsfoss.com/content/images/2024/03/open-a-windows-terminal-from-the-start-menu.png)
Check the installed WSL version
If you want to know what version of WSL is installed on your system, or check if WSL version 2 is installed, you can use the --version
option.
wsl --version
Or
wsl -v
This will print the WSL version along with some other information.
![The WSL version, that is installed on your system. Here, the latest version of WSL is installed.](https://itsfoss.com/content/images/2024/03/installed-wsl-version-on-the-system.png)
Check installed distributions and their WSL versions
Open the Windows terminal from the start menu. On the terminal, enter the following command:
wsl --list --verbose
OR
wsl -l -v
This will print all the installed distributions along with the WSL version they are running.
![List the distributions and the WSL version they are running in Windows terminal.](https://itsfoss.com/content/images/2024/03/wsl-list-verbose-command.png)
wsl.exe
in place of wsl
. That is, wsl -l -v
become wsl.exe -l -v
.Check WSL version using kernel version
While you are inside a WSL distribution, run:
uname -r
If you are using WSL 2, it will list the kernel as 5.15+ (as of now) and clearly states WSL 2.
![If you are using WSL 2, the kernel name will mention it properly](https://itsfoss.com/content/images/2024/03/wsl-2-is-using-a-5-15-kernel-and-stated-clearly.png)
Else, if the distribution is running WSL 1, you will be using the kernel 4.14, and won't specify WSL on the result.
![System running with WSL 1 shows kernel 4.14 and also no mention of WSL](https://itsfoss.com/content/images/2024/03/wsl-distribution-with-an-older-kernel-menas-wsl-1.png)
The same uname
command can be run from a Windows terminal to check the version. But here, you need to specify the name of the distribution whose kernel you want to check.
wsl -d <distribution_name> uname -r
![Checking the kernel version of installed WSL distributions from Windows terminal](https://itsfoss.com/content/images/2024/03/checking-kernel-version-in-wsl-windows-terminal.png)
In the above command, the distribution_name
should be the same as the one appearing on the output of the wsl -l -v
command.
Bonus: Switch WSL versions
On your system, if the Windows Subsystem for Linux feature is turned on, you can switch between WSL versions. Normally, for a system with large projects, switching is not recommended, because of the difference in the underlying architecture.
So, if you are using Ubuntu with WSL 2/1, and want to change it to WSL 1/2, use:
wsl --set-version <Distribution_name> <version_number_needed>
![Changing WSL version to One and Two](https://itsfoss.com/content/images/2024/03/changing-wsl-version.png)
It will take some time to change, and once done you can run the below command to verify the version:
wsl -l -v