Zum Inhalt

WSL2 installation preparation

in this short tutorial, we will ensure all components in the Windows system are set up correctly before we will add a first WSL2 distro to the system.

This tutorial is tested with Windows 11. It also should work with Windows 10, albeit the screenshots will look different.

Work with the Admin Powershell

You should become familiar, to work with a terminal and commands, as they allow you to automate your work. The automation will allow steps to be repeatable, and this is an important aspect in todays IT-landscape.

Administrative work in Windows can be almost fully automated with PowerShell.

For this tutorian, we need to install Windows features. This only work with elevated rights and therefore requires an administrative PowerShell. We will show you how you can do this in Windows 11.

administrative PowerShell

  1. click on Start
  2. search for powershell
  3. click on Run as Administrator

Testing if WSL feature is enabled

Before we actually change the system, we will test, what we have as a base. The information gathered in there setps might be useful if you run into issues later on and need support.

As a first test, we will check the Windows version we are working with.

systeminfo | Select-String "^OS Name","^OS Version"

PowerShell output: Windows version

The second test is, if the required component for WSL is installed

Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

PowerShell output: status of WSL component

The output of your command should look like the one here. It"s important that the state is "Enabled" as highloghted in the screenshot above.

Enable the WSL Feature

To enable the WIndows feature, you execute the command below in the administrative PowerShell terminal

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

to be continued ...