Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!.

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

9
  • 8
    The systemctl command won't work on WSL without some serious hacking. Not recommended. Commented Dec 6, 2021 at 0:49
  • Why would you want to use systemctl on Windows 11? You should be using Windows commands. What are you trying to achieve? Commented Dec 6, 2021 at 1:04
  • 5
    @WinEunuuchs2Unix The OP is running Ubuntu in WSL2. The question is not about running systemctl in Windows but in Ubuntu. That said user535733 is absolutely right. Commented Dec 6, 2021 at 1:06
  • 6
    Try using the service command instead. Commented Dec 6, 2021 at 1:26
  • 3
    Specifically, sudo service ssh restart. But be aware that ssh doesn't quite work as you might expect under WSL2 either. Commented Dec 6, 2021 at 1:52