You can enable systemd
in Linux distributions such as Ubuntu.
When you enable systemd
, services such as SSH and docker will start automatically.
Use a text editor (as root or using sudo
) to create (or modify if it exists) the file /etc/wsl.conf
Add the following lines to /etc/wsl.conf
:
[boot]
systemd=true
Open a Windows Command Prompt or Powershell. Run the following commands to terminate and restart the distribution:
wsl --terminate Ubuntu-22.04
wsl -d Ubuntu-22.04
Confirm systemd
is running:
systemctl list-unit-files --type=service
Individual services can also be queried to confirm they are running:
systemctl status cron