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 debianRun with no distribution name to install Ubuntu
wsl --installTo 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 /norestartDownload and install the WSL2 Linux kernel update package
- WSL2 Linux Kernel Download
- Run the installer after download
Set WSL version 2 as default
wsl --set-default-version 2- Install a distribution, i.e. Debian
wsl --install -d DebianLast updated on