0

I am a beginner Linux user and have been using, as mentioned, Ubuntu 18.04.1 for about three months. So far, since I know I lack sufficient experience, I have avoided messing with anything tricky or dangerous-looking in the command-line.

Then, a couple days ago, I ran into a problem. After rebooting my computer, and typing in my password as usual, the screen went black for a few seconds, and then showed up at the login manager again. And again. And again. The Login Loop. I've heard of it before.

So obviously, what caused it, and how do I fix it?

That's what I need help with.

I was aware that this question has been asked before, so I looked around to see if I could find some things out. First, I found out that my login manager was GDM3, and there could be problems with that. So I tried installing LightDM and using that instead. No luck.

Next, I tried using the Cinnamon desktop environment that I had installed several weeks ago. That didn't work either. Something came up about Cinnamon needing to be restarted, which it never successfully did.

Note: I did not have Cinnamon running when I ran into this problem, I only tested it briefly a while ago. My current desktop environment is the default that was there when I first installed Ubuntu. I assume that is called 'Ubuntu' or 'Gnome', but I don't really know.

Then I read something about the Xauthority file possibly causing an issue. I used cat .xsession-errors to check that and it showed my username as still owning it. So apparently no problem there.


***Update. This is the content I get from running cat .xsession-errors:

`dbus-update-activation-environment: setting DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
dbus-update-activation-environment: setting DISPLAY=:0
dbus-update-activation-environment: setting XAUTHORITY=/home/kaleb/.Xauthority
dbus-update-activation-environment: setting GTK_MODULES=gail:atk-bridge
dbus-update-activation-environment: setting QT_ACCESSIBILITY=1
dbus-update-activation-environment: setting LANG=en_US.UTF-8
dbus-update-activation-environment: setting GDM_LANG=en_US
dbus-update-activation-environment: setting DISPLAY=:0
dbus-update-activation-environment: setting MANDATORY_PATH=/usr/share/gconf/LXDE.mandatory.path
dbus-update-activation-environment: setting XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/kaleb
dbus-update-activation-environment: setting USER=kaleb
dbus-update-activation-environment: setting DESKTOP_SESSION=LXDE
dbus-update-activation-environment: setting DEFAULTS_PATH=/usr/share/gconf/LXDE.default.path
dbus-update-activation-environment: setting PWD=/home/kaleb
dbus-update-activation-environment: setting HOME=/home/kaleb
dbus-update-activation-environment: setting QT_ACCESSIBILITY=1
dbus-update-activation-environment: setting XDG_SESSION_TYPE=x11
dbus-update-activation-environment: setting XDG_DATA_DIRS=/usr/share/LXDE:/home/kaleb/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop
dbus-update-activation-environment: setting XDG_SESSION_DESKTOP=LXDE
dbus-update-activation-environment: setting GTK_MODULES=gail:atk-bridge
dbus-update-activation-environment: setting SHELL=/bin/bash
dbus-update-activation-environment: setting XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
dbus-update-activation-environment: setting IM_CONFIG_PHASE=1
dbus-update-activation-environment: setting GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1
dbus-update-activation-environment: setting SHLVL=1
dbus-update-activation-environment: setting LANGUAGE=en_US
dbus-update-activation-environment: setting GDMSESSION=LXDE
dbus-update-activation-environment: setting LOGNAME=kaleb
dbus-update-activation-environment: setting DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
dbus-update-activation-environment: setting XDG_RUNTIME_DIR=/run/user/1000
dbus-update-activation-environment: setting XAUTHORITY=/home/kaleb/.Xauthority
dbus-update-activation-environment: setting XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session2
dbus-update-activation-environment: setting XDG_CONFIG_DIRS=/etc/xdg/xdg-LXDE:/etc/xdg
dbus-update-activation-environment: setting PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
dbus-update-activation-environment: setting _=/usr/bin/dbus-update-activation-environment
** Message: 10:18:58.669: main.vala:102: Session is LXDE
** Message: 10:18:58.669: main.vala:103: DE is LXDE

(lxsession:4531): dbind-WARNING **: 10:18:58.718: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-UrEFunK9WL: Connection refused
** Message: 10:18:58.729: main.vala:134: log directory: /home/kaleb/.cache/lxsession/LXDE
** Message: 10:18:58.729: main.vala:135: log path: /home/kaleb/.cache/lxsession/LXDE/run.log`

Does this help at all?
Let me know if I can post any more useful information.


Later, I was able to install the Lubuntu desktop environment and successfully log in to my account. That's a far cry from my original position though, and the problem still isn't fixed.

I really have no idea how the problem started though. The only unusual things I can think I did before the problem started were:

  1. Installed Alacarte from software manager to edit application icon.

  2. Used sudo nautilus in the terminal to get into some files that were locked. This was in regards to the application icon I was trying to change; nothing system-related.

I did nothing else out of the ordinary before the reboot.

Any help on how to diagnose and fix this Login Loop would be greatly appreciated.

Kaleb
  • 223
  • just fyi: GUI logins require the creation & use of temporary work files which are created in your $HOME (user directory). If you have insufficient space in your user directory ($HOME) the creation of those files fails and you are logged out (ie. login loop without message). You can still login via terminal, check you have space in $HOME, or rm files if necessary, then switch to GUI and re-login normally. – guiverc Feb 28 '19 at 04:41
  • @guiverc Thanks for the tip. Last I checked, my Home drive was only %50 full, unless I'm missing something. I did figure out how to log in via the terminal. Is there a specific command I can enter to see how much space is left in my Home folder? – Kaleb Feb 28 '19 at 04:48
  • I use df -hl (disk free, human & local-only options... -- i use 'human' so I don't get huge numbers, 'local' so I don't get a list of NFS storage drives too which you may not have) – guiverc Feb 28 '19 at 04:52
  • Have you tried sudo chown -R $USER ~/* (chown = change ownership, -R so it's recursive, $USER will be/become your username, ~ is shorthand for your user directory). By using sudo nautilus you may have edited/changed a file and made the owner 'root' & denied your user access to whatever you changed (its no longer owned by you, but became a 'root' owned file) whilst the elevated privileges within nautilus – guiverc Mar 05 '19 at 04:42
  • @guiverc No, I don't believe I've tried that yet. I did check my Xauthority file somehow, to make sure it was still owned by me, which it was, but I'm not sure if you're talking about that file or not. Should I enter the code 'sudo chown -R $USER ~/*' exactly as it is shown in your comment? – Kaleb Mar 05 '19 at 20:49
  • Yeah it may not help, but it may. The $USER will be expanded to your user name (as I don't know it) and you can just put ~ (which will be the same as ~/* ; I think I typed it as * then decided you should have directory so added the ~/ to it). It will just ensure any file located in or under your $HOME directory will be owned by you (which should be the case; ie. undo anything you've done by using elevated privileges or sudo that may have changed ownership away from you). – guiverc Mar 05 '19 at 23:31
  • @guiverc Entering sudo chown -R $kaleb ~/ (my username is just 'kaleb') gives me the error chown: missing operand after '/'. Am I doing something wrong? – Kaleb Mar 06 '19 at 02:29
  • If you enter echo $USER you'll see your username (which I assume now is kaleb) be printed. If you want to use your username, it's sudo chown -R kaleb ~ (the $USER is a variable which will be substituted with the username I didn't know, ie. echo $USER prints "guiverc" for me as that's my username. The $ tells bash/shell to use the variable of the name after the $ (ie. $USER will contain your username, $PWD will be your present.working.directory etc). Because I didn't know your username, $USER would become it (or you can substitute it yourself too as you did if you remove the $) – guiverc Mar 06 '19 at 02:38
  • @guiverc Alright, entering sudo chown -R kaleb ~ exactly into the terminal made a ton of black-and-white stuff go scrolling by for a few minutes, saying it was changing ownership on everything. Then everything became dis-functional, and after reboot I have a black screen with a blinking white cursor. I think I should reinstall now. Like I asked earlier, should I choose the 'reinstall' or 'something else' option? – Kaleb Mar 06 '19 at 03:10
  • Does this answer your question? Ubuntu gets stuck in a login loop – karel Jan 16 '20 at 17:06

1 Answers1

0

I know this has been solved already but I had a similar issue where after updating I was stuck in the login loop. This solution is only for those that have a NVIDIA driver already installed. During the update process some how nouveau was enabled. Solution:

1) create file blacklist-nouveau.conf in /etc/modprob.d

2) Add below contents: blacklist nouveau options nouveau modeset=0

3) Regenerate the kernel initramfs with below command: sudo update initramfs -u

4) reboot

I tried so many solutions online and none of them worked. Hope this helps someone.