In 2020, Microsoft announced WSL 2. You can expect higher performance than the previous WSL 1. It also simplifies the GUI. : computer:
Details: Comparison of WSL 1 and WSL 2
I want to switch the default distribution from Ubuntu-18.04 (WSL 1) to Ubuntu-20.04 (WSL 2).
Open PowerShell as an administrator. (Enter PowerShell
in" Enter here to search "on the right side of the Start menu button. When PowerShell is displayed, right-click and select" Open from administrator ")
Enter the following command in PowerShell.
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
You can check the version information of Windows you are using by entering winver
in" Enter here to search "on the right side of the Start menu button and opening winver.
Check if the following requirements are met.
1903
or later, build 18362
or higher.For ARM64 systems: version 2004
or later, build 19041
or higher.
If not, update Windows with Windows Update Assistant.
(By the way, the version of my PC was as follows and met the requirements.
Microsoft Windows Version
1909
(OS build18363
, 1082)
)
Restart Windows.
Download and run the WSL2 Linux kernel update package installer from here.
Get Ubuntu-20.04 from the Microsoft Store.
Open PowerShell again from an administrator and enter the following command to update the default version to WSL 2 for Ubuntu-20.04.
wsl --set-version Ubuntu-20.04 2
Check the default version by entering the following command in PowerShell.
wsl --list --verbose
It is OK if the output is as follows.
NAME STATE VERSION
* Ubuntu-20.04 Running 2
Ubuntu-18.04 Stopped 1
The one with *
is the default distribution.
Also, make sure that Ubuntu-20.04 appears at the top when you type Ubuntu
at the start.
Installation Guide for Windows Subsystem for Linux for Windows 10