Version 2 of WSL uses a new lightweight utility virtual machine capability. To enable the lightweight virtual machine and WSL, you need to enable two Windows features: Virtual Machine Platform and Windows Subsystem for Linux.
To enable these features via the user interface (UI), press the Windows key and enter Windows Features, then click on Turn Windows features on or off.
When the Windows Features dialog appears, check the boxes for Virtual Machine Platform and Windows Subsystem for Linux.
If you want to make version 2 the default for any Linux distros you install then run the following command:
Code:
wsl --set-default-version 2
Now you can install Linux distro from Microsoft Store it will be running version 2 of WSL.
A distro can be converted between versions of WSL after installation. To achieve this, you use the wsl --set-version command.
This command takes two arguments:
- The name of the distro to update
- The version to convert it to
An example of converting the Ubuntu distro to version 2 is shown here:
Code:
wsl --set-version Ubuntu 2
Execute wsl --list --verbose versions of WSL installed distro.