WSL1 upgraded to WSL2

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

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

Insert image description here

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.

Insert image description here
WSL 2 需要更新其内核组件。有关信息,请访问 https://aka.ms/wsl2kernel
You need to download
https://learn.microsoft.com/en-us/windows/wsl/install-manual.
Insert image description here
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.

Reference blog

Guess you like

Origin blog.csdn.net/weixin_43845922/article/details/132110993
Recommended