1. Open the settings of win10, search for the windows function, and enable or disable the Windows function.
2. Check 2 places and restart. It may also be the Chinese name "virtual machine platform"
3. Download the WSL2 upgrade package and click Install
Download link:
Link: https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
4. Open Powershell as an administrator and execute the following command
(1) Use the command to view the version number of the current subsystem, you may have multiple systems
wsl -l -v
At this point, if VERSION is equal to 1, you need to continue to execute the following commands.
(2) Execute the upgrade command, in fact, just execute this command
wsl --set-version Ubuntu-20.04 2
Note that Ubuntu-20.04 2 on the right needs to be consistent with the Name in (1).
(3) Confirm that the upgrade is successful
wsl -l -v
At this point, VERSION should be 2
(4) Set WSL 2 as the default version, and the default version of ubnutu downloaded and installed in the future is wsl2, or you can not execute this command
wsl --set-default-version 2