7

Occasionally the mouse cursor will freeze - I have to reboot.

In Ubuntu is there a keystroke combination such as Ctrl+Alt+Del which would enable me to continue working without having to reboot?

3

The first thing to try is to press Ctrl+Alt+F1. If the GUI is frozen but the keyboard driver is still responding, this will switch to a text console. You can log in to that text console and access your system and try to solve the problem. You can return to the GUI screen with Ctrl+Alt+F7 (some distributions may use a different number).

If that doesn't work, your computer may still be running, but with the console completely hosed. Then you can still access it over the network, provided you have an SSH server running. Log in from another computer (PC/tablet/phone/…) and try to solve the problem.

If you have no way to access your computer because the console is unavailable and you didn't have an SSH server, you can try killing the whole GUI session with the magic SysRq key Alt+SysRq+K: press and hold Alt, press and release SysRq, press and hold K, and finally release Alt. Depending on your distribution, this may or may not show a new GUI login prompt after a few seconds. If you don't, use Ctrl+Alt+F1 to switch to a text console, and Alt+SysRq+K to switch the keyboard to the text console mode. On a default Ubuntu installation, I think the command to restart the GUI login prompt is service gdm restart.

If that doesn't work and you just want to reboot, you can use the magic sysrq keys E, U, B:

  1. Press Alt+SysRq+E to kill all processes but leave them the opportunity to do an emergency save.
  2. Wait a couple of seconds, then press Alt+SysRq+U to allow all file changes to be written to disk.
  3. Wait a couple of seconds, then press Alt+SysRq+B to reboot.

(Do not use or try to remember the popular “REISUB” sequence. The R and S do nothing in this sequence, and the I defeats the purpose of the previous E.)


As to what is causing the GUI freeze, the most common culprit is a buggy 3D video driver. 3D video drivers are very complex and video card makers don't provide good support, so the drivers tend to be buggy. Often, the 3D effects are provided by the Compiz program, and killing the compiz process unfreezes the interface. To kill the Compiz process, once you have a command line access, run

pkill compiz

If you find that you often have freezes due to Compiz, switch to a different desktop environment that doesn't use Compiz. The Ubuntu default (Unity) requires Compiz, but most don't. Try KDE or LXDE (without enabling Compiz of course).

  • This key combination (Alt+SysRq+B) restart the computer. – Erman Mar 19 at 16:46
  • Thanks for this! Turns out a single process (Archive Manager) had completely frozen the mouse. Killing it resolved the issue immediately! 👍 – Marco Roy May 29 at 21:23
  • I don't know why but that console after ctrl+f1+alt, is not accepting even the correct password. – Vicrobot Jul 30 at 12:34
  • @Vicrobot Maybe your console has a different keyboard layout. Check at the username prompt. The text console and the GUI use completely different keyboard layout mechanisms. Some distributions arrange to set the same default for both, but not all do. – Gilles Jul 30 at 14:51
3

Just open the Terminal using Ctrl+Alt+T and type the following commands:

modprobe -r psmouse for removing it

modprobe psmouse for adding it

  • worked for me, thanks! – Jordan Arseno Jul 24 at 17:57
  • solves my case where the mouse freezes after the system goes to sleep – dmSherazi Aug 5 at 15:35
1

Try with:

sudo su

echo 1 > /proc/sys/kernel/sysrq

Then press the keystroke Alt+PrtScr+K, this could kill your X session.

  • I tried this & it does work - in as much as it causes the computer to reboot. I was hoping for a way to unfreeze without rebooting. – Dot Ukay May 2 '15 at 14:38
0

If you can still reach a console or terminal, maybe you could try this solution. Otherwise I believe sebelk's solution is probably a good start. If killing the X server is not sufficient and you can't reboot properly the machine, then in the same idea as sebelk, you could at least try to raise elephants to reboot more properly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.