Microsoft and Canonical add systemd support to WSL

Microsoft announced support for systemd in WSL with the help of Canonical, the company behind Ubuntu. Due to some big changes that needed to be made to WSL, Microsoft is currently providing support so existing distributions of WSL are not affected. After he collects feedback, he will consider how to support systemd by default.

It was important for Microsoft to add systemd support to WSL because most popular Linux distributions use it by default. There are several Linux applications that depend on systemd, including Canonical Snap, microk8s which allows you to run Kubernetes locally, and systemctl which is part of systemd and allows you to interact with services.

Microsoft is rolling out the WSL update to Windows Insiders first, and will roll it out to everyone a couple of weeks later. If you are not an Insider, you can still download the latest version of WSL from GitHub . To enable systemd, you need to install version 0.67.6. Having the latest version of WSL, you need to edit wsl.conf with the following command: sudo nano etc/wsl.conf , in the [boot] section make sure it reads systemd=true , close the nano editor with CTRL+O to save and CTRL+X to exit.

You now need to restart your WSL instances, so run wsl.exe –shutdown from PowerShell. When you start the distribution, you should be able to use systemctl list-unit-files –type=service to check if systemd is working. To learn more about what you can do with systemd in WSL, check out this canonical post , which has some ideas.

Leave a Reply

Your email address will not be published.