Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

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've got this chroot jail all setup. I tried to run Firefox in it, but got this message:

"Gtk-WARNING ** cannot open display: "

I know I have to invoke Firefox with --display= something. I probably also have to set the DISPLAY environmental variable to something as well. But I've tried all kinds of combinations, and can't get it to work in the chroot jail.


share|improve this question
up vote 5 down vote accepted

You need to provide either the X magic cookies credentials (see DISPLAY and AUTHORITY) or allow connections from localhost via xhost +local:. You still need to provide the correct DISPLAY variable, typically DISPLAY=:0.

Based on your error message you probably didn't specified the DISPLAY variable, check your DISPLAY variable outside of the chroot with echo $DISPLAY and set it to the same value in your chroot via export DISPLAY=value

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.