On my system, Ubuntu freezes occasionally. The entire display becomes unresponsive - the mouse still moves but nothing happens on click, and with the keyboard I can press Ctrl+Alt+F1
to go to a login prompt.
When I log in from the prompt, it appears all my programs are still running as normal. Yesterday for example I was converting some videos and running top
showed the avconv
process still running. I left it going for several hours and eventually it had completed the task perfectly. (What actually appeared to cause the freeze was opening Transmission from the notification area, but killing the process from the command line didn't make the system responsive again.)
Anyway, after reading through this question it seemed like restarting the GUI was the way to go. So I ran sudo service lightdm restart
but it closed all the programs down when logging out.
So for future use, is there a way to restart only the GUI and go back to exactly where I was? Everything else in the linked thread is about rebooting or restarting the OS.
The answer in a single word:
Unfortunately X applications which are running will be terminated when X closes. Since closing the X server, and restarting is what fixes your problem... there is probably no way around it.
Try simply typing
unity --replace
. This should restart Unity without stopping any running programs.There is a solution I found here, you don't need to reboot nor to restart X, you can fix it without losing your work, but your work can not be visualized in desktop anymore, they will keep running in the background till they get finished or killed by you. It is still useful for the programs that need more time to run. The solution is to press Ctrl+Alt+F1 and get to a raw linux console, then type the command
to get the PID of your struck windows manager, then kill it by
if it doesn't work then try
wait for a while, if you repeat pgrep, you should see either
1) no result or 2) different PID
Then your can use Ctrl+Alt+F7 and your will find the desktop work again!
I have this problem also and so far there's no fix (if it's a bug) or a better solution without losing all the open applications.
But right now the only way I can restore the whole thing without closing the applications and restarting, since I can still open a terminal (Ctrl + Alt + F1) I just do a
pm-suspend
which suspends the machine and just start it again. I does restart it but at least I still have the applications open the same way before the freeze started and it only takes a few seconds compared to a couple of minutes when rebooting the machine.Hopefully that will help someone temporarily till this thing gets a fix.