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

21,225

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.)

Share:
21,225

Related videos on Youtube

joebuntu
Author by

joebuntu

Updated on September 17, 2022

Comments

  • joebuntu
    joebuntu over 1 year

    I've been tinkering with fingerprint-gui as well as X/xrandr resolution settings.

    When I start my machine, it boots up normally. As soon as X and gnome have finished starting, it logs me off automatically and brings me back to the gdm login prompt with the user list. Then I am, however, able to log in using "Ubuntu Desktop Fail-safe".

    I've checked the list of start-up applications, but everything seems fine there.

    I can't yet put my finger on what exactly might be responsible for this: X, gnome or some messed up pam.d settings. So far I've checked /var/logs/X11/xorg.0.log, /var/logs/auth.log and ~/.xsession-errors. In addition, I don't quite seem to understand the "interplay" between X, GDM, GNOME, GNOME-policykit, PAM.d and all that.

    Are there any other relevant log files that could point me to what's broken?

    Specs:

    • Ubuntu 10.10 Maverick Meerkat
    • IBM/Lenovo Thinkpad R60, ATI Radeon x1400 Mobility
    • all updates installed
    • Linux User 1 year+,
    • Murhaf Sousli
      Murhaf Sousli almost 7 years
      How did you solve your problem?
  • halirutan
    halirutan over 9 years
    Awesome. If I had as much rep as I have on other SE sites, you would get instantly a bounty on this answer! I just spend several hours; re-installing all gnome packages, reconfiguring everything to default, removing caches and settings, playing around with lightdm, and so on and so on and so on... I was banging my head why a guest-sessions worked and I couldn't log in properly. Thank you, thank you, thank you! And of course +1