While the second generation of the Linux subsystem has been on board with Windows 10 since version 20H1, Windows Server users have had to settle for WSL1 until now. After some back and forth, Microsoft has now decided to offer WSL2 for Windows Server 2022. However, Server 2019 will be left out.

WSL2 is based on a new architecture for which Microsoft provides its own Linux kernel. This runs on a lightweight virtual machine. You don't have to create this utility VM yourself, but of course its hardware requirements must still be met. Therefore, you have to activate nested virtualization if you want to run WSL2 in a VM.

In addition, Linux programs can use the native interfaces of the Linux kernel. This allows more applications to run under WSL2 than before, including Docker containers.

Another benefit of the architecture change is that WSL2 can use a native EXT4 file system within the VHDX.

WSL support for Windows Server ^

To date, Windows Server 2004, which appeared in the now-abandoned semiannual channel, was the only version to benefit from WSL2. However, support for this server version has recently expired, so WSL2 is no longer available for any current version of the server OS.

After WSL2 was included in previews for Windows Server 2022, Microsoft decided at the end of 2020 that the final version would only be shipped with WSL1. After feedback from the community, the company changed its stance and announced WSL2 for Server 2022 and all subsequent LTSC versions. However, WSL2 will not be backported to Server 2019.

Installing WSL2 ^

With the June 2022 cumulative update, Microsoft added the option of installing WSL2. Previously, the feature could be added via the optional update KB5014021.

Prior to the June update Microsoft made WSL2 available through KB5014021

Prior to the June update Microsoft made WSL2 available through KB5014021

For installation, you can also use the simplified procedure via wsl.exe on Server 2022. Before you start, you can get an overview of the available Linux distributions with the following command:

wsl -l -o

From the output, copy the name (not the friendly name) of the preferred distro for use in the next command. Subsequently, enter the following call to wsl.exe in a command line with administrative rights:

wsl.exe --install -d <name-of-distribution>

In our example, the distro is Ubuntu-20.04.

Installation of subsystem for Linux 2 using wsl.exe_

Installation of subsystem for Linux 2 using wsl.exe_

The setup routine will now install all WSL2 components and then require a reboot of the computer. After logging in again, the installation finishes with the configuration of the first Linux user and the user's password.

After the reboot the setup configures the installed distribution

After the reboot the setup configures the installed distribution

With the help of

wsl --status

you can verify that WSL uses version 2 by default. WSL1 is still on board, and you can run several Linux distributions side by side, using either WSL1 or WSL2.

Installing WSL on Windows Server 2022 activates version 2 by default after the June update

Installing WSL on Windows Server 2022 activates version 2 by default after the June update

Installing WSL on Windows Server 2022 activates version 2 by default after the June update

Currently, there is still a problem with Windows Terminal. It recognizes the installed distributions but exits when a session is opened; it shows the following error:

The system cannot find the file specified.

[process exited with code 4294967295 (0xffffffff)]

Windows Terminal currently generates an error when invoking the Linux shel

Windows Terminal currently generates an error when invoking the Linux shel

Windows Terminal currently generates an error when invoking the Linux shell

Conclusion ^

After changing course several times, Microsoft finally decided to also support WSL2 in LTSC versions of its server operating system. However, this does not apply to Windows Server 2019, whose users will be stuck with WSL1.

Microsoft also points out WSL2's limited usage scenarios. It is not intended to run productive Linux workloads. For this purpose, the company recommends the use of virtual machines. However, the feature is very popular for developer or lab environments.

avatar
0 Comments

Leave a reply

Your email address will not be published.

*

© 4sysops 2006 - 2022

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account