28

After installing Konquerer and restarting my laptop i got the following error while trying to open, edit or access files as root from within Terminal (which is existencial for me).

root@linuxBox:/home/v2r# gnome-open /home/

(gnome-open:2686): GConf-WARNING **: Client failed to connect to the D-BUS daemon: //bin/dbus-launch terminated abnormally with the following error: No protocol specified Autolaunch error: X11 initialization failed.

GConf Error: No D-BUS daemon running

root@linuxBox:/home/v2r# No protocol specified Could not parse arguments: Cannot open display:

Also it seems, that dbus is not installed properly anymore in /bin/ and /usr/bin/ See screenshot: enter image description here

How would i go about fixing this problem and thank you in advance?!!!


Thank you for your answer SirCharlo! It does not resolve the problem at all. Please note, that it only happens while beeing root!

root@linuxBox:/home/v2r# gnome-open /home/

(gnome-open:5170): GConf-WARNING **: Client failed to connect to the D-BUS daemon: Failed to connect to socket /tmp/dbus-2RdCUjrZ9k: Connection refused GConf Error: No D-BUS daemon running

root@linuxBox:/home/v2r# No protocol specified Could not parse arguments: Cannot open display:

v2r
  • 9,707

8 Answers8

32

I had this same problem. In my system the problem is caused for ~/.dbus being owned by root. Changing ownership me solved the problem for me. I suggest you to check this on your system too.

Changing the ownership can be done with the chown command. For a single file:

chown <user>:<group> file

For a directory and its children:

chown -R <user>:<group> folder

So, in this case,

chown -R <your user>:<your group> ~/.dbus 

should work.

scoopc
  • 321
12

Try export $(dbus-launch)
This worked for me on Opensuse 12.1 while running it as a VM.

David Foerster
  • 36,890
  • 56
  • 97
  • 151
Aakash
  • 221
4

I also had a problem with dbus and vnc. So I added

eval `dbus-launch`

to ~/.vnx/xstartup. It starts gnome session for me!

Eliah Kagan
  • 119,640
3

I had this issue on my Ubuntu machine. Installing dbus-x11 resolved the issue:

sudo apt install dbus-x11

Eissa N.
  • 140
3

Could you try this?

sessionfile=`find "${HOME}/.dbus/session-bus/" -type f`
export `grep "DBUS_SESSION_BUS_ADDRESS" "${sessionfile}" | sed '/^#/d'`

And retry your command..

gnome-open /home/
SirCharlo
  • 40,096
2

SirCharlo's answer worked for me. Same problem on ubuntu 12.04 (precise pangolin). Yeah, I use su (root) also. Shame, shame. Same problem starting emacs too.

The problem seems to be that DBUS_SESSION_BUS_ADDRESS retains its value when you su instead of picking up the value in /root/.dbus/session-bus/

from man dbus-launch:

   ...
   The second common reason for autolaunch is an su to another  user,  and
   display  of  X  applications  running as the second user on the display
   belonging to the first user. Perhaps the ideal fix in this  case  would
   be  to allow the second user to connect to the session bus of the first
   user, just as they can connect to the first user's display.  However, a
   mechanism for that has not been coded.
   ...

Use sudo, suedit, gksu.

Or if you MUST use su, then try adding this to your /root/.bashrc:

sessionfile=`find "${HOME}/.dbus/session-bus/" -maxdepth 1 -type f`
if [ -f "$sessionfile" ] ; then
    if grep -q "^DBUS_SESSION_BUS_ADDRESS=" "${sessionfile}" ; then
        export `grep "^DBUS_SESSION_BUS_ADDRESS=" "${sessionfile}"`
    else
        echo "DBUS_SESSION_BUS_ADDRESS not found in ${sessionfile}"
    fi
else
    echo "no session address file found in ${HOME}/.dbus/session-bus"
fi
2

Removed /var/lib/dbus/machine-id and all was better

The above fix also fixes:

(virt-manager:2810): GConf-WARNING **: Client failed to connect to the D-BUS daemon: 
Failed to connect to socket /tmp/dbus-vYNPgtHXG7: Connection refused (virt-manager:388): No D-BUS daemon running
v2r
  • 9,707
joe
  • 21
2

I could run virt-manager with the command root@localhost# dbus-launch virt-manager using su