I am on a Windows7 machine and I'm trying to get firefox to open on the centOS machine, but be displayed on my current screen.
When typing firefox
in terminal, I am getting the following error:
Error: cannot open display: localhost:0.0
To setup the display I used the command
$ export DISPLAY=localhost:0.0
Some site suggested using the following, but it didn't work either:
$ export DISPLAY=:0.0
I am using PuTTY and I have the Enable X11 forwarding
check box checked and XMing is running on Windows. Additionally, the sshd_config on centOS file seems to be setup properly as well:
$ cat /etc/ssh/sshd_config |grep -i x11
#X11Forwarding no
X11Forwarding yes
#X11DisplayOffset 10
X11UseLocalhost yes
I've looked over numerous pages and searched StackOverflow as well, but none have managed to help me in any way. Thank you in advance.
So, it turns out that X11 wasn't actually installed on the centOS. There didn't seem to be any indication anywhere of it not being installed. I did the following command and now firefox opens:
yum groupinstall 'X Window System'
Hope this answer will help others that are confused :)
I faced this issue once and was able to resolve it by fixing of my /etc/hosts. It just was unable to resolve localhost name... Details are here: http://itvictories.com/node/6
In fact, there is 99% that error related to /etc/hosts file
X server just unable to resolve localhost and all consequent actions just fails.
Please be sure that you have a record like
127.0.0.1 localhost
in your /etc/hosts file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With