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.
- click on
Start
- search for
powershell
- 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"
The second test is, if the required component for WSL is installed
Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
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 ...