The systemd init system has long been used in most Linux distributions. Now PID 1 also feels comfortable in the Microsoft cosmos. The support for systemd in WSL primarily benefits developers who use WSL as a development environment for Linux services, for example in web development. Both companies had already announced the cooperation at the end of last year.
Until now, applications in WSL that require systemd required a number of complex workarounds that are now superfluous. According to Microsoft’s announcement, some conversions were necessary so that the WSL init system in the WSL distributions can act as an interface to Windows, even though it runs as a subordinate process of systemd. Handing off the shutdown to systemd and maintaining compatibility with WSGg, which enables applications with a graphical interface, were other challenges.
Because modifications to the WSL architecture are not without risk, Microsoft is not distributing systemd to existing WSL distributions for the time being. If you want to try systemd already, you have to make sure that WSL version 0.67.6 or newer is installed. So far, the version is only available for participants in the Windows Insider program in the Microsoft Store. Interested parties can also take the shortcut via GitHub. The following entry must then be made in the /etc/wsl.conf file:
After restarting the WSL instance, systemd should be running, which can be checked with the command systemctl list-unit-files –type=service. Oliver Smith, product manager for Ubuntu Desktop, writes in the Ubuntu Blog that these adjustments are not necessary when using Ubuntu Preview. systemd is already on board there by default.
A list of Linux services in Ubuntu Previews (WSL) with systemd.
To home page