Login loop on 16.04 and no access to console
Solution 1
Here is what has worked for me for now:
-
Uninstall Bumblebee, libcuda and nvidia drivers from console. PS: I don't remember how did I find a way to activate the console, but I did a few times of restarts.
sudo apt-get purge bumblebee* libcuda* nvidia*
Here I did a restart. It should be ok to login.
-
Reinstall nvidia 361.
sudo apt-get update sudo apt autoremove sudo apt-get install nvidia-361
-
Delete ibus folder under
~/.config
directory. (I am not sure if this is necessary, but you can rename it if you don't feel it's safe. I will reinstall it later.)cd ~/.config rm -rf ./ibus
-
Restart once or twice with the external monitor plugged in until you see the login screen on the external screen. To verify it, use
lspci | grep VGA
I got
00:02.0 VGA compatible controller: Intel Corporation Skylake Integrated Graphics (rev 06) 01:00.0 VGA compatible controller: NVIDIA Corporation GM107GLM [Quadro M1000M] (rev a2)
Although I still got an error from the syslog when I run nvidia-settings:
May 2 18:21:21 qxd-QC5-Ubuntu colord[1045]: (colord:1045): Cd-WARNING **: failed to get session [pid 3328]: No such device or address May 2 18:21:21 qxd-QC5-Ubuntu colord[1045]: (colord:1045): Cd-WARNING **: failed to get session [pid 3328]: No such device or address May 2 18:21:24 qxd-QC5-Ubuntu nvidia-settings.desktop[3335]: ** Message: PRIME: No offloading required. Abort May 2 18:21:24 qxd-QC5-Ubuntu nvidia-settings.desktop[3335]: ** Message: PRIME: is it supported? no May 2 18:21:24 qxd-QC5-Ubuntu nvidia-settings.desktop[3335]: ERROR: nvidia-settings could not find the registry key file. This file May 2 18:21:24 qxd-QC5-Ubuntu nvidia-settings.desktop[3335]: should have been installed along with this driver at May 2 18:21:24 qxd-QC5-Ubuntu nvidia-settings.desktop[3335]: /usr/share/nvidia/nvidia-application-profiles-key-documentation. The May 2 18:21:24 qxd-QC5-Ubuntu nvidia-settings.desktop[3335]: application profiles will continue to work, but values cannot be May 2 18:21:24 qxd-QC5-Ubuntu nvidia-settings.desktop[3335]: prepopulated or validated, and will not be listed in the help text. May 2 18:21:24 qxd-QC5-Ubuntu nvidia-settings.desktop[3335]: Please see the README for possible values and descriptions.
And there is no
xorg.conf
file under/etc/X11
directory, which might have been renamed toxorg.conf.failsafe
. I also don't have any file under/usr/share/nvidia/
directory, which should have configuration file for nvidia driver. I would consider it works for now. -
Optional: if you want the ibus back, try
sudo apt-get install --reinstall ibus
Again, not sure if this helps. But I did it and only after removing ibus folder, it finally works. I don't know why though.
Problem remaining: there is a shadow after the cursor movement, which is annoying. Also, I am working on install Bumblebee for better GPU management on external monitors.
The most important problem left is the second monitor screen will flicker after sleep or ask for relogin from screen turned off. I consider this as a separate question to pursue now.
Solution 2
I have this issue very often after software updates. The cause is that I have manually installed the Nvidia drivers. I have no issue with reinstalling Cuda. Just the drivers.
While people often suggest using apt-get
to install Nvidia drivers, with purge and more, I prefer using the driver provided on the Nvidia website, especially when working with CUDA (also use CUDA from Nvidia's website), as you have plenty of issues when apt-get
updates your versions. There is no need to uninstall anything to reinstall. Just run the .run
file again and again after each update.
http://www.nvidia.fr/Download/index.aspx and download the latest driver for your OS (Linux 64-bit). If you want to do it from the terminal (because the GUI login is broken!), you can find the direct link on the website. For example, http://us.download.nvidia.com/XFree86/Linux-x86_64/367.35/NVIDIA-Linux-x86_64-367.35.run and download using wget
.
-
Enter terminal using Ctrl+Alt+F2 (you can leave it with Ctrl+Alt+F7)
-
Download the driver
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/367.35/NVIDIA-Linux-x86_64-367.35.run
-
Add execution rights to the file
chmod u+x NVIDIA-Linux-x86_64-367.35.run
-
Exit lightdm and launch the install
sudo service lightdm stop sudo init 3 sudo ./NVIDIA-Linux-x86_64-367.35.run
-
Ignore it saying something about failing the pre-install and if it finds no 32-bit stuff; Nvidia just wants to make things more complicated than necessary! Once it's done, reboot and everything should be fine.
reboot
Keep the driver .run
file, you will reuse it often after updates!
Solution 3
When you boot and the BIOS has done its work, press shift (might need a few tries to get the timing right) to open the Grub boot menu. There choose the advanced options for ubuntu. There choose the most actual kernel and recovery.
This will lead you into the recovery menu, where you can choose to be root, voila youre in a TTY now, but be careful what youre doing there is no safety net there.
Regarding that login loop you might want to take a look here since i suspect it to be the Graphics driver to cause this. (link)
Related videos on Youtube
Xiaodong Qi
Updated on September 18, 2022Comments
-
Xiaodong Qi over 1 year
I am using Lenovo Thinkpad P50 with dual booting system (Win 10 and Ubuntu 16.04), Wacom Pen support and multitouch screen. After I enabled the propriety nVidia driver (361.42?) and rebooted, I got the login loop problem. Every solution I can find would suggest to go to the console or the TTY mode to enter some commands, but in my case I cannot even switch to the TTY mode -- ctr+alt+F1 doesn't work! BTW, I was trying to make the second monitor work with the nVidia driver for the nVidia Quodra M1000M card, but no luck so far.
Update: I finally got into console by chance (don't remember what works).
Tried: all the solutions on Graphics issues after/while installing Ubuntu 16.04/16.10 with NVIDIA graphics. nVidia-361 abd nVidia-364 drivers didn't work at all. UEFI has been turned off. I also uninstalled Unity (may not be complete) and installed GNOME 3.20. Tried deleting the .Xauthority file. Using Linux kernel 4.6. See comments on the answers below.
It only works when I uninstall nvidia drivers, but I need the nvidia driver for external monitor (so far no luck to use the external monitor).
Any suggestions?
One error before unstalling unity.
openConnection: connect: No such file or directory cannot connect to brltty at :0 upstart: gnome-session (Unity) main process (2642) terminated with status 1 upstart: unity-settings-daemon main process (2632) killed by TERM signal upstart: logrotate main process (2492) killed by TERM signal upstart: bamfdaemon main process (2545) killed by TERM signal upstart: Disconnected from notified D-Bus bus upstart: unity-panel-service main process (2647) killed by TERM signal upstart: job indicator-bluetooth failed to stop
Also, when I see the login loop happening, there is a flash of window popped out saying "Unknown tablet connected. The Wacom Inc. Pen and Multitouch may not work as expected..."
-
Xiaodong Qi about 8 yearsSince I am using a unfamiliar LVM configuration, I decide not to use the recovery mode. I am alternatively using a recovery USB stick to boot in, but still don't know how to fix this error. I am update more information to the question... Thank you.
-
Videonauth about 8 years@XiaodongQi I added a bit more to my answer, i suspect it to be the graphics driver to cause that login loop.
-
Xiaodong Qi about 8 yearsI did tried your method and the link to enter the recovery mode for root shell prompt. I entered half of the command, then ran away to my other computer to double check if I was entering the correct command line. In the mean time, the prompt did something I didn't track of and jumped to the initial recovery options window. I tried to go to the bottom for the prompt again, then I felt an electric shock coming from under the keyboard for some reason. I had to restart the computer by hitting the power button and try again.
-
Xiaodong Qi about 8 yearsOn my second around, I made it to run the
purge nvidia*
command line, yet no avail. Errors said dpkg was not available and such. A couple of seconds later, the screen jumped to another window flashing very fast with some texts and went back to the recovery options windows again. This time, on the top, it said "recovery mode (filesystem: read-only)". No matter what I hit on the keyboard, no response from the screen. Any idea? Does it have something to do with the LVM file management system? -
Xiaodong Qi about 8 yearsI finally managed to login to the terminal today (by chance) and tried the command lines in the link. Nothing worked. nVidia-361 and nVidia-364 drivers did not work for me, still have the login loops except I can now use the TTY. I uninstalled Unity and installed GNOME 3.20.1 from a ppa, but the setting button crashes and so on. Also, when I see the login loop happening, there is a flash of window popped out saying "Unknown tablet connected. The Wacom Inc. Pen and Multitouch may not work..." I didn't see this before, but how can I confirm this is a separate issue? Thanks.
-
pir over 7 yearsWorked like a charm. Thanks! You don't have any issues with using the same .run file for many updates?