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

I have problems where compiz freezes and I have to switch to another console(ctrl+alt+F1) to restart. But it would be easier if I could just do "$ compiz --replace" in the other console and not have to lose work or anything.

But when I do this it says it can't open the display, makes sense because the display is open in console 7. Is there any way I can easily redirect a command to another console for it to be run there?

Like for instance, be in console 1 and execute "$ compiz --replace" on console 7?

share|improve this question

It's quite simple in theory and appears to work with compiz --replace, but other programs may not be so cooperative.

  • Login to the console session after Ctrl-Alt-F1, and type:
    • export DISPLAY=:0.0 (0 is the default display for the GUI/X)
  • Followed by compiz --replace, etc.
  • This simply sets the DISPLAY environment variable in your console session to that of your GUI session, hopefully fooling programs into thinking they are on that display and then operating on that display.
share|improve this answer
Is this safe to do for like later on in the active x or does this only effect that one console session? – G1i1ch Jun 11 '12 at 7:06

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.