Skip to content

Systemd is Now Available in WSL

Microsoft's WSL now supports systemd making the experience better for users. Learn more about it here.

systemd wsl

WSL (Windows Subsystem for Linux) has finally received support for Systemd, this comes in a few months after its creator joined Microsoft.

More Linux Developers Joining Microsoft, Systemd Creator Adds to the List
Microsoft always gets the attention for some reason when it comes to open-source and Linux. And, it also comes to the limelight when we talk about Linux developers…why? It seems that Microsoft is hiring a lot of Linux developers for a range of projects. And, a popular name has

And this has been made possible with a partnership between Microsoft and Canonical.

In case you're curious:

systemd is a suite of basic building blocks for a Linux system. It provides a system and service manager that runs as PID 1 and starts the rest of the system.

via systemd.io

It acts as an init system that starts up and keeps user space services in running order.

Let's see how it has been introduced to WSL.

Systemd Enhancing the WSL Experience

The main focus of introducing systemd to WSL is to improve the Linux workflow on Windows machines.

The likes of Debian, Ubuntu, Fedora, and more run systemd by default. So, this integration will now make it even more straightforward for users of those distros to conveniently do more with WSL.

Even though we have systemd-free distros available, it is not meant for everyone. So, the support for systemd on WSL makes sense.

A lot of critical Linux applications also rely on systemd to be functional. For instance, 'snap', 'microk8s' and 'LXD' are dependent on it.

The presence of systemd also makes it possible to use more tools to test and run from within Windows, resulting in a better WSL experience.

Suggested Read 📖

14 Best Systemd-Free Linux Distributions
systemd has been adopted by most major Linux distribution. If you don’t like systemd at all, here are the alternative Linux distros for you.

Here's How It Was Made Possible

The team behind WSL had to make changes to the architecture, they made the WSL init process start within the Linux distro as a child process under systemd.

Doing so enabled the WSL init process to provide the necessary foundation for communication between the Windows and Linux sub-systems, as explained in their official announcement.

They also did additional modifications to ensure a clean system shutdown by preventing systemd from keeping the WSL instance active.

You can also visit their official documentation website for more information.

Get Started With Systemd on WSL

💡
Existing WSL users will have to opt in to enable systemd on their systems, this step was taken to avoid any booting issues that might occur due to the introduction of systemd.

First and foremost, you have to ensure that your system is running WSL: Version 0.67.6 or above.

You can check your WSL version by running the following command

wsl --version

If you are running the older version, you can update it via the Microsoft Store or by running this command.

wsl --update

Furthermore, if you are not a part of Windows Insiders, you can go to the WSL release page and download it to test it out.

For systemd to work on your system, you will have to edit the 'wsl.conf' file to ensure that systemd starts up on boot.

Add the following lines to make WSL run systemd on boot.

[boot]
systemd=true

Finally, restart your WSL instance to see the changes.

Microsoft has taken a big step forward in the development of WSL with the implementation of systemd, this should result in more users being attracted to WSL.

💬 Excited to run WSL with systemd? Or do you prefer systemd-free distros?


More from It's FOSS...

Latest