Ubuntu 16.04 login loop with custom NVIDIA driver

I couldn't get away from the login loop

  1. Ubuntu 16.04 with NVIDIA driver 367 installed

  2. Secure Boot disabled (i'm in the legacy mode)

  3. Display manager: lightdm

  4. .xsession-errors:

openConnection: connect: No such file or directory
cannot connect to brltty at :0
upstart: gnome-session (Unity) main process (5813) terminated with status 1
upstart: unity-settings-daemon main process (5806) killed by TERM signal
upstart: Disconnected from notified D-Bus bus
upstart: logrotate main process (5632) killed by TERM signal
upstart: update-notifier-crash (/var/crash/_usr_bin_python2.7.0.crash) main process (5689) killed by TERM signal
upstart: update-notifier-crash (/var/crash/_usr_bin_wget.0.crash) main process (5690) killed by TERM signal
upstart: update-notifier-crash (/var/crash/_usr_lib_gvfs_gvfsd-dnssd.0.crash) main process (5692) killed by TERM signal
upstart: bamfdaemon main process (5713) killed by TERM signal
upstart: hud main process (5804) killed by TERM signal
upstart: indicator-bluetooth main process (5848) killed by TERM signal
upstart: indicator-power main process (5849) killed by TERM signal
upstart: indicator-datetime main process (5852) killed by TERM signal
upstart: indicator-printers main process (5859) killed by TERM signal
upstart: indicator-session main process (5860) killed by TERM signal
upstart: indicator-application main process (5886) killed by TERM signal
upstart: unity7 main process (5843) killed by ABRT signal

None of the approaches in the internet seems to help. It drives me crazy. Need help.


The real reason why this happened for me was this: I had NVIDIA custom driver installed which compiles a kernel module underneath and everything was working fine for a moment.

Since it was a fresh install, Ubuntu decided to download some updates and during the upgrade it updated the kernel, and potentially some other libraries that compiled NVIDIA driver was dependent on and that broke their binary compatibility.

At that point after reboot I got stuck in login loop in lightdm, and was unable to run my X sessions with startx also. It looks like upgrade broke compatibility not only with the NVIDIA HW accelerated rendering module, but also SW module, so Unity/Gnome had nothing to render with at all.

To fix this, I just ran the NVIDIA install script that I downloaded once again, and after a recompile things went back to normal. Hope that helps someone.

P.S. I'd like to point out that in my solution returning back to crappy video card drivers was unnecessary.


I had this issue as well. Resolved by using xorg-nouveau drivers for now. While caught in the loop, try ALT+F1 to enter a shell. If that doesn't work:

  • While booting, hold right-shift.
  • Choose an earlier version of the kernel to boot from GRUB.
  • After boot, uninstall NVIDIA drivers and install xorg-* as required, don't know what you already have and there are many packages you could install. You'll want nouveau, as that will handle display for you.