Score:0

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

la flag

I have Windows 11 with Ubuntu installed with WSL2. I'm not able to configure Systemd in order to use snap installations.

I have configured the file /etc/wsl.conf configured with the following entries (According to this page):

[boot]
systemd=true

But it doesn't work for me.

I can execute systemctl list-unit-files --type=service and list the services, but when I try to start, stop or see the status of a service there is 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

uname -a lists the following:

Linux XXXXXXXXXXXX 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

lsb_release -a lists the following:

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.1 LTS
Release:        22.04
Codename:       jammy

I have also tried to configure according to this page but my installation always gets broken.

Can someone help me?

NotTheDr01ds avatar
vn flag
Can you add the output of `wsl --version` to your question (in code-blocks). Thanks!
José Ramos avatar
la flag
I have already found the issue. Eventhough It was WSL2, was a latter version. I find out that the version that comes with Windows 11 is outdated, and doesn´t update when we run the Windows updates. Also find out that the latest version is the one in Windows Store. I have installed that one and now SYSTEMD works very well, and also could install the the snap packages...
José Ramos avatar
la flag
The version now is the following: `wsl --version Versión de WSL: 1.0.0.0 Versión de kernel: 5.15.74.2 Versión de WSLg: 1.0.47 Versión de MSRDC: 1.2.3575 Versión de Direct3D: 1.606.4 Versión DXCore: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Versión de Windows: 10.0.22000.1219 ` I hope this could help others to have Ubuntu in WSL2 and SYSTEMD working.
NotTheDr01ds avatar
vn flag
Good to hear -- Yes, that's what I was assuming your issue was. Marking this as a duplicate of [System has not been booted with systemd as init system (PID 1). Can't operate](https://askubuntu.com/questions/1379425/system-has-not-been-booted-with-systemd-as-init-system-pid-1-cant-operate). I do cover in one of my answers there that you have to install the latest WSL version for Systemd to work ;-). When you see this, if you could mark this as "That solved my problem" in the header so that this gets closed out. Thanks!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.