- First you need to enable the component.
Open Powershell as an administrator and run
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
Once enabled, you will be asked to restart your computer.
- Get the WSL2 Linux kernel update package from https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi , then install and run
to view the current WSL version
wsl -l -v
wsl --set-version Ubuntu-20.04 2
If you have obtained and installed the WSL2 Linux kernel update package above, you do not need to perform the following content.
WSL 2 需要更新其内核组件。有关信息,请访问 https://aka.ms/wsl2kernel
You need to download
https://learn.microsoft.com/en-us/windows/wsl/install-manual.
After downloading, you can directly install it.
and then execute
wsl --set-version Ubuntu-20.04 2
wsl -l -v
You can complete the upgrade from WSL1 to WSL 2.