How to Fix ‘System Has Not Been Booted with systemd as Init System’ in WSL / Ubuntu

Running system service management commands such as systemctl start docker, systemctl status nginx, or executing modern snap packages in Ubuntu inside Windows Subsystem for Linux (WSL) frequently halts with the error: System has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is down. In traditional WSL1 and legacy WSL2 distributions, Microsoft utilized an internal custom init script as Process ID 1 (PID 1) rather than standard systemd. Consequently, service control daemons expecting standard D-Bus sockets and systemd control interfaces terminate immediately.

Why Does WSL Throw the PID 1 systemd Error?

The error originates from WSL initialization architecture:

  • Default WSL Init Script Architecture: By default in older WSL2 builds, Microsoft launches a lightweight custom init wrapper as PID 1 to facilitate rapid container-like startups and Windows file interoperability.
  • systemd Flag Disabled in wsl.conf: Modern WSL2 (available on Windows 10 version 21H1+ and Windows 11) natively supports full systemd integration, but the feature must be explicitly activated in distribution configuration files.
  • Outdated WSL Kernel Package: Running an older version of the WSL kernel without systemd namespaces support.
  • Running WSL1 Instead of WSL2: Legacy WSL1 uses translation layers rather than a real Linux micro-kernel, completely lacking systemd support.

Step 1: Enable systemd in /etc/wsl.conf

Configure Ubuntu to boot with full systemd daemon support as PID 1.

  1. Open your Ubuntu WSL terminal.
  2. Edit or create the distribution configuration file using nano with root privileges:
    sudo nano /etc/wsl.conf
  3. Add the following block to the file:
    [boot]
    systemd=true
  4. Save the file by pressing Ctrl + O, then press Enter, and exit with Ctrl + X.

Step 2: Update WSL and Perform a Complete Shutdown

Restart the WSL virtual machine container from Windows PowerShell to apply systemd init.

  1. Exit your Ubuntu terminal by typing exit.
  2. Open Windows PowerShell as administrator on your Windows host.
  3. Update your WSL subsystem to the newest release:
    wsl --update
  4. Terminate all running WSL distributions to ensure clean reboot:
    wsl --shutdown
  5. Wait 10 seconds, then reopen your Ubuntu terminal from the Windows Start menu.

Step 3: Verify That systemd Is Running as PID 1

Confirm that systemd is active and operational.

  1. In your Ubuntu terminal, check Process ID 1:
    ps -p 1 -o comm=
  2. The output should clearly return systemd (instead of init).
  3. Test a service status command:
    systemctl status
  4. You can now start, enable, and manage Docker, Apache, Nginx, and background cron jobs seamlessly using native systemctl commands.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.