How to fix a broken Gnome login screen on Linux
The Gnome login screen usually works flawlessly, as it is a beautiful piece of software with an excellent team behind it. However, even great tools have their bad days and stop working. So, in this guide, we’re going to go over how to fix a broken Gnome login screen on Linux.
Please note that you do not need to be using the Gnome Shell desktop environment to take advantage of this fix. All that is required is that you’re using a relatively recent release of the Gnome display manager (the login screen).
Before we begin
In the event that the Gnome login screen stops working the way it should, you will not be able to access the Gnome session. Since there is no way to access the Gnome session, there isn’t any way to quickly pop open a terminal window to force the login screen to cooperate. Instead, you’ll need to take advantage of TTY virtual console.
What is TTY? It’s the text-only virtual terminal that can be accessed when a keyboard combination is pressed on a Linux computer system. All Linux distributions have them by default as a feature. Some, like Ubuntu, have six virtual terminals, while other Linux distributions may only have just one or two. And then there’s Arch Linux, which gives users TTY virtual consoles as their default desktop environment until they manually set everything up!
The TTY virtual console is handy in working in emergencies, especially in cases like this where the Gnome login screen isn’t very responsive, is locking up, or just plain isn’t working right.
To get your hands on the TTY virtual console on your Linux desktop, look to the keyboard and press Ctrl + Alt + F2, and the first terminal will open. Though keep in mind that not all Linux systems assign a TTY to this combo, so try some of the other ones in the list below.
- Ctrl + Alt + F3
- Ctrl + Alt + F4
- Ctrl + Alt + F5
- Ctrl + Alt + F6
After gaining access to the TTY virtual console on your Linux PC, find the “login” section, and write your PC’s username to log into the command-line terminal. The “root” account also works too.
Upon logging in to the TTY virtual console, move on to one of the methods below to fix the Gnome login window on your Linux PC.
Method 1 – rebooting Gnome Display Manager with systemd
One way to force the Gnome login screen to fix is to reboot the service that controls it. The reason that rebooting it is a good idea is that if you’re experiencing problems with a program or service, refreshing the problematic application can quickly get you back up and running in a small amount of time.
Rebooting the Gnome display manager means making use of the Systemd init system is required. The reason Systemd is integral to the restart process is that Gnome is tightly integrated with it.
To reboot your login screen, use the systemctl restart gdm.service command, along with sudo, as it is not possible to execute system-level commands without root privileges.
sudo systemctl restart gdm.service
Upon running the “systemctl restart” command above, your Linux PC should instantly take you out of the TTY virtual terminal and to a freshly restarted Gnome login screen, that hopefully works.
If the restart process hasn’t worked, try this process as many times as it takes. Or give Method 2 a shot.
Method 2 – stopping Gnome Display Manager and restarting it with systemd
Restarting the Gnome display manager’s Systemd service is a reliable way to fix issues with the login screen, as when it is refreshed, the problems usually go away. However, restarting may not work in all cases (for whatever reason).
An alternative approach to getting an unresponsive Gnome Display Manager working again is to flat out kill the process, so it stops running. Then, start it back up again. Effectively, this is probably the same as restarting it, but it’s an excellent way to go for those having issues with Method 1.
To stop the Gnome login screen from running, you’ll need to make use of the Systemd stop command. So, in the TTY virtual terminal, try systemctl stop gdm.service with sudo privileges.
sudo systemctl stop gdm.service
Running the “systemctl stop” command above should instantly kill the Gnome display manager. However, you wouldn’t know it, as the TTY console is still up. From here, use the systemctl start gdm.service command with sudo to start it back up again.
sudo systemctl start gdm.service
Right after the “systemctl start” runs, the Gnome display manager will take you out of the TTY virtual terminal and back to a fresh login screen. Otherwise, if it doesn’t, press Ctrl + F7 to send the virtual terminal to the background.
Occasionally, booting my computer does not take me all the way to the login screen. By accident, I found that switching to tty2 (or ttyx for 1 < x < 6) and then back to tty1 was all that was required. Just do [ALT]+[Right Arrow Key] followed by [ALT]+[Left Arrow Key] and that seems to have refreshed the gdm.