Linux 无法在 xserver 客户端上显示 xclock 程序 - Mobaxterm
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18600961/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Cannot display xclock program on xserver client - Mobaxterm
提问by sotn
I am using Mobaxterm(free version) on a windows 7 desktop to connect to a SUSE 11 Enterprise server on AWS. I am trying to display the xclock program on my xtrem client but I get an error saying 'Error: Can't open display:'. I have used the following syntax to set the display on the server:
我在 Windows 7 桌面上使用 Mobaxterm(免费版)连接到 AWS 上的 SUSE 11 Enterprise 服务器。我试图在我的 xtrem 客户端上显示 xclock 程序,但我收到一条错误消息,提示“错误:无法打开显示:”。我使用以下语法来设置服务器上的显示:
export DISPLAY=<IP_addr>:0.0
SUSE 11 does not come with xclock by default so I had to download it and install it. The hosts file on my PC has the localhost entry commented out, I am not sure if that would make a difference. Any ideas on how to debug this? Thanks.
默认情况下,SUSE 11 不附带 xclock,因此我必须下载并安装它。我的 PC 上的主机文件已注释掉 localhost 条目,我不确定这是否会有所作为。关于如何调试这个的任何想法?谢谢。
采纳答案by sotn
Fixed!
固定的!
Earlier I was just looking at xclock program's error msg. But when I scanned Mobaxterms client terminal's output, I found the following msg:
早些时候我只是在看 xclock 程序的错误消息。但是当我扫描 Mobaxterms 客户端的输出时,我发现了以下信息:
X11 forwarding request failed on channel 0
After some google hunting, found that one of the reasons this happens is when xauth package is not installed on the remote server. So, I checked and found that to be the case. This is the command I ran:
经过一番谷歌搜索,发现发生这种情况的原因之一是远程服务器上未安装 xauth 包。所以,我查了一下,发现确实如此。这是我运行的命令:
zypper in -name xorg*
This command tells you if the package is installed and if any dependencies exist. The package comes bundled with the xclock program. So zypper uninstalled the other xclock I had installed from another source and replaced it with the right version.
此命令告诉您软件包是否已安装以及是否存在任何依赖项。该软件包与 xclock 程序捆绑在一起。所以 zypper 卸载了我从另一个来源安装的另一个 xclock 并将其替换为正确的版本。
Link to package info: https://www.suse.com/LinuxPackages/packageRouter.jsp?product=server&version=11&service_pack=&architecture=i386&package_name=xorg-x11-xauth
包信息链接:https: //www.suse.com/LinuxPackages/packageRouter.jsp?product=server&version=11&service_pack=&architecture=i386&package_name=xorg-x11-xauth
I also modified a file called /etc/ssh/sshd_config as root. The following lines need to be uncommented:
我还以 root 身份修改了一个名为 /etc/ssh/sshd_config 的文件。以下几行需要取消注释:
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
And X11UseLocalhost was changed to 'no'. I also changed my security group on AWS to let inbound traffic on port 6000. I am not sure if that matters.
并且 X11UseLocalhost 已更改为“否”。我还更改了 AWS 上的安全组,以允许端口 6000 上的入站流量。我不确定这是否重要。
After this mobaxterm automatically set my display parameter to localhost and I was able to run xclock on the remote server and see it on my local PC desktop.
在此 mobaxterm 自动将我的显示参数设置为 localhost 之后,我能够在远程服务器上运行 xclock 并在我的本地 PC 桌面上看到它。