» sudo systemctl daemon-reload
System has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is down
==============================================
Edit*
- Open
/etc/wsl.conf
with any editor:
sudo nano /etc/wsl.conf
- Add the following contents and save them
[boot] systemd=true
- Close the Linux window
- Execute the following command in PowerShell
wsl --shutdown
wsl
- Problem Solving
==============================================
just try:
sudo apt-get update && sudo apt-get install -yqq daemonize dbus-user-session fontconfig
sudo daemonize /usr/bin/unshare --fork --pid --mount-proc /lib/systemd/systemd --system-unit=basic.target
exec sudo nsenter -t $(pidof systemd) -a su - $LOGNAME
snap version
hey all. I have just noticed these commands were for the times
systemd
was not fully part of the WSL. it is now truly an integrated part of WSL2 (WSL version 1 would still need this)Also, Debian distros lack
dbus
and related packages giving extra errors even with perfect installation. in new true WSL2/systemd way, you will needlibpam-systemd
(or check what else related is missing) in that case.We have a long discussion about solving mainly this problem, and in my answers there, I try to summarize solutions whenever possible. microsoft/WSL#8883