How to install WSL in Windows Server 2022

WSL allow you to run applications natively as Linux processes on Windows. According to Microsoft WSL (Windows Subsystem for Linux) is available from Windows Server 2019 v.1709

Microsoft announces that the Windows Server 2022 will support WSL2  after installing the Windows Update of June.  This is excellent news for the DevOps and IT professionals.

However  today I will describe how can install WSL1 to the Windows Server 2022.

So let's start !!

 

How to install WSL

The installation of the WSL is very easy and you can do it with a simple PowerShell command.

Open the Powershell as administrator and run the following command

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

When the installation is finished will be requested to restart the Server.

WSL in Windows Server 2022

 

How to install the WSL Linux Distribution

After restarting the Server open the Powershell as Administrator and run the following command to get a list of Linux Distributions that you can use in WSL.

wsl -l -o

WSL in Windows Server 2022

 

Select the Linux Distribution that you want and type the following command. I selected the Ubuntu-20.04.

wsl --install -d Ubuntu-20.04

WSL in Windows Server 2022

 

Wait a few minutes for the installation to complete. Type a username/password that you want to use.

WSL in Windows Server 2022

 

That's it !!! . Now you have the Ubuntu inside the Windows Server 2022.

WSL in Windows Server 2022

 

Have a nice weekend !!

I invite you to follow me on Twitter  or Facebook. If you have any questions, send email to me at info@askme4tech.com