Understanding WSL2 and Why It ExistsLesson 1.4
How to install and switch between Linux distros in WSL2
wsl --list --online, wsl --install -d, default distro, wsl --set-default, running multiple distros, wsl --terminate, wsl --unregister
Managing Distros in WSL2
WSL2 supports multiple Linux distributions running in parallel. You can have Ubuntu for web projects and Debian for a stricter environment, both active at the same time.
Listing available distros
wsl --list --onlineThis pulls the current list from Microsoft. Common options include Ubuntu (22.04, 24.04), Debian, Kali Linux, and openSUSE.
Installing a specific distro
wsl --install -d DebianRun this in PowerShell. The distro downloads and launches a setup prompt for your Linux username and password.
Listing installed distros and their WSL version
wsl --list --verbose
# NAME STATE VERSION
# Ubuntu Running 2
# Debian Stopped 2Switching the default distro
wsl --set-default DebianAfter this, typing wsl in PowerShell drops you into Debian.
Stopping and removing distros
# Stop a running distro
wsl --terminate Ubuntu
# Remove a distro entirely (destructive — deletes all files)
wsl --unregister Ubuntu--unregister is permanent. Export a backup first if you have work inside: wsl --export Ubuntu ubuntu-backup.tar
