
The Windows Subsystem for Linux (WSL) runs real Linux distributions such as Ubuntu, Debian, Kali, openSUSE, AlmaLinux or Fedora directly on Windows, with no dual boot and no separate virtual machine to manage. You can install several distros side by side, pick a default, export them as backups and remove them when you're done. This guide covers installing WSL, choosing and adding distros, the most useful wsl commands, and how to fix the usual errors on Windows 10, Windows 11 and Windows Server.
Quick answer
wsl --install # install WSL with the default distro (Ubuntu)
wsl --list --online # see available distros
wsl --install -d Debian # install a specific distro
wsl --list --verbose # see installed distros and their WSL version
What is WSL?
WSL 2 runs a real Linux kernel inside a lightweight, automatically managed virtual machine. Each distribution has its own files and packages, shares your Windows network, can open Windows files under /mnt/c, and can run Linux GUI apps through WSLg on Windows 11. Microsoft made WSL open source in 2025, and since 2026 it also includes WSL containers for running Linux containers without Docker Desktop.
Prerequisites
- Windows 10 version 2004 or later, Windows 11, or Windows Server 2022/2025.
- Hardware virtualization enabled in the BIOS/UEFI (on a VPS, the provider must allow nested virtualization).
- Administrator rights for the first installation.
Step 1: Enable WSL
Open PowerShell or Command Prompt as administrator and run:
wsl --install
This enables the required Windows features, installs the latest WSL and installs Ubuntu as the default distribution. Restart when asked. After the restart, Ubuntu opens and asks you to create a Linux username and password (they don't need to match your Windows account).
To install WSL without any distro, use wsl --install --no-distribution.
Step 2: Choose and install a distribution
List the distributions available online:
wsl --list --online # short form: wsl -l -o
You'll see names such as Ubuntu, Ubuntu-24.04, Debian, kali-linux, openSUSE-Tumbleweed, AlmaLinux-9 and others; the exact list changes over time. Install one by its name:
wsl --install -d Ubuntu-24.04
wsl --install -d Debian
You can also install distros from the Microsoft Store, or from a file a vendor provides with wsl --install --from-file distro.wsl.
Step 3: Set up the Linux environment
Inside the new distro, update the packages first:
sudo apt update && sudo apt upgrade -y # Ubuntu/Debian/Kali
sudo dnf upgrade -y # AlmaLinux/Fedora
Your Linux home folder is at \\wsl$\Ubuntu-24.04\home\yourname in File Explorer (or under "Linux" in the Explorer sidebar). Keep project files inside the Linux file system for the best performance; working on files under /mnt/c is much slower.
Step 4: Manage your distros
| Command | What it does |
|---|---|
wsl -l -v | List installed distros, their state and WSL version |
wsl -d Debian | Open a specific distro |
wsl --set-default Debian | Make a distro the default for wsl |
wsl --set-version Ubuntu 2 | Convert a distro to WSL 2 |
wsl --set-default-version 2 | Use WSL 2 for future installs |
wsl --terminate Ubuntu | Stop one distro |
wsl --shutdown | Stop all distros and the WSL VM |
wsl --export Ubuntu D:\backup\ubuntu.tar | Back up a distro to a file |
wsl --import Ubuntu2 D:\WSL\Ubuntu2 D:\backup\ubuntu.tar | Restore or clone a distro to another location |
wsl --unregister Ubuntu | Delete a distro and all its data |
wsl --update | Update WSL itself |
Export and import are also the way to move a distro from the C: drive to another drive.
Tips
- Use Windows Terminal; every installed distro appears as its own profile.
- Limit WSL's memory and CPU in
%UserProfile%\.wslconfig(for example[wsl2]thenmemory=8GBandprocessors=4). - Enable systemd inside a distro with
[boot]systemd=truein/etc/wsl.conf(Ubuntu already has it on). - VS Code's WSL extension opens Linux folders with full Linux tooling.
Troubleshooting
- Error 0x80370102: virtualization is disabled. Enable it in the BIOS/UEFI; on a VPS, ask the provider for nested virtualization, or use WSL 1 with
wsl --set-version Distro 1. - "The Windows Subsystem for Linux has not been enabled": run
wsl --installas administrator and restart. - No internet inside WSL: VPNs and custom DNS are the usual cause. Try
networkingMode=mirroredunder[wsl2]in.wslconfig, thenwsl --shutdown. - Distro won't start after an update: run
wsl --updateandwsl --shutdown, then open it again.
Frequently asked questions
How do I list available WSL distros?
Run wsl --list --online (or wsl -l -o) to see distros you can install, and wsl -l -v to see installed ones.
How do I install a new distro in WSL?
Run wsl --install -d DistroName using a name from the online list.
How do I run a specific WSL distro?
Use wsl -d DistroName, or set it as the default with wsl --set-default DistroName.
Can I install WSL on Windows Server?
Yes. Windows Server 2022 and 2025 support wsl --install. On a VPS, WSL 2 also needs nested virtualization.


