Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I'm testing Natty, and Compiz keeps crashing on me. I expect this sort of thing from alpha software, of course, but it doesn't always give me the option to restart compiz, and for some reason doesn't have a fallback WM configured. Without a window manager, all my programs are still running, but they're not accepting input from the keyboard, and I can't switch between them. I can, however, press Ctrl+Alt+F1 and get a terminal, and I can killall Xorg to reset everything, but I'd rather just reset compiz if possible. If I try typing compiz --replace there in the tty, it complains "fatal--couldn't open display." Is there a way to have tty1 restart compiz? Like compiz --replace --display=something?

Additionally, is there a way to configure a fallback window manager so that there's an easier way to recover from compiz crashing?

share|improve this question
You should start accepting answers. So far you've asked 8 questions but haven't accepted any answers. – Michael Martin-Smucker Mar 22 '11 at 0:59
can this be simplified for a (terminal) newb? – user165081 Jun 6 '13 at 22:03
up vote 58 down vote accepted

Switch to terminal number 1 (Ctrl+Alt+F1) and run

DISPLAY=:0 unity --replace 


DISPLAY=:0 compiz --replace

Sometimes it doesn't restart. Just kill all compiz processes and try again in case.

share|improve this answer
Latest unity starts itself on DISPLAY=:0 automatically. – Owais Lone Apr 16 '11 at 17:31
You can also switch use 'setsid unity' btw – Owais Lone Aug 16 '12 at 9:39
Both your comments seem valuable, but they're not yet clear to me: do they mean 1) that DISPLAY=:0 can be dropped, even when using tty-1 to replace unity running, crashedly, in tty-7 ? and 2) do you recommend using setsid for this purpose (rather than () or & disown or nohup) and if so why ? – nutty about natty Feb 7 '13 at 9:44
I have killed compiz and I had to run DISPLAY=:0 unity --replace to start unity. Just running compiz did not show full screen window decoration and did not automatically start unity. – conualfy Feb 12 '14 at 10:42

You need to set the DISPLAY environment variable, in the usual case of a single Xorg instance you can do that with

export DISPLAY=":0.0"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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