WSL 2(Window)
This guide explains how to install and configure WSL 2 (Windows Subsystem for Linux) on Windows 10 or Windows 11.
π§© 1. Check System Requirementsβ
Run this in PowerShell or Command Prompt to verify your system architecture (WSL 2 requires a 64βbit system):
systeminfo | find "System Type"
Expected output:
System Type: x64-based PC
Ensure that your system meets the following requirements:
- Windows 10, version 2004 (Build 19041) or higher, or Windows 11
- Virtualization enabled in BIOS (Intel VT-x / AMD-V)
- Administrative privileges on your machine
Check your Windows version:
winver
βοΈ 2. Enable WSL and Virtual Machine Platformβ
Open PowerShell as Administrator and run:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Restart your computer after these commands complete.
π§ 3. Install the WSL 2 Kernelβ
Download the Linux kernel update package for WSL 2 from Microsoft:
π https://aka.ms/wsl2kernel
Run the .msi file to install the update.
π 4. Set WSL 2 as the Default Versionβ
After installing the kernel, set WSL 2 as your default for new distributions:
wsl --set-default-version 2
To verify:
wsl --status
Expected output:
Default Version: 2
Kernel version: 5.x.x
π§ 5. Install a Linux Distributionβ
You can install your preferred Linux distribution from the Microsoft Store.
Example for Ubuntu:
wsl --install -d Ubuntu-22.04
After installation, launch Ubuntu from the Start menu and set up your username and password.
Update the system:
sudo apt update && sudo apt upgrade -y
π 6. Check Installed WSL Versionsβ
List all installed distributions and their versions:
wsl -l -v
Example output:
NAME STATE VERSION
* Ubuntu-22.04 Running 2
If a distribution is still using WSL 1, you can upgrade it:
wsl --set-version Ubuntu-22.04 2
β‘ 7. Useful Commandsβ
| Command | Description |
|---|---|
wsl --help | Show all available options |
wsl --list --verbose | List all installed distros and their WSL versions |
wsl --set-default-version 2 | Set WSL 2 as the default version |
wsl --set-version <Distro> 2 | Convert a specific distro to WSL 2 |
wsl --terminate <Distro> | Stop a specific distro |
wsl --shutdown | Stop all running WSL instances |
π§° 8. Common Troubleshootingβ
| Issue | Solution |
|---|---|
Error: 0x8007019e | WSL is not enabled β enable WSL via PowerShell (Step 2) |
Error: 0x80370102 | Virtualization not enabled β enable in BIOS |
| WSL not starting | Restart LxssManager service or use wsl --shutdown |
| Slow performance | Check antivirus exclusion or disk usage in Windows settings |
β 9. Verify Everything Worksβ
Run:
wsl
uname -a
Expected output:
Linux <hostname> 5.x.x-microsoft-standard-WSL2 #1 SMP ... x86_64 GNU/Linux
Congratulations! π You now have WSL 2 fully installed and ready to use.
π§βπ» Next Stepsβ
- Install Docker Desktop (uses WSL 2 backend)
- Configure VS Code Remote β WSL extension
- Try running Python, Node.js, or other Linux-based tools directly from WSL
π Last Updated: November 2025 π§βπ» Author: Huy Pham