Ubuntu 18.04 stuck in login loop with missing .Xauthority file

26,574

Solution 1

Method 2 in this article worked for me. I am using an old Sony Vaio laptop and think the issue is a graphics problem.

Reinstalling Ubuntu lightdm.

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

Solution 2

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
Share:
26,574

Related videos on Youtube

Kaszt
Author by

Kaszt

Updated on September 18, 2022

Comments

  • Kaszt
    Kaszt over 1 year

    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.

    • steeldriver
      steeldriver over 5 years
      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.
    • Kaszt
      Kaszt over 5 years
      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
    • steeldriver
      steeldriver over 5 years
      Is your home directory encrypted by any chance?
    • Kaszt
      Kaszt over 5 years
      No, it isn't...
    • Vijay
      Vijay about 5 years
      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
  • brewmanz
    brewmanz about 4 years
    #CAUTION# This destroyed my almost-working GUI into a frozen GUI
  • Elia Weiss
    Elia Weiss almost 4 years
    The first cmd returns nothing, should I install the driver anyway?
  • openCivilisation
    openCivilisation almost 3 years
    I also did apt-get install gdm3 first, this combined with the above advice after worked for me.
  • Steven C. Howell
    Steven C. Howell about 2 years
    I'm not certain, but I think simply installing lightdm (second step) included the reconfigure step. During the installation, I was asked to select between gdm and lightdm, which was the same thing that the reconfigure step did (third step).