Microsoft added systemd for more compatible applications

Two large companies, the and Canonical, have collaborated to add systemd to the Windows Subsystem for Linux, allowing the installation of a greater number of compatible applications.

Microsoft: we made a mistake about open source

systemd is a Linux software application that acts as system and services to initialize daemons/services at OS startup. Systemd also supports tools that allow Linux administrators to easily manage and control these services after they are started.

As systemd is responsible for starting all other services, it runs as the first process (PID 1) created by the Linux kernel at startup. All other initial boot services are then started and managed by systemd, as shown by the process tree below from Ubuntu.

pstree ubuntu

On the other side of operating systems, the WSL (Windows Subsystem for Linux) currently uses init as a system and service manager, and thus Linux applications that require systemd, such as Snap, microk8s (Kubernetes), and systemctl, do not work properly.

WSL now supports systemd
Yesterday, Microsoft and Canonical they announced that the latest version of WSL (Windows Subsystem for Linux) in Windows 11 Insider builds now supports systemd, allowing you to install applications that require this service management.

If you are running a Windows 11 Insider build, you can upgrade to WSL preview 0.67.6 or later using the command wsl --update. Once the update is complete, you can check the installed version using the corresponding command wsl --version.

You should then enable systemd by booting the desired WSL Linux distribution and adding the following lines to /etc/wsl.conf:

[boot] systemd=true

As the /etc belongs to root, you need to use sudo for console editor, to edit the file. For example, sudo vi /etc/wsl.conf.

It should be noted that this process must be done for each distribution you want to enable systemd.

Finally, close the WSL window and from the Windows 11 Command Prompt (Command Prompt or PowerShell), close the WSL with the command wsl.exe --shutdown and restart your Linux distribution and you will see systemd running as PID 1.

For more information on how systemd works in WSL and how it will allow you to run more applications in WSL, you can watch this video by Microsoft's Craig Loewen and Canonical's Oliver Smith.

iGuRu.gr The Best Technology Site in Greecefgns

every publication, directly to your inbox

Join the 2.085 registrants.
wsl, windows, linux, subsystem, systemd

Written by Dimitris

Dimitris hates on Mondays .....

Leave a reply

Your email address is not published. Required fields are mentioned with *

Your message will not be published if:
1. Contains insulting, defamatory, racist, offensive or inappropriate comments.
2. Causes harm to minors.
3. It interferes with the privacy and individual and social rights of other users.
4. Advertises products or services or websites.
5. Contains personal information (address, phone, etc.).