I've got minimal CentOS 6 running on an Oracle VirtualBox on a Mac. I'm trying to get Firefox up and running so I can download some web files into the VM.

I installed Firefox (yum --enablerepo=remi install firefox). I also installed Xserver (yum install xorg-x11-server-Xvfb) as I wasn't sure if it was included in the minimal OS install.

I then export DISPLAY= and then tried to start firefox but it said:

Error: can't open display:

What do I need to do to get firefox to display?

  • Do you want Firefox to place its windows on the Mac or inside the CentOS window? – Mark Plotnick Jun 29 '14 at 14:26
  • why not download files using wget – debal Dec 20 '16 at 12:12
  • Xvfb is a virtual frame buffer and is not going to help you. wget/curl is your best bet if you want to stick as close as you can to the minimal package group you installed initially. – MikeA Nov 6 '18 at 4:05

Try doing this:

$ export DISPLAY=

Then run Firefox again. Also be sure to run xhost + on the host so that it's able to accept X applications being "sent" to it from other servers. This method is considered poor from a security stand point but is perfectly fine to use to confirm things are working properly. With that working, spend a bit more time considering your security posture in this use case and do something a bit more explicit using xhost +someremoteserver instead.

Also you could use ssh to tunnel the X application instead of using xhost. There's typically a bit of a performance hit but it's often tolerable and worth it in my opinion.

$ ssh -X someremoteserver firefox

excerpt from ssh man page

 -X     Enables X11 forwarding.  This can also be specified on a per-host 
        basis in a configuration file.
  • Actually using export DISPLAY= had no impact. Still get error: cannot open display when issuing the firefox command at a command prompt. I also started xhost + on my host first, which started up an instance of X Windows (I think that's what happened, this is a little new to me). – Jazzmine Jun 29 '14 at 0:29
  • @Jazzmine - you have to run the command xhost + on as well. The permission denied is the other server disallowing the Firefox window from being sent. – slm Jun 29 '14 at 0:31
  • Ok, I just ran xhost + on the guest (VM) terminal and it automatically responded with xhost: Unable to open display "" – Jazzmine Jun 29 '14 at 0:35
  • And a little bit more info: i got my ip address from the VM's ifconfig command and selected the inet ip address. Sound good? – Jazzmine Jun 29 '14 at 0:37
  • @Jazzmine - you ran xhost + on the host with the actual desktop, right? – slm Jun 29 '14 at 0:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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