sodcalculator

10 Tech How-To

Enable systemd in WSL on Windows 11: Step-by-Step

Guide 10-46816 · Updated · Step by step

This guide shows you how to enable systemd in Windows Subsystem for Linux (WSL) on Windows 11. systemd is the default init system in most Linux distributions, and enabling it lets you run system services, manage daemons, and use tools like systemctl just as you would on a full Linux server or desktop. The process requires a recent version of WSL (at least 0.67.6) and a supported Linux distribution installed. You’ll edit a single configuration file and restart WSL to activate it.

What You’ll Need

  • Windows 11 (any edition) with WSL installed and a Linux distribution (e.g., Ubuntu, Debian, Kali) set up.
  • WSL version 0.67.6 or later. To check, run wsl --version in PowerShell or Command Prompt. If you have an older version, update WSL using wsl --update in an elevated terminal.
  • Administrator access on Windows (to update WSL if needed).
  • Basic familiarity with editing text files in Linux (e.g., using nano or vim).

Step-by-Step

  1. Open your WSL distribution. Launch your installed Linux distribution from the Start menu or by typing wsl in PowerShell or Command Prompt. You’ll be at the Linux command prompt.
  2. Check your current WSL version. Run wsl --version in PowerShell (not inside the Linux shell) to confirm you have 0.67.6 or newer. If the command is not recognized, your WSL is too old—update it first.
  3. Update WSL if necessary. In PowerShell (as Administrator), run wsl --update. This will fetch the latest WSL version from Microsoft. Restart your terminal after the update.
  4. Edit the wsl.conf file. Inside your Linux distribution, open the /etc/wsl.conf file with a text editor. If the file doesn’t exist, create it. For example, using nano: sudo nano /etc/wsl.conf.
  5. Add the systemd configuration. In the file, add the following lines under the [boot] section (create the section if it’s not there):
    [boot]
    systemd=true

    Save the file (in nano: Ctrl+O, then Enter, then Ctrl+X to exit).
  6. Restart WSL. Exit your Linux distribution by typing exit. Then, in PowerShell, run wsl --shutdown. This stops all WSL instances.
  7. Restart your Linux distribution. Launch your distribution again from the Start menu or by typing wsl in PowerShell. Wait a few seconds for it to start.
  8. Verify systemd is running. Inside the Linux shell, run systemctl is-system-running. If you see running or degraded, systemd is active. You can also check with ps -p 1—the output should show systemd as the process with PID 1.

Common Mistakes

  • Editing the wrong file. Some guides mention .wslconfig (a Windows file) for global settings, but systemd is enabled in /etc/wsl.conf (inside the Linux distribution).
  • Using a too-old WSL version. If wsl --version fails or shows a version below 0.67.6, systemd will not work even if the config is correct.
  • Forgetting to restart WSL completely. Simply exiting and reopening the terminal does not reload the configuration. You must run wsl --shutdown in Windows.
  • Syntax errors in wsl.conf. The file must be plain text with no BOM. Make sure the [boot] section header is exactly that, and systemd=true is on its own line.
  • Running commands inside the Linux shell that are not available. wsl --shutdown is a Windows command—run it in PowerShell or Command Prompt, not inside the Linux terminal.

Tips

  • If you have multiple distributions, you must enable systemd in each one individually—the /etc/wsl.conf file is per-distribution.
  • After enabling systemd, some older WSL workflows (like using service commands) may behave differently. Use systemctl instead for managing services.
  • If you ever want to disable systemd, simply set systemd=false in /etc/wsl.conf and restart WSL.
  • You can check the status of all services with systemctl list-units to see what’s running.
  • For debugging, use journalctl -xe to view system logs if a service fails to start.

Troubleshooting

If systemd doesn’t start after following the steps, try these fixes:

  • Confirm your WSL version. Run wsl --version again. If it’s still old, run wsl --update and ensure you’re using an elevated PowerShell (Run as Administrator).
  • Check the wsl.conf file. View it with cat /etc/wsl.conf to ensure the lines are correct. A common issue is a trailing space after systemd=true—remove any extra spaces.
  • Restart WSL completely. Sometimes a single wsl --shutdown isn’t enough; you can also restart the LxssManager service in Windows. Open PowerShell as Administrator and run: net stop LxssManager then net start LxssManager. Then start your distribution again.
  • Check for errors during boot. Run systemctl status to see if any units failed. Use journalctl -b to review the boot log for messages about systemd failing to start.
  • Ensure your distribution is supported. systemd requires a distribution that actually uses systemd as its init system. Most mainstream ones (Ubuntu, Debian, Fedora, openSUSE) do, but some minimal or custom distros might not.
  • Try a clean restart. If nothing else works, unregister and re-register your distribution (this will delete the Linux filesystem, so back up important data). In PowerShell: wsl --unregister <DistroName> then reinstall from the Microsoft Store.

Frequently Asked Questions

Why do I need systemd in WSL?

Many Linux tools and services (like Docker, PostgreSQL, or custom daemons) rely on systemd to manage processes. Enabling it makes WSL behave more like a traditional Linux environment, so you can use systemctl commands and have services start automatically.

Will enabling systemd slow down WSL?

There is a slight overhead because systemd starts more background processes, but on modern hardware the impact is minimal. Most users don’t notice any slowdown.

Can I enable systemd on Windows 10?

Yes, systemd is supported in WSL on Windows 10 as long as you have WSL version 0.67.6 or later. The steps are identical to Windows 11.

Does enabling systemd affect my WSL performance or startup time?

Startup might take a second or two longer because systemd initializes more services. However, this is usually negligible, and the benefits of having a full init system outweigh the small delay.

What if I don’t want systemd anymore?

Simply edit /etc/wsl.conf and change systemd=true to systemd=false, then run wsl --shutdown and restart your distribution. Your services will no longer auto-start.

How do I check if systemd is actually running?

Run systemctl is-system-running—it should output running or degraded. Alternatively, check the PID of process 1 with ps -p 1; it should show systemd.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →