Install Ubuntu 20.04 on Windows 10 WSL
Today Microsoft announced the general availability of Windows Subsystem for Linux 2 in the Windows 10 May 2020 update.
WSL 2 is based on a new architecture that provides full Linux binary application compatibility and improved performance. WSL 2 is powered by a real Linux kernel in a lightweight virtual machine that boots in under two seconds. WSL 2 is the best way to experience Ubuntu on WSL.
Ubuntu was the first Linux distribution for WSL and remains the most popular choice of WSL users. Ubuntu 20.04 LTS for WSL was released simultaneously with the general availability of Ubuntu 20.04 LTS in April.
Ubuntu is ready for WSL 2. All versions of Ubuntu can be upgraded to WSL 2. The latest version of Ubuntu, Ubuntu 20.04 LTS, can be installed on WSL directly from the Microsoft Store. For other versions of Ubuntu for WSL and other ways to install WSL see the WSL page on the Ubuntu Wiki.
Ubuntu on WSL supports powerful developer and system administrator tools, including microk8s, the simplest way to deploy a single node Kubernetes cluster for development and DevOps.
See our YouTube page for more WSL-related videos from WSLConf 2020.
Enable WSL 2
To enable WSL 2 on Windows 10 May 2020 update (build 19041 or higher) run the following in PowerShell as Administrator:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
“WSL2 requires an update to its kernel component”
Some users upgrading from Insider builds of Windows 10 will encounter an error running the commands below. You will be directed to manually download and update the Linux kernel. Visit aka.ms/wsl2kernel to download a .msi package, install it, and then try again.
Convert Ubuntu on WSL 1 to WSL 2
To convert an existing WSL 1 distro to WSL 2 run the following in PowerShell:
wsl.exe --set-version Ubuntu 2
Set WSL 2 as the default
To set WSL 2 as the default for installing WSL distributions in the future run the following in PowerShell:
wsl.exe --set-default-version 2
Upgrade to Ubuntu 20.04 LTS on WSL
To upgrade to the latest version of Ubuntu on WSL run the following in Ubuntu:
sudo do-release-upgrade -d
Windows Terminal 1.0
The new open source Windows Terminal recently reached 1.0 and makes an excellent companion to Ubuntu on WSL 2. Windows Terminal can be downloaded from the Microsoft Store or GitHub and can be extensively customized.