Skip to content

Instantly share code, notes, and snippets.

@butageek
Last active July 24, 2021 03:42
Show Gist options
  • Save butageek/1287d820e3d35a36eb32abfe3496b443 to your computer and use it in GitHub Desktop.
Save butageek/1287d820e3d35a36eb32abfe3496b443 to your computer and use it in GitHub Desktop.
install wsl 2 on Windows

Step 1 - Enable the Windows Subsystem for Linux

Open PowerShell as Administrator and run following command:

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

Step 2 - Enable Virtual Machine feature

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

Step 3 - Reboot

Step 4 - Download the Linux kernel update package

WSL2 Linux kernel update package for x64 machines

Step 5 - Set WSL 2 as your default version

wsl --set-default-version 2

Step 6 - Install a distro

Open the Microsoft Store and select your favorite Linux distribution.

Set your distribution version to WSL 1 or WSL 2

Check WSL version

wsl --list --verbose

Convert version

wsl --set-version <distribution name> <versionNumber>

Make sure to replace with the actual name of your distribution and with the number '1' or '2'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment