Set Linux Distro Version to WSL 1 or WSL 2 in Windows 10

How to Set a Linux distro version to WSL 1 or WSL 2 in Windows 10

Microsoft has ported WSL 2 to Windows 10 version 1909, and version 1903. Initially, it was exclusively available in Windows 10 version 2004. Now users who have installed two older releases of the OS can upgrade Windows Subsystem for Linux to the latest generation and get benefits from using it.

Wsl2 Kernel Update

WSL 2 is a new version of the architecture that powers the Windows Subsystem for Linux to run ELF64 Linux binaries on Windows. This new architecture changes how these Linux binaries interact with Windows and your computer’s hardware, but still provides the same user experience as in WSL 1 (the current widely available version).

Advertisment

It ships a real Linux kernel with Windows that will make full system call compatibility possible. This is the first time a Linux kernel is shipped with Windows. WSL 2 uses the latest virtualization technology to run its Linux kernel inside of a lightweight utility virtual machine (VM).  In order to make it available for more Windows 10 users, Microsoft has made it available for two previous releases of the OS.

All its key features will be available, including

  • File system performance now on par with Mac and Linux speeds
  • Improved System Call Support for all Linux applications notably: Docker, FUSE, rsync, etc.
  • Full Linux kernel
  • Docker Desktop has added support to use WSL 2 as its engine

Builds 18362.1049 and 18363.1049 or higher are required to get WSL2 working. They are released with KB4571748.

You can set the desired WSL version to be used by default for new WSL instances, or set an installed distro to a specific WSL platform.

Set Linux Distro Version to WSL 1 or WSL 2 for new instances

  1. Open PowerShell as Administrator.
  2. To set WSL 2 as your default version for new instances, type and run: wsl --set-default-version 2.
  3. To set WSL 1 as your default version for new instances, type and run: wsl --set-default-version 1.
  4. You are done.

Note: Some of the legacy WSL distros are not designed to run under WSL 2. You need to uninstall them manually. Here is the list of WSL 2 -compatible distros.

Well, you can instead to convert an existing distro to version 1 or 2. Here's how to find WSL versions for your installed distros.

Find WSL Versions for Installed Linux Distros

  1. Open PowerShell as Administrator.
  2. Run the command: wsl --list --verbose.
  3. See the 'version' column value.Change WSL Version For Distro

You are done.

Finally, here's how to change the WSL version for a distro.

To Set Linux Distro Version to WSL 1 or WSL 2 in Windows 10,

  1. Open PowerShell as Administrator.
  2. To set WSL 2 as the distro version for the specific instance, run the command wsl --set-version <distro_name> 2.
  3. Substitute the <distro_name> portion with the actual Linux name you are using, e.g. Ubuntu: wsl --set-version Ubuntu 2.Windows 10 WSL Distro Converted To WSL2
  4. To convert a distro to WSL 1, issue the command wsl --set-version <distro_name> 1, e.g. for Ubuntu run: wsl --set-version Ubuntu 1.

Advertisment

Leave a Reply

Your email address will not be published. Required fields are marked *