WSL Installation Guide

Complete step-by-step instructions to install Windows Subsystem for Linux on your Windows machine.

Prerequisites

Windows 10 version 2004 (Build 19041) or higher, or Windows 11

Administrator privileges on your Windows machine

Virtualization enabled in BIOS/UEFI (for WSL 2)

Method 1: Simple Installation (Recommended)

The easiest way to install WSL is using the new simplified command. This will install WSL 2 with Ubuntu by default.

Step 1: Open PowerShell as Administrator

Right-click on the Start button and select "Windows PowerShell (Admin)" or "Terminal (Admin)".

Step 2: Run the Installation Command

PowerShell (Admin)
PS C:\\Windows\\system32>wsl --install

This command will automatically enable the required Windows features, download and install the Linux kernel, and install Ubuntu as the default distribution.

Step 3: Restart Your Computer

After the installation completes, restart your computer to finish the setup process.

Step 4: Complete Ubuntu Setup

After restarting, Ubuntu will automatically launch and complete the installation. You'll be prompted to create a username and password for your Linux user account.

Important: The username and password you create here are separate from your Windows credentials. Choose a secure password and remember it – you'll need it for sudo commands.

Method 2: Manual Installation

If you prefer more control over the installation process or the simple method doesn't work, you can install WSL manually.

Step 1: Enable Windows Features

Run these commands in PowerShell as Administrator:

PowerShell (Admin)
PS>dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
PS>dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Step 2: Download and Install Linux Kernel Update

Download the WSL2 Linux kernel update package and install it.

Step 3: Set WSL 2 as Default

PowerShell
PS>wsl --set-default-version 2

Step 4: Install a Linux Distribution

Install your preferred Linux distribution from the Microsoft Store or using command line:

PowerShell
# Install Ubuntu (default)
PS>wsl --install -d Ubuntu
# Or list available distributions
PS>wsl --list --online

Verify Installation

Once installation is complete, verify that WSL is working correctly:

PowerShell
PS>wsl --list --verbose
NAME STATE VERSION
* Ubuntu Running 2

You can also test by running a Linux command:

Ubuntu
user@PC:~$ uname -a
Linux PC 5.15.90.1-microsoft-standard-WSL2 #1 SMP x86_64 GNU/Linux