WSL Gets Systemd Support, Here’s How to Enable It

Microsoft has released a new 0.67.6 version of its Windows Subsystem for Linux, which includes long-awaited systemd support.

The Windows Subsystem for Linux (WSL) is a compatibility layer that allows Linux binary executables to be run natively on Windows. It is a Windows feature that allows you to run Linux alongside your regular Windows desktop and programs.

In recent years, WSL has grown in popularity due to its simplicity and flexibility, reducing the need for Windows users to run an entire Linux virtual machine only to test some functionality.

However, due to the lack of some crucial components for any modern Linux system, such as systemd, WSL did not provide a completely functional Linux experience. Fortunately, that piece of the puzzle is finally in place.

Coincidence or not, this game-changing feature comes just over two months after systemd’s creator and a leading developer, Lennart Poettering, left Red Hat to join Microsoft.

Systemd on Windows Subsystem for Linux

Systemd on WSL

The presence of systemd in WSL elevates the system to a whole new level, opening up many possibilities. For example, you can install a LEMP server in your WSL system and rapidly and easily develop web apps.

Moreover, if you use Ubuntu, you may now take advantage of the Snap package manager’s features. This was previously impossible due to the reliance on the availability of systemd.

Furthermore, we can continue by saying that MicroK8s can now be installed to allow you to run your Kubernetes cluster. So, as previously stated, this new functionality expands the possibilities tremendously.

Of course, not all Linux distributions use systemd, but most modern ones, including Debian, Ubuntu, Arch Linux, Fedora, openSUSE, and others, have adopted and relied on it.

So let me now show you how to update the WSL service on your Windows PC with systemd support capability.

How to Add Systemd Support to WSL?

Microsoft’s latest release for Windows Subsystem for Linux version 0.67.6 adds systemd support to WSL. Therefore, to get this functionality, you must first upgrade your WSL version.

An easy way to check your currently used WSL version is by running:

wsl --version
Checking currently used WSL version

Remember, if that command fails, you are using the in-Windows version of WSL and must upgrade to the Store version.

Then, use the command below to update your WSL instance to the most recent version.

wsl --update

WSL may inform you that no new version is available. If this is the case, proceed with the instructions below to manually upgrade the WSL version.

Go to the GitHub project page and navigate to the releases section to download the most recent version. It is currently 0.67.6 (Microsoft.WSL_0.67.6.0_x64_ARM64.msixbundle), which is pre-release.

Download WSL update

After downloading the file, you can proceed with the installation. But first, you must stop the WSL service. Otherwise, the installation will fail.

So, open the service management console, highlight the “Windows Subsystem for Linux Preview” service, and then choose “Stop” from the right-click context menu.

Stopping WSL Service

Finally, open the Windows Power Shell console with administrative privileges (right-click, then “Run as administrator”) and execute:

Add-AppxPackage "C:\Users\bobby\Downloads\Microsoft.WSL_0.67.6.0_x64_ARM64.msixbundle"Code language: CSS (css)

Of course, replace the actual file path with the correct path for your system. After the installation is complete, start the “Windows Subsystem for Linux Preview” service.

Enable Systemd Support in a WSL Distro

So far, so good. Your WSL service now has systemd support. However, it is essential to remember that this does not automatically add one to your Linux instances.

In other words, manually enable it for each Linux distribution individually. Fortunately, this is very easy.

Inside the distribution itself, use your preferred text editor to open the wsl.conf file located in the /etc directory. If the file is not available, simply create a new one.

sudo vim /etc/wsl.conf

Paste in the following content, then save the file and exit.

[boot]
systemd=trueCode language: JavaScript (javascript)

Finally, close your WSL distro window, and in the Power Shell console, type the command below to restart your WSL instances:

wsl --shutdown

That’s all. Your WSL distro should now have systemd support. Start the distro, and run the command below from its shell to test this functionality. The result should look like the one in the screenshot.

Systemd on Windows Subsystems for Linux

We hope we were of help. Any feedback on your WSL experience is welcome in the comments section below.

Bobby Borisov

Bobby Borisov

Bobby, an editor-in-chief at Linuxiac, is a Linux professional with over 20 years of experience. With a strong focus on Linux and open-source software, he has worked as a Senior Linux System Administrator, Software Developer, and DevOps Engineer for small and large multinational companies.

Think You're an Ubuntu Expert? Let's Find Out!

Put your knowledge to the test in our lightning-fast Ubuntu quiz!
Ten questions to challenge yourself to see if you're a Linux legend or just a penguin in the making.

1 / 10

Ubuntu is an ancient African word that means:

2 / 10

Who is the Ubuntu's founder?

3 / 10

What year was the first official Ubuntu release?

4 / 10

What does the Ubuntu logo symbolize?

5 / 10

What package format does Ubuntu use for installing software?

6 / 10

When are Ubuntu's LTS versions released?

7 / 10

What is Unity?

8 / 10

What are Ubuntu versions named after?

9 / 10

What's Ubuntu Core?

10 / 10

Which Ubuntu version is Snap introduced?

The average score is 69%