My Ubuntu is stuck in a login loop when trying to enter my desktop. When I login, the screen gets black and soon after that the login screen comes back.
I've read that the problem might be caused by an error depending on the graphics, here's my graphics card: ATI Radeon 7670M
Did you end up here after running
sudo startx
? Nevertheless:Press Ctrl+Alt+F3 and login into the shell.
Now run
ls -lA
. If you see the linethen you need to do
chown username:username .Xauthority
and try logging in (you may also need to do the same for for.ICEauthority
).Else, do
ls -ld /tmp
. Check for the first 10 letters in the left: they should read exactly so:drwxrwxrwt
.Else, you need to do
sudo chmod a+wt /tmp
and check again.If not both, I'd recommend you either
sudo dpkg-reconfigure lightdm
Now press Alt+→ until you reach the login screen again, and restart.
I had this and after looking at
/var/log/Xorg.0.log
I found out that it's a Nvidia problem (there was a line sayingXlib: extension "GLX" missing on display ":0
).I realized I have Nvidia drivers from official website which are not really stable and tested (so I've read and also experienced in the past).
The solution here was to install package
nvidia-current
from Ubuntu repos; it is an awfully outdated version, but it's tested properly at least. Its installer is quite capable too and it uninstalled successfully my hack-installed unstable version from Nvidia website.TL;DR, just try logging into the shell (Ctrl+Alt+F2 or whatever F between F1 and F6) and type
If it succeeds, reboot.
If you're lucky enough, problem solved, you should be able to login to Unity.
UPDATE
Please note that sometimes
nvidia-current
might install the wrong driver. In that case, search the latest compatible driver for your video card and install it. For example, on Ubuntu 16.04,nvidia-current
points to the version: 304.131-0ubuntu3. This might be incompatible with your graphics card; therefore, search withsudo apt-cache search nvidia-[0-9]+$
for the package you need, and install it.I encountered this exact problem and none of the suggested fixes above worked for me. After almost giving up I looked at the
.xsession-errors
and noticed I had a typo in my.profile
(I had an extra}
in the file after I edited it earlier in the day).That was causing the login loop. It might be another place to look if the other suggested fixes don't work for you.
I had a nearly identical problem a few months ago. Switching into a console from the LightDM login screen (Ctrl-Alt-F1), logging in with administrative username and password, and entering the following commands resolved the issue:
My home folder was full :-(
df -h
will give you this answer I had to connect through ssh made some space and worked like a flowerctrl+alt+F1, login as user, free up some space and restart your X server! mostely
sudo service sddm restart
Press Ctrl+ALT+F3. You should be given an unix-style login prompt, so enter your username and password there. From there you should be given a shell (a program that allows you to enter commands, sort of like windows'
cmd.exe
). Enter these commands and press ENTER (or Return) after writing each one (you will have to enter your password when it shows something like[sudo] password for USERNAME
. Note that the password will not show when you are typing it!):Then reboot your computer using this command:
See if this works :)
If this does not work, try going back to the 3rd terminal (Ctrl+ALT+F3), login, and enter this command (pressing ENTER after you have typed it):
This will show a DOS-like dialog after a bit. If
lxdm
is not selected, select it by using the UP and DOWN arrow keys, and press ENTER to accept that selection. Then reboot using the same command as before (sudo reboot
).If this still doesn't work, go back to the 3rd terminal (ALT+F3), login, and enter this command (same procedure):
This will install a much lighter desktop environment which should work for now (should enable you to login and use your computer). Once that is done, reboot (
sudo reboot
), and when you are confronted with the login page, select theLubuntu
environment instead ofUbuntu
.Faced the same problem today.
The cause was a bit strange to me.
xubuntu-desktop
was removed, so wasubuntu-desktop
. LightDM exited with no error message. Tried lxdm and when I tried to login, it popped up a message saying Xubuntu could not be found.Reinstalled
xubuntu-desktop
and it's fixed now. Thinkapt-get autoremove
removed the package.You might be having problems with LightDM, the login manager that comes in Ubuntu by default. In 12.04 it used to do the same problem you are describing.
You can install GDM, an alternative login manager, to get around this:
At the login screen, press and hold Ctrl+Alt+F2 to go to the terminal. Don't be afraid! Just log in here with your username and password.
Then, type
sudo apt-get install gdm
. Let it install and typesudo dpkg-reconfigure gdm
and follow the prompts to set it as your login manager.Press Ctrl+Alt+F7 to get back to the login screen which should now look different. Does logging in work? If it does, your problem is solved!
If it doesn't, go back to the fullscreen terminal (again, Ctrl+Alt+F2) and run
sudo dpkg-reconfigure lightdm
to set LightDM as you login manager again. Now you know that this is a problem with your graphics drivers for sure.This is not a direct answer to your case but its more of a general solution to login loops.
The problem could be as simple as a wrong command put into the .profile file in the home directory. (Since that file get loaded on logon)
To see if that is really the case, press Ctrl Alt F1, and login. Checking the .xsession-errors file in your home directory
This should give some clues about some problematic command.
Your desktop environment is failing to start (it sounds like). I would start by tring to log in as a different user.
Ctrl+Alt+F1 then login
sudo adduser testing
Once the user has been added ctrl+alt+f7 and try to log in as testing. If you can log in as testing then your unity/gnome configuration is borked and should be reset. This Question covers it. I prefer to
mv ~/.config ~/.config.old
.