I've seen a lot of login loop questions and threads and have tried everything from here -

Ubuntu gets stuck in a login loop

Except installing gdm3, but I cannot get out of the damn login loop. Should I try gdm3? The only reason I didn't yet is because I've been a long time ubuntu user and my default login is customized pretty specifically for work and school.

EDIT: I installed gdm3 and configured for my default login, still stuck in a login loop with the same error message as below.

What's strange is I am able to log into Unity 8 (via the dropdown from the icon in the login gui), although nothing seems to work in there, but the default ubuntu login just loops.

I've checked permissions, everything looks to be set to my username and group, I've moved and removed Xauthority, purged, reconfigured, reinstalled etc. lightdm, and more. I've been at this for a couple hours now and to make things worse my other computer's drive failed early this week so I am now stuck unable to get anything done.

I am able to login via tty (ctrl + alt + Fkeys), so I have been trying solution after solution via CLI for hours. If anyone can help me out here I will forever be in your debt. If there are links to questions or threads I may have not read yet feel free to drop them here, however I am pretty sure I've been through the majority and nothing has worked yet.

I am running on an hp envy currently amd64

Thanks in advance

EDIT: I'm not sure if this helps but I noticed an error in the top right of the screen when trying to login -

vboxclient: virtual box kernel not running. Exiting.

Or something very close to that. I am not running ubuntu on virtual box, it is my only OS so it didn't make sense to me but may provide more info.

Output of lspci -k | grep -EA3 'VGA|3D|Display'

00:02.0 VGA compatible controller: Intel Corporation HD Graphics 520 (rev 07)
Subsystem: Hewlett-Packard Company HD Graphics 520
Kernel driver in use: i915
Kernel modules: i915

(Apologies for any formatting issues, I'm doing this from my phone)

I've checked ~/.xsession-errors again and I see several dbus-update-activation-environment: setting errors in there. This is over my head but does this help?

  • Please edit your question and add output of lspci -k | grep -EA3 'VGA|3D|Display' terminal command.
    – Pilot6
    Aug 24, 2017 at 14:43
  • Thanks for chiming in. I've made the edits above and please forgive formatting, I've been researching and posting from my phone.
    – Wifi
    Aug 24, 2017 at 14:53
  • Any additional info help? I was almost able to install and run gnome but it was throwing errors left and right. It helped a bit because I was able to fix the errors one by one once I saw them. However, after a reboot, it now goes to a black screen with a blinking cursor after login screen
    – Wifi
    Aug 26, 2017 at 0:26
  • This is not a duplicate of the issue linked to in the question. I've tried everything and I'm unable to log in except to gnome, and only at command line by executing startx. This issue is for all users as I tried to create a new user to bypass and it did not help. Sep 23, 2017 at 1:15
  • what's your home directory permissions? Have you checked this one? Who is owner of your home directory? if those were right, try remove mv ~/.gconf ~/.gconf.bak and try again. Sep 29, 2017 at 4:15

7 Answers 7


After typing this answer, I realize you are using 17.04, not 17.10, so this probably won't help you. In any case, I ran into the same problem in 17.10 yesterday after updating (with sudo apt-get update, sudo apt-get upgrade). Like you I tried changing the permissions for .Xauthority (or deleting this file) which did not help. Nor did running dpkg-reconfigure lightdm or dpkg-reconfigure gdm3, or reinstalling gdm3 (17.10 uses gdm3).

In my case, I was able to get around the issue by clicking on the little gear icon to the right of my login name on the login splash screen, and select "Unity" (not gnome or wayland) from the pull-down menu, and THEN enter the password. Again this is probably irrelevant for you but hopefully it helps someone else using 17.10 who browses here.


Had login loop just now after upgrading to 17.10. No GDM/Lightdm purge did help. No config and permissions jugling helped.

What helped is that i purged x11-common, which automatically deleted all desktop software, and then removed/renamed /etc/X11. The symptom was upstart being not found, and it is an old application which is no longer used, so my best option was to have fresh X11 reinstall.

Installing fresh flavour of whatever desktop metapackage will do the trick. I used ubuntu-gnome-desktop but others should work just as well.


I have been through this problem multiple times and it has been a different issue each time. One of the following issues could have caused your problem and you could use the command line interface by using Ctrl+Alt+F1 (Replace F1 with F2,F3.... if your tty1 is occupied) to try the following solutions

NVIDIA drivers missing or broken?

  1. Run nvidia-smi to access the NVIDIA system management interface. The output should be something of this sort.
Mon Sep 17 14:58:26 2018       
| NVIDIA-SMI 390.87                 Driver Version: 390.87                    | 
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC | 
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. | 
|   0  GeForce GT 720      Off  | 00000000:01:00.0 N/A |               N/A    | 
| 19%   35C    P8    N/A /  N/A |    543MiB /   980MiB |     N/A Default      |

| Processes:                                                       GPU Memory | 
|  GPU       PID   Type   Process name                        Usage           | 
|    0                    Not Supported                                       |

If you're not able to access it, there is probably some issue with your graphic drivers.

  1. In that case, you should be able to find out the name of your graphics card using lspci | grep VGA.
  2. You can find out the compatible drivers for your graphics card using the link.
  3. (Try without this stepand maybe then with this step if there was no success). Remove the existing broken drivers using sudo apt-get purge nvidia*.
  4. Install the drivers using

    sudo add-apt-repository ppa:graphics-drivers

    sudo apt-get update

    sudo apt-get install nvidia-390 (Or whatever the compatible driver is for your graphics card)

  5. Try a restart using systemctl reboot -i and hope your login loop is fixed.

Is your HOME your HOME?

  1. Check the owner of your home directory using ls -l /home
  2. If you don not own your home directory, change it using sudo chown $USER:$USER $HOME
  3. Try a restart using systemctl reboot -i and hope your login loop is fixed.

Do you own your .Xauthority?

  1. Check the owner of your home directory using ls -l ~/.Xauthority
  2. If you don't own your .Xauthority, change it using sudo chown $USER:$USER ~/.Xauthority
  3. If you do, move your .Xauthority file using sudo mv ~/.Xauthority ~/.Xauthority.bak
  4. Try a restart using systemctl reboot -i and hope your login loop is fixed.
  5. You might need to do the same thing on .ICEauthority.

Is your /tmp right?

  1. Run ls -ld /tmp and make sure the permissions are exactly drwxrwxrwt. The output should be of this sort

drwxrwxrwt 27 root root 36864 Sep 17 17:15 /tmp

  1. If not, run sudo chmod a+wt /tmp
  2. Try a restart using systemctl reboot -i and hope your login loop is fixed.

Maybe lightdm is your problem?

  1. Reconfigure your display manager using dpkg-reconfigure lightdm and try out other display managers (gdm3,lightdm,) that are available. Maybe this will you give you enough clues to move forward.
  2. If none of them help,try installing sddm using sudo apt-get install sddm for one final try. reconfigure display to sddm.

If none of the above solutions worked, you can try re-installing ubuntu.

P.S: Answers from this post have been very helpful in writing this solution

  1. reboot
  2. attempt login
  3. ctrl-alt-F2 to get console
  4. login
  5. Examine ~/.xsession-errors

    $ cat .xsession-errors
    A dependency job for ubuntu-session.target failed. See 'journalctl -xe' for details.enter code here
  6. Execute journalctl command

    $ journalctl -xe
    ...libprotobuf.so.10 is missing...
  7. You'll see same error executing ccsm (compizconfig-settings-manager), use it to test

    $ ccsm
    ...libprotobuf.so.10 is missing...
  8. Repair

    $ sudo apt purge libprotobuf-dev protobuf-compiler libprotoc10 libprotobuf10 -y
    $ sudo apt install libprotobuf-dev protobuf-compiler libprotoc10 libprotobuf10 -y
  9. executing ccsm shows a different error, but no mention of libprotobuf.so.10. Success!

  10. reboot
  11. login normally (make sure ubuntu option selected)

There is a chance your specific error is different, go up to step 6 and scour for clues to your specific issue.


I ran into the same problem when I have added export $PATH="~/bin" as last line in ~/.bash_profile.

I solved it by removing the line after entering into tty2 command line using "ctrl + alt + F3" and all commands like "ls, cd, nano" where available as "/bin/ls, /bin/cd, /bin/nano".

Using command "/bin/nano ~/.bash_profile" I changed the file content and now it's working normally.


This happened again with 17.10 and after trying out various stuff I knew and told in the internet, it turned out to be xorg.conf issue. I replaced the /etc/X11/xorg.conf with an earlier /etc/X11/xorg*dist-upgrade*.conf version and it worked. I use Nvidia driver. So, I had to reinstall it. After that, I got my Unity on 17.10 back! Yes, I am still using Unity as opposed to Gnome-* on 17.10 for reasons I mentioned in my other answer.

Earlier, I had tried reinstalling lightdm, unity, unity-greeter, unity-session, removed gdm3, kodi, ubuntu-session, other nvidia driver versions, looking into .xsession-errors, /var/log/syslog, umpteen number of restarts selecting multiple kernel versions and what not. It took more than a day to fix this notorious and infamous login loop issue.


I found the issue to be installing a repo after updating but before restarting after the initial installation. I had installed Kodi at that time. Removing Kodi solved my problem.

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