At times it may happen that your graphical session on ubuntu freezes and you find yourself unable to do anything else. As a MS Windows user, the first thing that comes to your mind is a reboot of your machine, isn’t it? Well, in ubuntu you might have some other options. Let’s see some of them.
Option 1
If your Ubuntu is prior to 10.04, you can try the ctrl+alt+backspace combination. (note that this will instantly kill your X-windows, with all the programs running within it, like the window manager, and probably everything else, and it won’t ask you for any confirmation)
If your Ubuntu is newer than 10.04, bear in mind that the keystroke ctrl+alt+backspace has been disabled and replaced with alt+print screen+k.
Option 2
Using the command line (tou can try and switch to another tty using the Alt+Fn keys like Alt+F1, Alt+F2, etc., or you can use ssh from another machine), kill your graphical interface using the following commands:
/etc/init.d/gdm restart
note: depending on what you chose as a session manager, you might have to use “/etc/init.d/xdm restart” or “/etc/init.d/kdm restart” or, if you have the 11.10 version, try
sudo service lightdm restart
Option 3
Always from a command line, use the following procedure:
1 – retrieve the PID of your X server
ps -e | grep X
2- kill it
sudo kill PID_OBTAINED_ABOVE (example: kill 856)
3- restart it
startx &
Leave a comment if you think I’ve missed some better procedures.

