Set Up WSL2 for Development on Windows
Install the Windows Subsystem for Linux 2 and a Linux distro so you get a real Linux environment alongside Windows.
Requirements
- Windows 10 version 2004+ or Windows 11
- Admin access to PowerShell
Install WSL
Open PowerShell as Administrator and run:
$ wsl --installThis enables the required Windows features, installs the WSL2 kernel, and installs Ubuntu as the default distro. Restart when prompted.
Create your Linux user
After restarting, Ubuntu launches automatically and finishes setup. You'll be asked to create a Linux username and password — this is separate from your Windows login and can be anything.
Verify the installation
$ wsl --list --verboseExpected output
NAME STATE VERSION * Ubuntu Running 2
Confirm the VERSION column shows 2, not 1 — WSL2 is what gives you a full Linux kernel and much better performance.
Success
You now have a real Linux environment running inside Windows.
Optional: install an additional distro
$ wsl --list --online$ wsl --install -d DebianTip
You can run multiple distros side by side and switch between them with wsl -d <name>.
Troubleshooting
WSL itself is enabled, but the separate Linux kernel package it depends on is missing or outdated.
$ wsl --update