【问题标题】:Cannot open display on RHEL无法在 RHEL 上打开显示
【发布时间】:2012-12-17 19:40:13
【问题描述】:

我正在尝试从带有 RHEL 6.2 的桌面客户端 (mydesktop) SSH 到安装了 RHEL 5.8 的服务器 (myserver)。我已经在远程服务器上组安装了“X Window”,远程服务器上的 DISPLAY 变量也设置为 localhost:0.0,但我仍然无法启动 firefox。连接命令是

$ ssh -X -l myname myserver

错误信息是

$ firefox
Error: cannot open display: localhost:0.0

我尝试在下面的myserver上执行命令

$ xhost +localhost

但它给了我一条错误消息

xhost:  unable to open display "localhost:0.0"

我想提三个现象

  1. mydesktop 的另一个用户在登录到 myserver 后能够启动 Firefox。
  2. 当我远程登录到另一台服务器 myserver2 时,我能够启动 Firefox。
  3. firefox 只是一个例子。一般来说,我无法启动任何 x 窗口程序。

我不知道发生了什么。请帮帮我。


这是我的问题的更新。问题已“部分”解决。我所做的是从我的“.bashrc”文件中删除“export DISPLAY==localhost:0.0”,注销然后再次登录,我就可以启动firefox了!!!


然而,这并不是故事的结局。我有一个新问题: $ sudo wireshark

不起作用。这是错误消息:

[myself@myserver ~]$ sudo wireshark
debug1: client_input_channel_open: ctype x11 rchan 2 win 65536 max 16384
debug1: client_request_x11: request from 127.0.0.1 46595
debug1: channel 1: new [x11]
debug1: confirm x11
debug1: client_input_channel_open: ctype x11 rchan 3 win 65536 max 16384
debug1: client_request_x11: request from 127.0.0.1 46596
debug1: channel 2: new [x11]
debug1: confirm x11
X11 connection rejected because of wrong authentication.
debug1: channel 2: free: x11, nchannels 3
The application 'wireshark' lost its connection to the display localhost:10.0;
most likely the X server was shut down or you killed/destroyed
the application.
debug1: channel 1: FORCE input drain

为什么我不能在 sudo 下启动 x 窗口?

【问题讨论】:

  • 你能把 ssh 的输出跟“-v”一起用吗? [详细模式。导致 ssh 打印调试消息...]
  • 已发布。新问题出现。谢谢!

标签: linux firefox x11 redhat


【解决方案1】:

通过以下两件事解决问题:

  1. 从我的 .bashrc 文件中注释掉 export DISPLAY=Localhost:10.0。我认为这是因为我覆盖了DISPLAY 环境变量的默认值。通过这样做,我可以在我的常规帐户下启动“firefox”。
  2. 注销、登录并将export XAUTHORITY='/home/myself/.xauthority 添加到我的.bashrc 文件中。然后注销并再次登录,以便我可以运行sudo wireshark

ssh 命令中的-v 选项在诊断问题时非常有用。

【讨论】:

  • 我要做的第一件事是作为普通用户,xhost +localhost 或任何我的主机名。然后,一旦我输入了sudo su -,我就必须执行您的第 2 步,输入 export XAUTHORITY=/home/myself/.Xauthority(注意大写 X)。
猜你喜欢
  • 1970-01-01
  • 2020-06-03
  • 2015-07-23
  • 1970-01-01
  • 1970-01-01
  • 2015-02-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多