Originally published by Mauro Giusti on April 19, 2020
Are you torn between using Linux or Windows? With Windows Subsystem for Linux 2 (WSL2), you can have the best of both worlds! This guide will walk you through setting up Ubuntu on Windows 10 using WSL2, with an update for Windows 11 users.
Windows 11 Update (December 2021)
Setting up WSL2 on newer Windows versions, including Windows 11, is now much simpler. Just follow these steps:
- Open PowerShell as Administrator
- Run the command:
wsl --install

This will enable the necessary settings and update the Linux kernel to the latest version.
To see available Linux distributions, use:
wsl --list --online
To install Ubuntu (the default), simply run:
wsl --install Ubuntu
For more details, visit the official Microsoft documentation on installing WSL
Setting Up WSL2 on Windows 10 (Original Guide)
Step 1: Ensure You Have the Right Windows 10 Version
You’ll need at least Windows 10 May 2020 Update (version 2004) to install WSL2.

To check your version:
- Press Windows+R
- Type
winver.exe
and run it
If you have an older version, update Windows 10 to the latest version.
Step 2: Install WSL2
- Open PowerShell as administrator
- Run the following commands:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

- Reboot your PC
- Download and install the WSL2 Linux kernel update from https://aka.ms/wsl2kernel

- Set WSL2 as the default:
wsl --set-default-version 2
Step 3: Install Ubuntu on WSL2
- Open the Microsoft Store
- Search for “Linux”
- Choose your preferred Ubuntu version (e.g., Ubuntu 18.04 LTS)
- Click Install

- Once installed, launch Ubuntu from the Start menu
- Set up your username and password
Step 4: Verify WSL2 Installation
Open PowerShell and run:
wsl --list -v

If it shows version 1, upgrade to version 2(replace Ubuntu-18.04 with your ubuntu version):
wsl --set-version Ubuntu-18.04 2
Congratulations! You now have a full Ubuntu distribution running on your Windows PC using WSL2.
