0

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
  • 17,888
  • Can you add the output of wsl --version to your question (in code-blocks). Thanks! – NotTheDr01ds Nov 16 '22 at 16:46
  • 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 Nov 16 '22 at 19:03
  • 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.

    – José Ramos Nov 16 '22 at 19:06
  • 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. 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! – NotTheDr01ds Nov 16 '22 at 21:55

0 Answers0