Intro
Installing and managing Ubuntu distributions on Windows using WSL2 1
Install WSL
- Open PowerShell or Windows Command Prompt in administrator mode
wsl --install- Check WSL distros via PowerShell
wsl --list --verboseWindows Subsystem for Linux has no installed distributions.
You can resolve this by installing a distribution with the instructions below:
Use 'wsl.exe --list --online' to list available distributions
and 'wsl.exe --install <Distro>' to install.
- Display the WSL version
wsl --versionWSL version: 2.7.10.0
Kernel version: 6.18.33.2-2
WSLg version: 1.0.73.2
MSRDC version: 1.2.6676
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.22631.7079
- List available distributions:
wsl --list --onlineThe following is a list of valid distributions that can be installed.
Install using 'wsl.exe --install <Distro>'.
NAME FRIENDLY NAME
Ubuntu Ubuntu
Ubuntu-26.04 Ubuntu 26.04 LTS
Ubuntu-24.04 Ubuntu 24.04 LTS
Ubuntu-22.04 Ubuntu 22.04 LTS
...
Install a WSL Distribution
Install Ubuntu 22.04
Install Ubuntu 22.04 LTS
wsl --install -d Ubuntu-22.04Install Ubuntu 24.04
- Install Ubuntu 22.04
wsl --install -d Ubuntu-24.04Verify Installation
- List installed distributions:
wsl --list --verboseNAME FRIENDLY NAME
Ubuntu-24.04 Ubuntu 24.04 LTS
Ubuntu-22.04 Ubuntu 22.04 LTS
- Set the default distribution:
wsl --set-default Ubuntu-24.04- Display the Ubuntu version
lsb_release -aNo LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 24.04.4 LTS
Release: 24.04
Codename: noble
- Display the kernel version
uname -r6.18.33.2-microsoft-standard-WSL2
Tip
Commands beginning with
wslare run from PowerShell or Command Prompt. Commands such aslsb_releaseandunameare run inside Ubuntu.
Useful Commands
- Shut down WSL
wsl --shutdown- Unregister Ubuntu
wsl --unregister Ubuntu-24.04


