If you’re having trouble fixing frozen X servers, you may want to try using the sysRq key. This key can help to fix problems with your computer’s processor and memory, and it can also help to fix frozen X servers. To use the sysRq key, you first need to create a file called sysRq.conf in your home directory. This file contains information about how the key works and how to use it. Next, you need to install the sysRq key on your computer. You can do this by going to the website that provides this information and downloading the file that contains this key. Once you have downloaded the file, you will need to install it on your computer. Once you have installed the sysRq key, you will need to set up your computer so that it can use it. You can do this by going into your system settings and clicking on the button that says “SysRq.” This will open a new window that will allow you to set up your computer so that it can use the sysRq key. Once you have set up your computer so that it can use the sysRq key, you will need to start using it. You can do this by going into your system settings and clicking on the button that says “SysRq.” This will open a new window that will allow you to start using thesysRq key.


On Linux, the magic SysRq key can send commands directly to the Linux kernel. You can use it to recover from freezes or cleanly restart your system, even if nothing appears to be responding.

The magic SysRq key is implemented as part of Linux’s keyboard driver – it will work as long as the Linux kernel is still running. Only a kernel panic should disable this key combination.

Image Credit: solylunafamilia on Flickr

Using the Magic SysRq Key

The SysRq key is located near the Scroll Lock key on your keyboard – the Sys Rq key is generally the same as your Print Screen key. The “magic” SysRq combination is Alt+SysRq.

To use this key combination, your Linux kernel must have been compiled with the CONFIG_MAGIC_SYSRQ compile option – most Linux distributions will have this enabled by default. Assuming it’s compiled into your kernel, it can be enabled or disabled on a running system by changing the value of /proc/sys/kernel/sysrq. To check if it’s enabled, run the following command:

If you see a “1”, all functions of the magic SysRq key are enabled. A greater number indicates only certain functions are enabled—see the official Linux kernel help for more information.

If you see a “0”, you can enable all magic SysRq options yourself by running the following command:

On Ubuntu, the magic SysRq options are set at boot according to the contents of the /etc/sysctl.d/10-magic-sysrq.conf file. Edit this file to choose your desired values.

Dealing With a Frozen X Server

If your X server (the program that runs your graphical desktop) freezes, you may find yourself unable to use your system. There are a few magic SysRq commands that can help:

Alt + SysRq + r – Takes the keyboard out of raw mode, taking control away from the X server. After running this combination, you should be able to use the Ctrl + Alt + F1 (and other F-key) keyboard shortcuts to switch to another console and restart X. Alt + SysRq + k – Kills all programs on the current virtual console, including X. You can also enable the Ctrl+Alt+Backspace keyboard shortcut in Ubuntu’s keyboard preferences to restart your X server – however, this shortcut is implemented by the X server and may not always work.

Cleanly Restarting Your System

Used in sequence, some of these actions can be used to cleanly end processes, flush data to disk, unmount all file systems, and restart your computer. To perform this process, press and hold the Alt + SysRq key combination and – while holding the Alt and SysRq keys down — type the following keys in order, pausing for several seconds in between each key:

The mnemonic “Raising Elephants Is So Utterly Boring” is often used to remember this sequence. Here’s what each key does:

r – Puts the keyboard into raw mode, taking control of it away from the X server. e – Sends the terminate signal to all processes, asking them to end gracefully. i – Sends the kill signal to all processes, forcing them to end immediately. s – Flushes data from your cache to disk. u – Remounts all file systems read-only. b – Reboots your computer.

More Commands

Here are some other actions you can perform with the magic SysRq key. To perform an action, press and hold the Alt + SysRq keys while typing the letter:

n – Resets the nice level (priority) of all high and realtime priority processes. f – Calls oom_kill, which will kill a memory-hogging process. o – Shuts off the computer.

There are other actions, but they may be more useful to developers than the average Linux geek. For more information on the magic SysRq key – and a full list of actions you can perform – consult the official magic SysRq documentation for the Linux kernel.