Microsoft Windows 11/10 Linux subsystem WSL now supports systemd

Microsoft released a new preview version of the Linux subsystem for Windows 11/10, version number 0.67.6, which brings some major features. Microsoft announced that starting with this release, WSL has support for systemd.


systemd is an init system tool, and many popular Linux distributions run systemd by default , such as Ubuntu, Debian, etc., spearheaded by Lennart Poettering. Its development goal is to provide a better framework to represent the dependencies between system services, to achieve parallel startup of services during system initialization while reducing the system overhead of Shell, and finally to replace the commonly used System V and BSD styles. init program.


Some examples of applications that rely on systemd support include snap, a package manager used to install and manage software in Ubuntu. With this, users can easily install apps using commands like snap install. There are also microk8s, which allow users to quickly run Kubernetes on their local machine.

Microsoft says that supporting systemd require changes to the WSL architecture. Since systemd requires PID 1, the WSL init process started in a Linux distribution will be a child of systemd. Because the WSL init process is responsible for providing the infrastructure for communication between Linux and Windows components, changing this hierarchy requires reconsidering some of the assumptions made with the WSL init process.


Also note that after modification, the systemd service will not keep the user's WSL instance alive . Closing the Linux console will terminate the user session unless a background task is running.


The user needs to edit the wsl.conf file to ensure that systemd starts at boot, add the following to /etc/wsl.conf, taking care to use sudo administrator privileges:

[ boot ] 
systemd = true

In July this year that systemd developer Lennart Poettering had left Red Hat to join Microsoft and continued to focus on systemd development. Maybe today's results are what Lennart Poettering has brought on board.

6 views0 comments

Recent Posts

See All