Microsoft & Canonical Bring systemd To WSL

Written by Michael Larabel in systemd on 21 September 2022 at 01:43 PM EDT. 61 Comments
SYSTEMD --
Microsoft and Canonical jointly announced today that systemd now works within Windows Subsystem for Linux (WSL2).

WSL can now run systemd inside of WSL Linux distributions for managing of services. Applications dependent upon systemd for use or simply for easy management can now run easier under this WSL environment on Windows 10/11.

Microsoft's announcement explains:
Supporting systemd required changes to the WSL architecture. As systemd requires PID 1, the WSL init process started within the Linux distribution becomes a child process of the systemd. Because the WSL init process is responsible for providing the infrastructure for communication between the Linux and Windows components, changing this hierarchy required rethinking some of the assumptions made with the WSL init process. Additional modifications had to be made to ensure a clean shutdown (as that shutdown is controlled by systemd now) and to have compatibility with WSLg, It is also important to note that with these change, systemd services will NOT keep your WSL instance alive. Your WSL instance will stay alive in the same way it did before, which you can read more about here.

Given that this changes how WSL behaves when booting up, we wanted to be careful about applying this to user’s already existing WSL distros. So currently you need to opt-in to enable systemd for a specific WSL distro, and we will monitor feedback and investigate making this behavior by default in the future.

Over on the Ubuntu blog is also their own post about systemd for WSL and how to enable the support within Ubuntu.


Ubuntu's blog post today shows off systemd running on WSL.


We've known for months there was work to support systemd with WSL2 while now it's nice finally seeing it a reality. For what it's worth this news comes a few months after systemd lead developer Lennart Poettering also joined Microsoft.

Related News
About The Author
Author picture

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week