Gnome/X logs off immediately after login -- which logfiles are relevant?

Solution 1:

For posterity - I'll leave a solution here...

This can happen if you try and run an X server under root privilege while logged in to your account... so you could have typed:

sudo startx

or were messing with xauth as root.

This will create a file in your home directory ~/.Xauthority which is owned by root.

When you try to login the system will try to read this file but will not have permission and log you back out.

The solution is to

  • go out to a terminal Ctrl+Alt+F1
  • log in to your account
  • type: sudo mv ~/.Xauthority ~/old.Xauthority
  • now log out by typing "logout"
  • get back to dm with Ctrl+Atl+F7
  • you should be able to log in now!

If you don't have sudo privilege, you have to get someone who does on your system

Solution 2:

I know this is an ancient question but it just happened to me. It turned out that the last line of my ~/.profile was returning a non-zero exit code. Since the bash 'source' command returns as its exit code the last exit code of the script sourced, I imagine this upset the xsession init.

You may see evidence of this in ~/.xsession-errors (I did), but then you might not if your last profile command returns an error code without printing any output.

So take a look at the bottom of each of your login scripts. Worked for me.

Solution 3:

Without seeing the log files it's difficult to say where the bug comes(use pastebin.ubuntu.com or report a new bug to Launchpad by running ubuntu-bug xorg-server, but try look gdm's logs at /var/log/gdm/ (that folder may not be accessible without root access).

Solution 4:

This happened to me recently. I solved my issue by looking in the lightdm logs (/usr/log/lightdm/*). In my case, it was trying to load a session called gnome-shell when none existed. I copied /usr/share/xsession/gnome.session to /usr/share/xsession/gnome-shell.session and things worked out fine.

(Note, I realize that this probably would not work for the asker, as Ubuntu wasn't using LightDM in 10.10. However, if the question had been asked today, or if someone searches today, this is a likely answer.)