Linux Mint - Cannot Login (login loop)

In this post it's described a login loop for Linux Mint. This happened on a Virtual Machine with Linux Mint 19 - which stopped working after install of new software.

What happened is: Entering the password on the login page ,it goes black for about several seconds then it brings me back to the login page. The login is disabled at start and I notice that I was prompted for a password and redirected to the login screen. I've tried to use Software Rendering without success.

Step 1: How to identify Login issue

After several unsuccessful trials I've decided to try something different and find what is the root cause of the problem. First I tried to access the Boot menu by pressing - Delete or F10 - the problem wasn't here.
Next I decided to test with older kernels.Changing kernels didn't solve the problem.

The third step was to enter in the Grub menu/Recovery Mode and login as a root on terminal.

  • Reboot
  • Hold Shift - during boot
  • Select: Advanced Options For Linux Mint 19.3 Cinnamon
  • Select the latest Kernel with Recovery mode - as the picture below:

linux_mint_login_loop_grup_menu

You will see several options like:

linux_mint_login_loop_issue

  • clean: Attempts to make free space on your file system. If your storage is full and this is causing some sort of problem, this can help free up space.
  • dpkg: Repairs broken software packages. If a package failed to install properly and your system doesn’t work because of it, this may help.
  • failsafeX: Boots your computer in a failsafe graphic mode. If there’s a problem with your Xorg graphical server configuration or graphics drivers and that’s causing your system to boot to a black screen or preventing the graphical desktop from loading properly, this can get you back to that graphical desktop.
  • fsck: Performs a file system check, which scans the computer’s file systems for errors and automatically fixes them. It’s a bit like chkdsk on Windows.
  • grub: Updates the GRUB boot loader. If you could use the GRUB boot loader to get to this menu, this option probably won’t help.
    network: Enable networking, which is disabled by default in recovery mode.
  • root: Leaves the menu and goes to a root shell prompt. From here, you can mount the file system in write-mode and run commands that may help fix problems with the system. You should only do this if you know what you’re doing — it’s a way to fix the problem by hand if you know how.

You need to use - root.

Once logged in on the root terminal I identified that problem was related to no space left on my hard drive. The command is:

df -h

This Virtual Machine has a small disk 15 GB and it's used only for experiments. After the last update disk space dropped to 0.

Step 2: How to fix the Login Loop due to full Disk

You can check this article: 5 Simple Ways to Free up Space on Linux Mint

In order to gain free space I started with a command like:

sudo apt-get autoremove && sudo apt-get autoclean && sudo apt-get clean

or

sudo apt-get autoclean && sudo apt-get autoremove

The command didn't clean anything because I was executing the previous day.

Next step was to clean systemd journal logs.

sudo journalctl --vacuum-time=3d

This helped me to free 0,5 GB space but I decided to go further by:

sudo tune2fs -m0 /dev/sda1

This helped me to free 1,5 GB which did the magic and I was able to login after reboot.

Finally I've just cleaned my Trash and increased the disk size to 20 GB.

Step 3: Solution changed Permissions on Xauthority

In some cases the problem might be related to changed permissions on .Xauthority file. In this case solution is to change back the file permissions of .Xauthority from root to the user account:

  • On the login screen switch to terminal with CTRL + Alt - F2
  • Type in your credentials
  • Identify the problem
  • Fix the problem by:
sudo chown -Rc $USER:$USER $HOME

and:

rm $HOME/.Xauthority $HOME/.ICEauthority
  • Switch back to login screen with CTRL + Alt - F7
  • Test the solution by typing in your credentials
Share Tweet Send
0 Comments
Loading...