How To Install WSL2 on Windows 10/11

This guide covers how to install WSL2 on Windows 10 and Windows 11. There are two methods: the one-command install that works on Windows 10 build 20H1 and newer, and the manual method for older builds. Both are covered with exact commands, what you should see when each step works, and the specific errors that come up during installation. Last updated March 2026.

Once WSL2 is running you will likely need to move files between Windows and your Linux environment — the WSL file transfer guide covers every method. For backing up your WSL instance before making major changes, see the WSL2 backup guide.


WSL2 System Requirements

Before running any commands, check your Windows build. The one-command install requires build 20H1 (build 19041) or newer. Older builds need the manual method.

# Check your Windows build in PowerShell
Get-ComputerInfo | Select-Object WindowsProductName, WindowsBuildLabEx

Expected output:

WindowsProductName   WindowsBuildLabEx
------------------   -----------------
Windows 11 Pro       22621.1.amd64fre.ni_release.220506-1250

Or just press Win + R, type winver, hit Enter. The popup shows your version and build number. You need:

  • Windows 11 — all versions supported, use the one-command method
  • Windows 10 build 19041 or higher (20H1+) — use the one-command method
  • Windows 10 build 18362–19040 — use the manual method below
  • Windows 10 below build 18362 — WSL2 is not supported, you need to update Windows first

Virtualization must be enabled in BIOS/UEFI. Most modern machines have it enabled by default. If your install fails with a virtualization error, that is the first thing to check — enter BIOS on boot and look for Intel VT-x or AMD-V and make sure it is enabled.


Method 1 — Install WSL2 with One Command (Windows 10 20H1+ and Windows 11)

Open PowerShell as Administrator — right-click the Start button, select Windows PowerShell (Admin) or Terminal (Admin), then run:

wsl --install

Expected output:

Installing: Virtual Machine Platform
Virtual Machine Platform has been installed.
Installing: Windows Subsystem for Linux
Windows Subsystem for Linux has been installed.
Downloading: WSL Kernel
Installing: WSL Kernel
WSL Kernel has been installed.
Downloading: Ubuntu
The requested operation is successful. Changes will not be effective until the system is rebooted.

This command enables the required Windows features, installs the WSL2 kernel, sets WSL2 as the default version, and downloads Ubuntu. Restart your computer after it completes.

To install a different distribution instead of Ubuntu:

# See available distributions
wsl --list --online
NAME                                   FRIENDLY NAME
Ubuntu                                 Ubuntu
Debian                                 Debian GNU/Linux
kali-linux                             Kali Linux Rolling
Ubuntu-20.04                           Ubuntu 20.04 LTS
Ubuntu-22.04                           Ubuntu 22.04 LTS
Ubuntu-24.04                           Ubuntu 24.04 LTS
# Install a specific distribution
wsl --install -d Ubuntu-24.04

Errors during one-command install

Error: 0x80370102 — The virtual machine could not be started

Error code: Wsl/Service/CreateInstance/CreateVm/HCS/0x80370102

Virtualization is disabled in BIOS. Restart, enter BIOS setup (usually Del or F2 on boot), find Virtualization Technology or Intel VT-x or AMD-V, enable it, save and exit.

Error: This application requires the Windows Subsystem for Linux Optional Component

Error: 0x8007019e

The WSL feature did not enable properly. Run this in elevated PowerShell and restart:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Error: wsl –install hangs or shows no output

This usually means PowerShell was not opened as Administrator. Close it and reopen with right-click → Run as Administrator.


Method 2 — Manual WSL2 Install (Windows 10 Builds 18362–19040)

Older Windows 10 builds do not support wsl --install. You need to enable features manually, download the kernel separately, and then install a distribution.

Step 1 — Enable required Windows features

In elevated PowerShell:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Expected output for each command:

Deployment Image Servicing and Management tool
Version: 10.0.19041.844

Image Version: 10.0.19041.844

Enabling feature(s)
[==========================100.0%==========================]
The operation completed successfully.

Restart your computer now. Do not skip this — the features are not active until after the restart.

Step 2 — Download and install the WSL2 kernel update

After restarting, download the WSL2 Linux kernel update package from Microsoft: aka.ms/wsl2kernel

Run the downloaded .msi file as Administrator. It installs silently and takes about 10 seconds. Without this step, any WSL2 distribution you try to launch will fail with:

WslRegisterDistribution failed with error: 0x8007019e
Error: 0x8007019e The Windows Subsystem for Linux has not been enabled.

Step 3 — Set WSL2 as default

wsl --set-default-version 2

Expected output:

For information on key differences with WSL 2 please visit https://aka.ms/wsl2
The operation completed successfully.

If you skip this step and install a distribution from the Microsoft Store, it will install as WSL1. Converting it to WSL2 later takes 5–30 minutes depending on distribution size.

Step 4 — Install a Linux distribution

# Install Ubuntu 22.04
wsl --install -d Ubuntu-22.04

If wsl --install -d is not available on your build, open the Microsoft Store, search for Ubuntu, and install from there. Make sure you set the default version to 2 in Step 3 first.


First Launch and Initial Setup

After installation and restart, launch Ubuntu from the Start menu. The first launch unpacks the distribution and takes 1–3 minutes. You will then be prompted to create a Linux user account:

Installing, this may take a few minutes...
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: yourname
New password:
Retype new password:
passwd: password updated successfully

The password does not show as you type — that is normal Linux behaviour, not a bug. Once setup completes, update the package list:

sudo apt update && sudo apt upgrade -y

Verify you are on WSL2 and not WSL1:

# Run in PowerShell on Windows
wsl -l -v
  NAME      STATE           VERSION
* Ubuntu    Running         2

VERSION 2 confirms WSL2. If it shows VERSION 1, convert it:

wsl --set-version Ubuntu 2

This takes 5–30 minutes and shows a percentage progress. Do not close the PowerShell window during conversion.


Configure WSL2 Memory and CPU Limits

By default WSL2 uses up to 50% of your total system RAM. On a 16GB machine that is 8GB, which is fine for most use cases. If WSL2 is consuming more memory than you want, create a .wslconfig file in your Windows user directory to set limits.

Open Notepad and create a file at C:\Users\YourUsername\.wslconfig with this content:

[wsl2]
memory=4GB
processors=2
swap=2GB

Adjust the values for your system. Leave at least 4GB for Windows itself — setting memory=4GB on a 8GB machine will cause both Windows and WSL2 to compete for the remaining headroom.

Apply the changes:

# In PowerShell
wsl --shutdown
# Wait 10 seconds, then relaunch your distribution

Verify from inside WSL2:

free -h
               total        used        free
Mem:           3.8Gi       312Mi       3.5Gi
Swap:          2.0Gi          0B       2.0Gi

The total memory shown should reflect your .wslconfig limit. For Linux swap behaviour and configuration inside WSL2, see the Linux swap management guide — WSL2 uses its own swap separate from host Linux swap.


Troubleshooting WSL2 Installation

Distribution launches but immediately closes

Usually means the distribution is installed but the initial setup did not complete. Launch it from PowerShell instead of the Start menu to see the error:

wsl -d Ubuntu

If you see:

Error: 0x800701bc WSL 2 requires an update to its kernel component.

Download and install the kernel update from aka.ms/wsl2kernel then try again.

WSL2 has no internet access

# Test from inside WSL2
ping 8.8.8.8

If ping works but DNS does not (you can ping an IP but not a domain name):

sudo rm /etc/resolv.conf
echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf
sudo chattr +i /etc/resolv.conf

The chattr +i makes the file immutable so WSL2 does not overwrite it on next start. If neither ping nor DNS work, Windows Firewall or a VPN is likely blocking WSL2 network traffic. Temporarily disabling the VPN and testing again is the fastest way to confirm.

WSL2 distribution won’t start after Windows update

# In elevated PowerShell
wsl --shutdown
Restart-Service LxssManager
wsl -d Ubuntu

If that does not fix it, check whether the kernel was updated and needs the kernel package reinstalled from aka.ms/wsl2kernel.

Check overall WSL2 status

wsl --status
Default Distribution: Ubuntu
Default Version: 2

Windows Subsystem for Linux was last updated on 14/03/2026
The Windows Subsystem for Linux kernel can be manually updated with 'wsl --update'.

Essential WSL2 Commands

# List installed distributions and their WSL version
wsl -l -v

# Shut down all running distributions
wsl --shutdown

# Launch a specific distribution
wsl -d Ubuntu

# Run a single command inside WSL2 without opening a shell
wsl -d Ubuntu -- ls -la /home

# Export a distribution to a backup file
wsl --export Ubuntu C:\Backups\ubuntu-backup.tar

# Import a distribution from backup
wsl --import Ubuntu-Restored C:\WSL\Restored C:\Backups\ubuntu-backup.tar

# Update the WSL2 kernel
wsl --update

# Unregister (delete) a distribution — permanent, cannot be undone
wsl --unregister Ubuntu

The wsl --unregister command permanently deletes the distribution and all files inside it. Always export a backup first if the distribution has anything you want to keep. The full backup and restore process is covered in the WSL2 backup guide.

🔗 Share This Post

🏷️ Tags

WSL
L

Written by Logic Encoder

Professional crypto analyst and trading expert

← Previous Post
WSL File Transfer: Move Files Between Windows and WSL2 (Ubuntu 2026)
Next Post →
How to Fix Python Errors Due to Missing Dependencies

Leave a Reply

Your email address will not be published. Required fields are marked *