I'm testing Natty, and Compiz keeps crashing on me. However, it doesn't always give me the option to restart Compiz, and for some reason doesn't have a fallback window manager(WM) configured.

Without a WM, 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 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?

  • You should start accepting answers. So far you've asked 8 questions but haven't accepted any answers. Commented Mar 22, 2011 at 0:59
  • can this be simplified for a (terminal) newb?
    – user165081
    Commented Jun 6, 2013 at 22:03

3 Answers 3


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.

  • 2
    Latest unity starts itself on DISPLAY=:0 automatically.
    – Owais Lone
    Commented Apr 16, 2011 at 17:31
  • You can also switch use 'setsid unity' btw
    – Owais Lone
    Commented Aug 16, 2012 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 ? Commented Feb 7, 2013 at 9:44
  • cf setsid and askubuntu.com/questions/106351/… Commented Feb 7, 2013 at 9:54
  • 3
    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
    Commented Feb 12, 2014 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"

I had a similar problem with my menubars and taskbar having disappeared.

I tried the above solution but it did not work. However with the following I got my stuff back to normal :)

compiz --replace 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .