linux - X11 转发 : Bad File Number Error?

标签 linux ssh cygwin x11

我的本​​地计算机 (Windows 7) 上运行着 XWin 服务器。当我打开一个 cygwin shell 并输入 emacs 时,emacs 的图形显示如预期的那样出现。
现在我尝试让一个远程应用程序显示在我的本地机器上。在 cygwin 中,我输入:

ssh -X root@.....

(我也尝试过 ssh -Y root@...,结果相同。)我使用密码登录,然后收到这条有趣的消息:

/usr/bin/xauth:  creating new authority file /root/.Xauthority

然后我尝试打开xeyes。这是我希望在我的本地计算机上弹出一个窗口的地方,它的眼睛会跟随鼠标光标。相反,我收到了一些神秘的错误消息:

root@debian:~# xeyes
connect /tmp/.X11-unix/X0: Bad file number
Error: Can't open display: localhost:10.0

这是我在 Linux 上的故障排除能力的范围:

root@debian:~# echo $DISPLAY
localhost:10.0

我是 Linux 的新手。我怎样才能让远程服务器知道我本地的 XWin 服务器?看起来应该很简单,因为我已经通过 ssh 建立了连接。

更新
所以我猜 cygwin 有这个“特性”,如果你将 DISPLAY 设置为 :0,它意味着不同于 localhost:0 的东西。按照建议将 DISPLAY 设置为 127.0.0.1:0 或 localhost:0 将解决问题。

最佳答案

您在 Cygwin 之外使用 XWin,这可能会导致问题。尝试按照此处的建议设置您的 DISPLAY=127.0.0.1:0:

http://cygwin.com/ml/cygwin-xfree/2002-10/msg00065.html

在“将 Cygwin 的 OpenSSH 与 XWin-32 结合使用”下

关于linux - X11 转发 : Bad File Number Error?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7941012/

相关文章:

python - 使用 Python 校正日期和时间

bash - 在bash中输入多行重定向后如何重定向输出?

ssh - Ansible 无法连接到 AWS EC2 实例

git - 无法使用 SSH 代理转发运行 git 命令

c - 通过命令行在Cygwin环境中启动C程序

c++ - 将 gcc 与 Netbeans 一起使用

linux - 克罗恩 : Scheduling task

linux - sed:未终止的地址正则表达式

python - Matplotlib-动画 "No MovieWriters Available"

windows - Windows 上的 Apache Nutch