Skip to content

Install

Most recent versions of Windows will come with wsl pre-installed. Run the wsl --version command to check if you already have WSL.

If you see a version when you run wsl --version, you can simply run wsl --install to install an Ubuntu image. If you want to use a different version of Linux, you can run wsl --install <distro-name>.

For example, to install Debian:

wsl --install debian

Run with no distribution name to install Ubuntu

wsl --install

To change the default distribution that executes when you run wsl with no -d <distribution-name>, use --setdefault

wsl --setdefault <distribution-name>

Install on older versions of Windows

On older versions of Windows, if this command fails, you can install wsl with the following steps:

  • Enable Windows Subsystem for Linux:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
  • Enable virtual machine feature
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
  • Download and install the WSL2 Linux kernel update package

  • Set WSL version 2 as default

wsl --set-default-version 2
  • Install a distribution, i.e. Debian
wsl --install -d Debian
Last updated on