How to Install WSL2 on Your PC
Follow these steps to install WSL2 on your Windows 10 or Windows 11 computer.
Step 1: Enable the Windows Subsystem for Linux
Open PowerShell as Administrator and run:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
Step 2: Check Requirements for Virtual Machine Platform
Ensure your PC meets the requirements for running the Virtual Machine Platform.
Step 3: Enable Virtual Machine Feature
In the same PowerShell window, run:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Step 4: Download the Linux Kernel Update Package
Download and install the WSL2 Linux kernel update package from Microsoft's official website.
Step 5: Set WSL2 as Your Default Version
Open PowerShell and run:
wsl --set-default-version 2
Step 6: Install Your Linux Distribution of Choice
Open the Microsoft Store, select your favorite Linux distribution, and click "Install".
After installation, launch your Linux distribution by clicking the "Launch" button, or by searching for your distribution name in the start menu.