How to Install WSL in Windows

Here’s the clean, correct way to install WSL (Windows Subsystem for Linux) on Windows. This guide covers the modern one-command method first (recommended), then the manual fallback.

1️⃣ Open PowerShell as Administrator

2️⃣ Run this single command

wsl --install

What this does automatically:

👉 Reboot when prompted

3️⃣ Launch Linux

After reboot:

🎉 Done. You now have a full Linux environment.

🔍 Verify Installation

wsl --status

You should see:


📋 Common WSL Commands

Install a specific distribution

wsl --install -d <DistroName>

List available distributions

wsl --list --online

Set default distribution

wsl --set-default <DistroName>

Set default version

wsl --set-default-version 2

Uninstall a distribution

wsl --unregister <DistroName>

Update WSL

wsl --update

Shutdown WSL

wsl --shutdown

🔄 File Access

Access Windows files from WSL

cd /mnt/c/Users/<username>

Access WSL files from Windows

\\wsl$\<DistroName>

🛠️ Advanced Commands

Run a command in WSL

wsl <command>

Run a command in a specific distribution

wsl -d <DistroName> <command>

Run a command as a specific user

wsl -u <username> <command>

Export a distribution

wsl --export <DistroName> <FileName>

Import a distribution

wsl --import <DistroName> <InstallLocation> <FileName>

Terminate a distribution

wsl --terminate <DistroName>

List running distributions

wsl --list --running

List all distributions

wsl --list --all

List verbose

wsl --list --verbose