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:

8 Answers 8

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.

3
  • 2
    Can you explain how to change the ownership of files for others
    – Mateo
    Oct 18, 2012 at 16:02
  • Thank you for your answer scoopc. I already reinstalled my Ubuntu OS a few month back, so it is to late for me to give your suggestion a go.
    – v2r
    Oct 28, 2012 at 15:47
  • 4
    You sir win the internet. Since 16 other people had the same issue, does anyone have any clue how ~/.dbus/ became owned by root in the first place?
    – thirdender
    Jan 9, 2016 at 7:48
12

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

1
  • works on Mint 18 too (failed to dpkg -i .deb before)
    – vladkras
    Feb 15, 2018 at 13:37
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!

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/
2
  • Many thanks for your reply, but as i wrote before, the problem resolved itself, by making a fresh install of the OS!
    – v2r
    Apr 28, 2013 at 19:21
  • Why not just source $sessionfile?
    – Squidly
    Jun 5, 2016 at 10:35
3

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

sudo apt install dbus-x11

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
1
  • Thank you very much for your answer user68606!! I'll give it another go with your suggestions later on and update my question. (May take 1-2 days/No INet at home right now.)
    – v2r
    Jun 8, 2012 at 18:54
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
2

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .