Kill a Frozen or Crashed UNIX / Linux X Desktop

Here is a quick tip to kill a crashed Linux / UNIX X desktop system. Many new user do not know this simple tip and end up hitting computer reboot button. Press CTRL + ALT + Backspace to kill GUI and get back to login screen. There are more ways to kill a crashed desktop without restarting your computer.

ADVERTISEMENTS

If CTRL + ALT + Backspace refused to work, try to login to console by pressing CTRL +ALT + F1. To kill GDM (Gnome Desktop) manger, enter:
killall gdm
You can also run the following:
/etc/init.d/gdm stop
To start GDM again, enter:
/etc/init.d/gdm start
To kill KDM (KDE Desktop), enter:
killall kdm
OR
/etc/init.d/kdm stop
To start KDM again, enter:
/etc/init.d/kdm start
This is useful for killing desktop session. You can always kill indidual process such as a web server or firefox using kill / killall command line option. Under X windows you can use xkill command kill a client by its X resource and not by process ID.

🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source & DevOps topics via:
CategoryList of Unix and Linux commands
File Managementcat
FirewallCentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNCentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
12 comments… add one
  • chika.tambun Nov 24, 2008 @ 3:00

    whew… after i read this thread… i did it in short time… bummmphhhhhh… login screen with people smiling appear….

    fortunately, i’ve done burning dvd-disc… oh god really2 love me.

    viva ubuntu,

    chika.tambun

    nb: vivek wht abt my question abt make dvd slideshow from photoes i have… c’mon i’ve tried mandvd, manslide…. but none of them works well

  • 🐧 nixCraft Nov 24, 2008 @ 4:27

    Chika,

    I never tried creating slideshow from photoes; so really can’t help you out!

  • mhymn Nov 24, 2008 @ 9:08

    ‘killall -9’ would be a better choice imo, and particularly ‘killall -9 X’ that will reset the DM too.
    i’d also recommend ‘Ctrl + Alt + Esc’ to end the not responding program or window.

  • DeBaan Nov 24, 2008 @ 16:45

    I use gdm and gnome; periodically, my mouse pointer disappears, and I lose the ability to change focus of windows (alt-tab doesn’t work, but alt-f4 does). Ctrl-alt-f1 works, as does ctrl-alt- backspace, but killing X closes all my open programs.

    Xeyes shows that the system is still tracking my mouse, but the pointer is gone, and clicking (right or left) does nothing. I have to ctrl-alt-backspace to kill X and have my pointer come back.

    Unplugging my usb mouse and keyboard does not have any effect.

    Any ideas?

    I originally thought it was a pointer grabbing issue from all my vncviewer and rdesktop windows, but then I saw it happen when my mouse was only on the gnome-panel.

    I use xscreensaver with a timeout, and it appears not to register input when I’m in a rdesktop or vncviewer windows, so X starts to go black for screensaver, then comes back. I wondered if that was related.

    Out of ideas.

  • 🐧 nixCraft Nov 24, 2008 @ 16:50

    @DeBaan,

    Any specific error message in a log file – /var/log/Xorg.0.log?

  • luis Nov 28, 2008 @ 12:09

    and if the system is realy crashed and the above solution wont work… hold down Alt + SysRq and with those keys pressed, type reisub
    and system will reboot 😉

    • Alex Jul 8, 2011 @ 10:00

      For this to work you need kernel.sysrq = 1 in sysctl.conf. By default this option is set to 0 (at least on centos, fedora).

  • georges Nov 28, 2008 @ 15:01

    thanks for the tip.
    I tried it in Fedora/gnome and it works fine.

    What I do is use ctrl/alt/F1
    log in as root.
    do some analysis or cleaning (top, ps -edf, kill, etc …)
    then type ctrl/alt/f7
    And I am back in gnome

  • Mike Nov 30, 2008 @ 0:19

    A problem I’ve been having lately is not so much the GUI locking up, but the keyboard stops responding the mouse is OK. Is there a GUI only methods d for this, almost feel dirty asking for a GUI tip 🙂

    • Alex Jul 8, 2011 @ 10:04

      I had the similar issue in KDE 3 on fedora 9. Experimentally I found out that keyboard started working again after right-clicking on a windows’ titlebar to bring up context menu with windows actions. Yes, that’s very strange but saved me tens of minutes, which otherwise would be spent on X restarts.

  • chika.tambun Nov 30, 2008 @ 20:15

    @mike….

    it’s easy … since there is no keyboard virtual like m$ on intrepid CMIIW… go to
    ubuntu logos >> System >> Administration >> System monitor(go to processes tab >> choose bash or X process then kill them… LoL)

    Whew… cool enough, ^^

    br,

    chika.tambun

  • Omar Jan 12, 2009 @ 19:13

    DeBaan, I am getting exactly the same thing you are getting, running Linux version 2.6.9-67.EL

    So far nothing definitive came up in my google searches on this problem, though I saw a post about restarting mice which suggested doing Ctrl-Alt-F5 to switch to text mode login, then Ctrl-Alt-F7 to go back to the GUI. This doesn’t kill your windows, it just restarts whatever processes that bring up the graphics. I’m not too optimistic this will fix the problem, but it’s worth a try next time it happens…

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.