Ubuntu 16.04 stuck on login loop

47,156

Solution 1

So, after trying to follow many troubleshooting tips found on the net that helped people with a similar problem to mine I couldn't fix my PC. I solved my problem by doing a clean install, maybe it could have worked also with a dual boot install and maybe that way I would have been able to get back some of the files I had, but I'm not entirely sure about this.

Solution 2

None of the solutions I found on the web worked. I managed to use my computer by doing this:

  • CTRL+F1 to log in textual mode
  • Remove ubuntu-desktop and other graphical libraries:

    sudo apt-get purge ubuntu-desktop
    sudo apt-get purge xorg*
    sudo apt-get purge x11*
    
  • Install xubuntu

    sudo apt-get install xubuntu-desktop
    

Then, I rebooted and now I am happily writing to you from my xubuntu

Solution 3

My problem was simple. I had made a change to my /etc/profile that wacked the PATH.
To check and fix: boot up

ctrl-alt F1 to get to a command prompt

sudo su to become root

/usr/bin/vi /etc/profile

check for a problem or remove any change you made

wq to save

sudo reboot

this worked for me

Solution 4

So, I had the same issue which for me occurred after some upgrade and/or dist-upgrade. This has happened a few times before, but this last time it happened I noticed the resolution of the login screen was much lower than it was supposed to be. I figured this was caused by the NVIDIA driver not loading or something of that sort.

What I did was to stop the lightdm service and reinstall the NVIDIA driver and then started the lightdm service again. That fixed the issue for me.

Other times it happened I have resorted to reinstalling Ubuntu.

Anyway, if it happens again in the future, try that. Might work for you as well.

Solution 5

I faced the same issue and solved it.

These are the methods I tried but NOT positive results.

 1.Playing around with .Xauthority file.
 2.Installing/Reinstalling oflightdm
 3.Nividia drivers

First, I did'nt upgrade my OS. I did'nt install any application. Later After careful analysis , found that i ran a shell script with sudo command but the shell script already has a sudo in it.

Eg : if name of the shell script is ChangePermission.sh ( this script helps to change folder access permission )

command to change folder access permission

sudo chown -R $USER: $HOME

WARNING : DO NOT RUN THIS SCRIPT WITHOUT PRIOR KNOWLEDGE !

i ran the above script with sudo in terminal and caught in login loop problem.

   abdullah@Storm:~$ sudo sh ChangePermission.sh 

here, I executing the script with sudo but the script also has another sudo in it.which caused the login issues (for me)

Thus i removed login loop issue by running the same script without sudo and resolved the issue.

  abdullah@Storm:~$ sh ChangePermission.sh 
Share:
47,156

Related videos on Youtube

Luca Giorgi
Author by

Luca Giorgi

Updated on September 18, 2022

Comments

  • Luca Giorgi
    Luca Giorgi over 1 year

    My computer was running fine until yesterday night, but today it is stuck in a login loop.

    I tried going into recovery mode from grub and reconfiguring dpkg packages, but it didn't work, tried switching from lightdm to gdm3 but this just gives me a black screen upon login, then tried reconfiguring lightdm, uninstalling and reinstalling lightdm and all of this did not work, I'm still stuck on login loop. I've tried various methods found by googling, and I also wondered if my nvidia drivers were messing something up (even though that seems strange, since I've been using the computer with those drivers installed for quite some time) so I uninstalled the current nvidia drivers and installed nvidia-current drivers (304 I think), but I'm still stuck.

    What else can I try? I'm starting to think about doing a clean install, but I would prefer fixing the problem rather than having to lose everything and start with a clean slate.

    Thanks for any suggestions!

    EDIT: Couldn't find any error messages in either /var/log/Xorg.0.log nor /var/log/Xorg.0.log.old

    EDIT2: So, after a bit of looking around, I saw that there was some problem with reading .Xauthority, so I just created a backup and a new .Xauthority file and that solved it, but still after a few seconds being logged in I get a black screen and get sent back to the login screen. Looking at the lightdm logs I find a critical error, "session_get_login1_session_id: assertion 'session != NULL' failed". Any idea on how to fix this

    • Tristan Vigil
      Tristan Vigil almost 8 years
      I would suggest looking at the boot output to maybe get an idea of where its hanging up. If its easy for you to reinstall that might be the best option though.
    • bwDraco
      bwDraco almost 8 years
      Looks like something is crashing X when you log in. Are you able to pull up any logs?
    • Luca Giorgi
      Luca Giorgi almost 8 years
      Where would I look for these logs? I thought about pressing F2 during the splash screen, but the hangup is on the login page, not on the OS loading
    • bwDraco
      bwDraco almost 8 years
      Try opening /var/log/Xorg.0.log and /var/log/Xorg.0.log.old (as root if needed). See if there's anything toward the end of the log (especially the old one) that indicates an error of some sort, and edit the relevant information into your question.
    • Luca Giorgi
      Luca Giorgi almost 8 years
      Couldn't find any error messages in either log
    • bwDraco
      bwDraco almost 8 years
      Anything of significance when you run dmesg immediately after the crash?
    • Luca Giorgi
      Luca Giorgi almost 8 years
      Sorry for the late reply, anyway the only strange thing I could find was an "Nvidia taints kernel" message but I'm not even sure that's something to be worried about
    • Luca Giorgi
      Luca Giorgi almost 8 years
      So, after a bit of looking around, I saw that there was some problem with reading .Xauthority, so I just created a backup and a new .Xauthority file and that solved it, but still after a few seconds being logged in I get a black screen and get sent back to the login screen. Looking at the lightdm logs I find a critical error, "session_get_login1_session_id: assertion 'session != NULL' failed". Any idea on how to fix this
    • bwDraco
      bwDraco almost 8 years
      "NVIDIA taints kernel" is not an issue (it simply means your kernel is in an unsupported state due to a proprietary module, namely the graphics driver). The assertion failure is probably a much more serious issue and would likely explain the issues you're having.
    • Luca Giorgi
      Luca Giorgi almost 8 years
      FYI I solved it by doing a clean install, couldn't find a way to solve the problem and everything I've found on the net about that lightdm assertion error didn't work for me. Very strange.
    • bwDraco
      bwDraco almost 8 years
      @LucaGiorgi: Be sure to post that as an answer to your own question and accept it so that we know your problem is resolved.
    • Ufos
      Ufos about 5 years
    • June Wang
      June Wang almost 4 years
      Was yours logging you in then logging you out, so you're stuck at login GUI forever?
  • pbies
    pbies almost 8 years
    This is bad for Ubuntu that one needs to reinstall it to make it work again.
  • Luke Burgess
    Luke Burgess about 6 years
    Funny thing ... So I tried this... and it did not work :(
  • KGee
    KGee over 5 years
    I followed this too and it worked great for xubuntu, but still unable to get ubuntu working. If anyone has any ideas to get back to ubuntu I would be all ears