Menü schliessen
Created: September 9th 2022
Last updated: February 27th 2024
Categories: IT Development,  Software & Services
Author: Tim Fürer

Windows 10/ 11: WSL Quick Install Guide

Tags:  Linux,  Windows 10,  windows 11,  wsl
Donation Section: Background
Monero Badge: QR-Code
Monero Badge: Logo Icon Donate with Monero Badge: Logo Text
82uymVXLkvVbB4c4JpTd1tYm1yj1cKPKR2wqmw3XF8YXKTmY7JrTriP4pVwp2EJYBnCFdXhLq4zfFA6ic7VAWCFX5wfQbCC

In this guide, we'll cover enabling WSL, installing WSL 2 (optional), getting a Linux Distribution, and changing the WSL version a Distribution uses.


What are WSL and WSL 2

WSL stands for Windows Subsystem for Linux. It's a convenient solution for running a Linux environment directly on your Windows machine without use of a conventional Virtual Machine or dual-booting.

WSL 2 is an overhaul of WSL that has better performance and more features and runs on an actual Virtual Machine.

For a detailed comparison of the two, see Microsoft's Comparing WSL 1 and WSL 2.


Enabling WSL

To enable WSL, open up PowerShell as an Administrator, and run the following command:

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

If you do not wish to install WSL 2, you can now restart your computer, and then move on to getting a Distribution.


Installing WSL 2

WSL 2 requires the Virtual Machine Platform feature to be enabled. In PowerShell (Administrator), run the following command:

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Restart your computer, then install the Linux kernel update package that corresponds to your processor architecture:

Once the installation is complete, you can optionally set your default WSL version to 2. That way, Linux Distributions installed in the future will automatically use WSL 2. In PowerShell, run the following command:

wsl --set-default-version 2

 


Getting a Distribution


Changing a Distribution's WSL version

In PowerShell, run the following command to view all installed Distributions and their WSL version:

wsl --list --verbose

To change a Distribution's WSL version, run this command (be sure to insert the correct Distribution name and desired WSL version):

wsl --set-version <distribution> <version>

For example, changing Ubuntu 22.04 to use WSL 2 would look like this:

wsl --set-version Ubuntu-22.04 2