Sai*_*irl 13 x11 x11-forwarding
我在Windows7机器上,我试图让firefox在centOS机器上打开,但是显示在我当前的屏幕上.firefox在终端中输入时,我收到以下错误:
Error: cannot open display: localhost:0.0
Run Code Online (Sandbox Code Playgroud)
为了设置显示器,我使用了命令
$ export DISPLAY=localhost:0.0
Run Code Online (Sandbox Code Playgroud)
有些网站建议使用以下内容,但它也不起作用:
$ export DISPLAY=:0.0
Run Code Online (Sandbox Code Playgroud)
我正在使用PuTTY,我Enable X11 forwarding选中了复选框,XMing正在Windows上运行.此外,centOS文件上的sshd_config似乎也正确设置:
$ cat /etc/ssh/sshd_config |grep -i x11
#X11Forwarding no
X11Forwarding yes
#X11DisplayOffset 10
X11UseLocalhost yes
Run Code Online (Sandbox Code Playgroud)
我查看了很多页面并搜索了StackOverflow,但没有一个能够以任何方式帮助我.先感谢您.
Sai*_*irl 15
因此,事实证明X11实际上并未安装在centOS上.似乎没有任何迹象表明没有安装.我做了以下命令,现在firefox打开:
yum groupinstall 'X Window System'
Run Code Online (Sandbox Code Playgroud)
希望这个答案会帮助其他困惑的人:)
我曾经遇到过这个问题,并且能够通过修复我的 /etc/hosts.conf 来解决它。它只是无法解析本地主机名称...详细信息在这里:http : //itvictories.com/node/6
事实上,有 99% 的错误与 /etc/hosts 文件有关
X 服务器只是无法解析本地主机,所有后续操作都失败了。
请确保您有这样的记录
127.0.0.1 localhost
Run Code Online (Sandbox Code Playgroud)
在您的 /etc/hosts 文件中。