This guide will help you install systemd to run as normal under WSL2 Debian. This will allow services like microk8s, docker, cockpit and many more to just work during a WSL session. Note: this was tested on Windows 10 Build 21H2, running Debian 11 in WSL2.
-
To enable
systemdunder WSL we require a tool calledsystemd-genie -
Download
install-sg.shto a temporary location/tmp:
cd /tmp