Ubuntu 16.04 stuck on login loop

3

2

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

Luca Giorgi

Posted 2016-07-29T14:40:59.883

Reputation: 169

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. – Tristan Vigil – 2016-07-29T14:50:35.193

Looks like something is crashing X when you log in. Are you able to pull up any logs? – bwDraco – 2016-07-29T14:50:38.020

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 – Luca Giorgi – 2016-07-29T14:58:53.483

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. – bwDraco – 2016-07-29T15:22:13.583

Couldn't find any error messages in either log – Luca Giorgi – 2016-07-29T15:52:04.373

Anything of significance when you run dmesg immediately after the crash? – bwDraco – 2016-07-29T16:09:44.497

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 – 2016-07-30T11:23:11.977

1So, 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 – Luca Giorgi – 2016-07-30T12:35:43.603

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

– bwDraco – 2016-07-31T01:19:55.923

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. – Luca Giorgi – 2016-07-31T12:43:27.353

@LucaGiorgi: Be sure to post that as an answer to your own question and accept it so that we know your problem is resolved. – bwDraco – 2016-07-31T18:49:33.717

Answers

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.

Luca Giorgi

Posted 2016-07-29T14:40:59.883

Reputation: 169

1This is bad for Ubuntu that one needs to reinstall it to make it work again. – pbies – 2016-08-02T14:47:40.990

3

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

Andrea Araldo

Posted 2016-07-29T14:40:59.883

Reputation: 171

1Funny thing ... So I tried this... and it did not work :( – Luke Burgess – 2018-03-21T05:56:00.930

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 – KGee – 2019-01-24T12:54:36.937

1

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.

Torpington

Posted 2016-07-29T14:40:59.883

Reputation: 11

1

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 

Abdullah Farweez

Posted 2016-07-29T14:40:59.883

Reputation: 109

1

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

Slayer6

Posted 2016-07-29T14:40:59.883

Reputation: 11

0

use this to install cinammon desktop:

sudo add-apt-repository ppa:embrosyn/cinnamon
sudo apt update 
sudo apt install cinnamon

for gnome desktop:

sudo apt-get install ubuntu-gnome-desktop

for

nyxee

Posted 2016-07-29T14:40:59.883

Reputation: 241

0

I solved this problem on Ubuntu 16.04 by rolling back to previous kernel.

Hold shift key while booting, and booted to 4.10.0-42 and removed 4.13.--

I used the following 2 commands:

$sudo apt-get purge linux-image-4.13.0-26-generic

$sudo apt-get purge linux-headers-4.13.0-26-generic

ericgs

Posted 2016-07-29T14:40:59.883

Reputation: 1