Windows 11 WSL systemd

Now WSL on Windows 11 supports systemd

Now, the Windows Subsystem for Linux feature supports systemd thanks to work done by Microsoft and Canonical, the maker of the Ubuntu distribution. This opens the door to installing additional packages!

As a reminder, Windows Subsystem for Linux dit “WSL” is a feature available since Windows 10 that allows using Linux from Windows without creating virtual machines (although version 2 relies on components of Hyper-V).

As for systemd, it is an essential component found on many Linux distributions. It is used in particular to manage the start of services when the system is launched: very useful for automatically running services/daemons.

Systemd itself is launched when Linux starts, then it manages the launching of the processes corresponding to the services to be started automatically. This requires a little review of the operation within WSL. In L’official announcementCraig Loewen of Microsoft, specifies “Since the WSL init process is responsible for providing the communication infrastructure between Linux and Windows components, changing this hierarchy required rethinking some of the assumptions made with the WSL init process.” – In effect, the WSL init process will become a child process of systemd because the latter requires having the process with PID 1.

Along with systemd support, this allows installation of packages that require this component like systemctl, microk8s (Kubernetes) and Snap.

How to enable systemd in WSL?

This is where I will disappoint some: for the moment, this feature is available in the latest build of Windows 11 accessible through the Windows Insider program. In other words, it is not yet available on a stable version of Windows.

If you are using a preview version of Windows 11, you can update WSL to WSL 0.67.6 preview or higher with these two commands. The first being for the update, and the second to check the installed version.

wsl --update
wsl --version

Then, to activate systemd within the WSL distribution of your choice, you need to modify the “/etc/wsl.conf” configuration file of the distribution to add this:

[boot]
systemd=true

This manipulation will have to be done on each distribution where you want to activate systemd.



Source

Logiciel – OS,Linux,Windows,Windows 11,WSL,

#WSL #Windows #supports #systemd

Leave a Comment

Your email address will not be published. Required fields are marked *