My computer running Ubuntu 18.04 is stuck in a login loop. I am using lightdm as my display manager, but trying to switch to gdm3 didn't fix the problem (I was still stuck in a login loop).

I have tried to follow the fixes found here to fix it, but after running ls -la there is no .Xauthority file in my home directory. I think this is related to my login loop problem, but I am not sure how to create a new .Xauthority file?

Update: I switched to gdm3 and can now login with Unity for a few seconds. The desktop loads but after a minute I am in a login loop again.

  • 1
    A new .Xauthority file should be created when you successfully start an X-based desktop session. AFAIK not having one initially is not a problem in itself. I suggest you look for an .xsession-errors file (e.g. tail ~/.xsession-errors) to see if it throws additional light on the real issue. Aug 20 '18 at 17:10
  • 1
    Thanks for the tip, but trying to read the error file yields an error because there is no .xsession-errors folder in the home folder either. Output from tail ~/.xsession-errors is tail: cannot open '/home/fdrc/.xsession-errors' for reading: No such file or directory
    – Kaszt
    Aug 20 '18 at 17:13
  • Is your home directory encrypted by any chance? Aug 20 '18 at 17:23
  • No, it isn't...
    – Kaszt
    Aug 20 '18 at 17:33
  • its too late but maybe of use to some one else. In my 18.04 command xauth returns Using authority file /run/user/1000/gdm/Xauthority
    – Vijay
    Mar 23 '19 at 12:54

Try updating your graphics card driver.

First, see what driver you need:

ubuntu-drivers devices

Then download the recommended driver for your graphics card. For example, if the recommend driver was nvidia-390:

 sudo apt install nvidia-390
  • 1
    #CAUTION# This destroyed my almost-working GUI into a frozen GUI
    – brewmanz
    Feb 9 '20 at 9:24
  • The first cmd returns nothing, should I install the driver anyway?
    – Elia Weiss
    Jun 6 '20 at 8:23
  • I also did apt-get install gdm3 first, this combined with the above advice after worked for me. Jun 27 at 9:07

Method 2 in this article worked for me. I'm using an old Sony Vaio laptop and think it's a graphics problem.

Reinstalling Ubuntu lightdm.

sudo apt-get purge lightdm
sudo apt-get install lightdm
dpkg-reconfigure lightdm

Not the answer you're looking for? Browse other questions tagged or ask your own question.