Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to open connection to system message bus : Failed to connect to socket /var/run/dbus/system_bus_socket

When using WSL2 on Win 10 Professional (build 2004 (20236.1000) in Ubuntu 18.04

I am running into the following error: see below picture. Googling does not lead to an answer to find the root cause and the fix for this problem. Hopefully, someone else has encountered and fixed this problem (again this happens in Ubuntu18.04 in WSL2 Thanks enter image description here

like image 981
gorkys Avatar asked Sep 17 '25 15:09

gorkys


2 Answers

This invoke-rc.d: could not determine current runlevel seems to be a very common issue with WSL: I've too encountered it as I was trying to set up the xfce4-desktop based on this guide.

I've found this related thread on github, maybe you'll find a solution there.

like image 113
furmaa Avatar answered Sep 19 '25 08:09

furmaa


I just had the same issue with Ubuntu 20.04 in WSL just now for me it was just that the dbus folder was simply missing, based on your logs this could be the same issue create the dbus folder with:

sudo mkdir /var/run/dbus

Test dbus with:

sudo dbus-daemon --config-file=/usr/share/dbus-1/system.conf --print-address

rerun your command

like image 32
Toke Lichtenberg Avatar answered Sep 19 '25 06:09

Toke Lichtenberg