Microsoft has released a new preview version of Windows Subsystem for Linux, namely version 0.67.6, and it contains some great news. Starting with this release, the Windows Subsystem for Linux now supports systemd.
Systemd is probably best described by the official website, which describes it as “a suite of basic building blocks for a Linux system”, and it runs under process ID (PID) 1, which which means it’s the first process to start with the system, and it helps the rest of the components to start. Some Linux distributions, such as Ubuntu and Debian, ship with systemd by default, which means some Linux applications depend on it. With this update, the Windows Subsystem for Linux now also supports them.
Some examples of applications that rely on systemd support include snap, which is a package manager used to install and manage software in Ubuntu. With this you can use commands like snap install
to install an application easily. There are also microk8s, which allow you to quickly run Kubernetes on a local machine.
Microsoft says it had to make changes to the Windows Subsystem for Linux architecture, with adjustments to the WSL initialization process (which was previously run as PID 1) to account for this inclusion. There were some challenges in allowing the Linux system to continue to communicate with Windows components, as well as maintaining compatibility with Linux GUI applications. One thing to note is that systemd will not keep your Linux instance alive any differently than the previous WSL implementation. Unless you have a background task running, closing the Linux console will end your session.
If you want systemd support in the Windows Subsystem for Linux, you will need to download the latest WSL preview from the Microsoft Store, which you can do using the link below. This update does not ship directly to the WSL build built into Windows 11, and it may not ship for some time.
Source: Microsoft