Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save readloud/82ec8e3a8ee7c510a115fe7189ed1179 to your computer and use it in GitHub Desktop.
Save readloud/82ec8e3a8ee7c510a115fe7189ed1179 to your computer and use it in GitHub Desktop.
WSL2 Error - "System has not been booted with systemd as init system (PID 1). Can't operate."

This article demonstrates how to fix 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” when using WSL version 2.

The error message This example is done using WSL 2 with a Linux-based application.

The below error message is displayed:

System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down

How to fix it

To fix, operate the service using /etc/init.d/ instead:

sudo /etc/init.d/<service> <operation>

Where the operation is start, status, stop, restart, etc and service is the service you need to operate.

For example, to start postgresql, this command looks like:

sudo /etc/init.d/postgresql start

Why this error occurs At the time of this article, WSL 2 does not support the systemd command. To work around this, /etc/init.d is used.

Example

The below screen capture displays running into the error when attempting to enable the postgresql service. image

The below screen capture displays a workaround to start postgresql using /etc/init.d instead. image

The below screen capture displays that the service was successfully started via the status operation. image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment