Install WSL2 on Windows 10

I’m a big fan of Windows Subsystem for Linux on Windows 10. I use WSL terminal as the default shell for lot of software development activities. I followed the following steps mentioned in this article Install WSL on Windows 10 | Microsoft Docs to install WSL2 on my Windows 10 (OS Build 19042.928).

Step 1 – Enable the Windows Subsystem for Linux

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

Step 2 – Enable Virtual Machine feature

Enable Virtual Machine Platform (an optional feature) before installing WSL2.

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

If you have hyper-v enabled, disable that. If you don’t disable hyper-v, you won’t be able to install Linux Kernel update package in step 3.

Restart the machine to complete the installation of WSL.

Step 3 – Linux Kernel update paxckage

Download and run the following Linux Kernel update package.

https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi

If you have hyper-v windows feature enabled, you won’t be able to install this package.

Step 4 – Set WSL 2 as default version

wsl --set-default-version 2

Step 6 – Install required Linux Distro.

In this case, i’m installing Ubuntu 20.0.4 by navigating to WSL store.

This completes the installation of WSL2 on Windows 10.