Kill a Frozen or Crashed UNIX / Linux X Desktop

by on November 23, 2008 · 12 comments· LAST UPDATED November 23, 2008

in , ,

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.

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.

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 12 comments… read them below or add one }

1 chika.tambun November 24, 2008 at 3:00 am

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

Reply

2 nixCraft November 24, 2008 at 4:27 am

Chika,

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

Reply

3 mhymn November 24, 2008 at 9:08 am

‘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.

Reply

4 DeBaan November 24, 2008 at 4:45 pm

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.

Reply

5 nixCraft November 24, 2008 at 4:50 pm

@DeBaan,

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

Reply

6 luis November 28, 2008 at 12:09 pm

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 ;)

Reply

7 Alex July 8, 2011 at 10:00 am

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).

Reply

8 georges November 28, 2008 at 3:01 pm

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

Reply

9 Mike November 30, 2008 at 12:19 am

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 :)

Reply

10 Alex July 8, 2011 at 10:04 am

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.

Reply

11 chika.tambun November 30, 2008 at 8:15 pm

@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

Reply

12 Omar January 12, 2009 at 7:13 pm

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…

Reply

Leave a Comment

Tagged as: , , , , , , , , , ,

Previous post:

Next post: