I'm using Ubuntu 18.04 with WSL1, so I want to run it with WSL2.
First, type winver in the search window of the start menu to check the version of windows 10. Make sure this version is 2004 and the OS build is 1904 (otherwise you can't update). After checking, enter powershell in the search window of the start menu, run powershell in administrator mode, and change the default setting of wsl to ver 2.
PS C:\WINDOWS\system32> wsl --set-default-version 2
Error: 0x1bc
However, the above error occurred. I had a similar question on StackOverFlow, and the answer was to update the WSL Linux kernel, so I'll do that. Go to https://docs.microsoft.com/en-us/windows/wsl/wsl2-kernel to download and run the Linux kernel update. After execution, open PowerShell again with administrator privileges and execute the following command
PS C:\WINDOWS\system32> wsl --set-default-version 2
For the main differences from WSL 2, https://aka.ms/See wsl2
Apparently, the default-version could be updated, so I changed Ubuntu-18.04, which is already running, to WSL2.
PS C:\WINDOWS\system32> wsl --set-version Ubuntu-18.04 2
Converting. This process can take a few minutes...
For the main differences from WSL 2, https://aka.ms/See wsl2
The conversion is complete.
Finally confirm
PS C:\WINDOWS\system32> wsl --list --verbose
NAME STATE VERSION
* Ubuntu-18.04 Stopped 2
Completed safely.
Recommended Posts