M$ WSL now supports systemd (and snap/snapcraft !)

M$ WSL now supports systemd (and snap/snapcraft !)

In September 2022, Microsoft announced support for systemd in WSL. This long-awaited upgrade to WSL unlocks a huge number of quality of life features for managing processes and services. This includes snapd support, which enables users to take advantage of all of the tools and apps available on snapcraft.io.

login to wsl ubuntu and sudo and create /etc/wsl.conf

[boot]
systemd=true

logout from wsl ubuntu and reboot wsl ubuntu from a CMD or PowerShell window

C:> wsl --shutdown

you can now relogin to your ubuntu and install snap

# aptitude install snap
# snap install hello-world