Last updated on June 5th, 2023 at 11:55 pm
In case you have recently updated your Kali Linux or any other Linux-based operating system you are probably now stuck on the Linux login screen. You can’t operate your system even though you are providing your credentials correctly. To deal with this situation you can follow some simple steps to get out of this worst condition.
In this article, we are going to solve the following problems on various Linux Distros like Ubuntu, Linux Mint, Fedora, or Parrot OS installed on VMware, Virtual Box, and other problems: Kali Linux stuck on Login Screen, Kali Linux keeps asking for username and password, Linux Login Loop. If you are looking for one of these problems then you are at the right place.
Simple Guide to Fix Kali Linux Stuck on Login Screen
Step 1: Turn on your Linux Machine (In my case it is Kali Linux)
Step 2: When the login screen appears press
Ctrl + Alt + F4 simultaneously to open the terminal.
Step 3: (Error Detection) This step is a little bit confusing but read out the whole article and you’ll find the solution exactly as per your problem. In this step, we’ll find out the problem and solve that problem in the next steps. So, there is a simple reason behind this issue is that when you were updating or upgrading your Linux OS some files broke or got corrupted because of a slow internet connection or network interruptions. Or because of some incompatibility issues with the desktop environment, you are currently using. There are two mostly used desktop environments you might be using one of them.
dm3 -version or
Try these commands one by one to find out which desktop environment you were using recently.
Step 4: After finding out the desktop environment now it’s time to repair or replace the desktop environment to revive our Linux operating system without losing our data. In my case, my Kali Linux was using the lightdm desktop environment, and now it is no longer compatible with my OS because of a recent upgrade. So, I have to switch from lightdm to gdm3 and there is a simple way to do that just by putting this command
sudo apt-get install gdm3
Step 5: (Solution for not enough space in /var/cache/apt/archives). In my case, I got an error not enough space in /var/cache/apt/archives because I have allocated less storage to my Kali Linux and ran out of space that’s why I faced this error. If you too find this issue try to fix it by executing this command
sudo apt-get auto clean
This command deleted all .deb backups which were useless after their installation and now I got some free space so my alternative desktop environment could be installed easily.
Step 6: After the download completion, a prompt will appear asking which desktop environment you want to set default either Lightdm or GDM3. I choose gdm3 because I was using lightdm previously and now it isn’t working for me.
Step 7: The final step is to check the results and run a new desktop environment. By using this command or rebooting the system.