본문 바로가기
Linux

[WSL] System has not been booted with systemd as init system (PID 1).

by v8rus 2023. 3. 13.

wsl에서 잘 동작하던 docker가 갑자기 동작하지 않는다.

systemctl 명령어로 다시 실행해도, 아니 다른 명령어를 실행해도 도저히 실행되지 않는다.

그저 아래와 같은 반응만 보일 뿐이었다.

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

 

 

그냥 다음과같이 입력해서 실행

$ sudo -b unshare --pid --fork --mount-proc /lib/systemd/systemd --system-unit=basic.target
$ sudo -E nsenter --all -t $(pgrep -xo systemd) runuser -P -l $USER -c "exec $SHELL"

 

이제 잘 동작한다 ㅎㅎ

댓글