Linux – Problems opening Gedit using X11 in new Ubuntu installation

firewalllinuxsudoUbuntux11

I've just installed Ubuntu 11.10 and created a new user (and added them to the sudo group).

When I log in as the new user (not root) and try to open gedit I get the following error:

** (gedit:17414): WARNING **: Could not connect to session bus

I've also used ufw to only allow OpenSSH and port 80 connections (if that is relevant?). I am using Putty and Xming to access the server (with exactly the same X11 setup as I've used successfully with other servers in the past).

I've read elsewhere that this is normal behaviour if you're logged in as root, but I am not…

Any ideas what I'm doing wrong?

Thanks!

Best Answer

Hmmm. Looks like a D-Bus problem.

You are probably missing the dbus-launch --autolaunch process, as described in the following mailing-list entries:

  1. http://lists.fedoraproject.org/pipermail/test/2011-July/101118.html
  2. http://lists.fedoraproject.org/pipermail/test/2011-July/101119.html

In the mailing-list entries, the user had a conflicting dbus machine-id, so the dbus autolaunch process was not starting properly.

Try renaming /var/lib/dbus/machine-id to /var/lib/dbus/machine-id.orig (effectively removing the dbus machine-id, while backing it up), and see if you can get the system to re-generate it (ie: with a reboot or some such).

FYI, if the system doesn't regenerate the dbus machine-id, then you may not be able to load the desktop (graphics) until you've restored the backup id. I'm no dbus or gnome master, so use this tip at your own risk, but it's a pretty good bet that the id will be re-generated.