Install WSL on Windows 11

Complete guide to installing Windows Subsystem for Linux (WSL) on Windows 11.

Prerequisites

  • Windows 11 or Windows 10 version 2004 and higher (Build 19041 and higher)
  • Administrator privileges on your computer
  • Virtual Machine Platform enabled (will be covered in steps)
  • Hyper-V compatible processor (most modern CPUs)

Method 1: Simple Installation (Recommended)

This is the easiest method for Windows 11 users!

Step 1: Open PowerShell as Administrator
  1. Press Windows key + X
  2. Select "Windows Terminal (Admin)" or "PowerShell (Admin)"
  3. Click "Yes" when prompted by User Account Control
Step 2: Install WSL

Run the following command to install WSL with Ubuntu (default distribution):

wsl --install

What this command does:

  • Enables the required Windows features
  • Downloads and installs the latest Linux kernel
  • Sets WSL 2 as the default
  • Downloads and installs Ubuntu Linux distribution
Step 3: Restart Your Computer

After the installation completes, restart your computer:

shutdown /r /t 0
Step 4: Complete Ubuntu Setup

After restart, Ubuntu will automatically launch and ask you to:

  1. Create a username (lowercase, no spaces)
  2. Create a password (you won't see characters as you type)
  3. Confirm your password

Method 2: Manual Installation

Use this method if the simple installation doesn't work or you want more control.

Step 1: Enable WSL Feature

Open PowerShell as Administrator and run:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
Step 2: Enable Virtual Machine Platform
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Step 3: Restart Computer
shutdown /r /t 0
Step 4: Download WSL2 Kernel Update

Download and install the WSL2 Linux kernel update package from Microsoft:

Download Link:
WSL2 Kernel Update

Step 5: Set WSL2 as Default
wsl --set-default-version 2
Step 6: Install Linux Distribution

Install Ubuntu from Microsoft Store or use PowerShell:

wsl --install -d Ubuntu

Available Linux Distributions

View available distributions:

wsl --list --online
Popular Distributions:
  • Ubuntu - Most popular, beginner-friendly
  • Debian - Stable and lightweight
  • Kali-linux - Security testing tools
  • Alpine - Minimal and fast
  • openSUSE-Leap - Enterprise-focused
  • Ubuntu-20.04 - LTS version
  • Ubuntu-22.04 - Latest LTS
  • SUSE Linux Enterprise - Commercial support
Install Specific Distribution:
wsl --install -d <distribution-name>

Useful WSL Commands

Management Commands:
# List installed distributions
wsl --list --verbose

# Check WSL version
wsl --version

# Start specific distribution
wsl -d Ubuntu

# Shutdown all WSL instances
wsl --shutdown

# Terminate specific distribution
wsl --terminate Ubuntu
Configuration Commands:
# Set default distribution
wsl --set-default Ubuntu

# Convert to WSL2
wsl --set-version Ubuntu 2

# Unregister (remove) distribution
wsl --unregister Ubuntu

# Update WSL
wsl --update

# Check status
wsl --status

Troubleshooting

Common Issues and Solutions:
Download and install the WSL2 kernel update from Microsoft (link provided in Method 2).
Enable virtualization in BIOS/UEFI settings. Look for "Intel VT-x" or "AMD-V" and enable it.
Make sure you're running Windows 10 version 2004+ or Windows 11. Update Windows and restart.
Try running: wsl --shutdown then wsl to restart. If issues persist, unregister and reinstall the distribution.

Next Steps

After successful installation, you can:

  • Update your Linux system: sudo apt update && sudo apt upgrade
  • Install development tools: sudo apt install git curl wget
  • Access Windows files from Linux: /mnt/c/
  • Install Windows Terminal for better experience
  • Install VS Code with WSL extension
  • Set up your development environment
  • Learn basic Linux commands
  • Explore Docker integration with WSL2