问题
当我SSH到远程主机时$ ssh -X remotebox
然后在远程机器上启动Firefoxremotebox$ firefox
我在本地机器上可以运行Firefox,Firefox窗口将打开,但远程机器上没有运行Firefox进程。
为什么打开本地的Firefox窗口?
我本地系统的更多信息。Linux lesmana-laptop 2.6.32-24-generic #42-Ubuntu SMP Fri Aug 20 14:24:04 UTC 2010 i686 GNU/Linux
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.04.1 LTS
Release: 10.04
Codename: lucid
DISPLAY=:0.0
Mozilla Firefox 3.6.8, Copyright (c) 1998 - 2010 mozilla.org
远程主机的信息。Linux dxray 2.6.22.19-0.4-default #1 SMP 2009-08-14 02:09:16 +0200 x86_64 x86_64 x86_64 GNU/Linux
LSB Version: core-2.0-noarch:core-3.0-noarch:core-2.0-x86_64:core-3.0-x86_64:desktop-3.1-amd64:desktop-3.1-noarch:graphics-2.0-amd64:graphics-2.0-noarch:graphics-3.1-amd64:graphics-3.1-noarch
Distributor ID: SUSE LINUX
Description: openSUSE 10.3 (X86-64)
Release: 10.3
Codename: n/a
DISPLAY=localhost:15.0
Mozilla Firefox 3.0.14, Copyright (c) 1998 - 2009 mozilla.org
以下命令使用远程firefox窗口启动远程firefox会话。remotebox$ firefox -no-remote
以下命令产生短暂的延迟,然后放回prompt并弹出一个本地Firefox窗口,远程主机上没有运行Firefox进程。remotebox$ firefox
远程主机的信息。Linux marvin 2.6.31-22-generic #60-Ubuntu SMP Thu May 27 00:22:23 UTC 2010 i686 GNU/Linux
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 9.10
Release: 9.10
Codename: karmic
DISPLAY=localhost:11.0
Mozilla Firefox 3.6.8, Copyright (c) 1998 - 2010 mozilla.org
在远程主机上,以下命令按预期启动远程Firefox会话。remotebox2$ firefox
答案1
firefox -no-remote,另一个参数是firefox -no-xshm
由于X11协议是网络透明的,"共享内存"也被扩展到远程X11客户端。
答案2
你也可以添加:MOZ_NO_REMOTE=1
export MOZ_NO_REMOTE
答案3export DISPLAY=:0
这会将默认显示更改为当前桌面屏幕的显示。然后输入firefox
在桌面窗口中生成Firefox,确保已经登录到桌面,如果没有登录,你会得到以下错误;firefox: cannot connect to X server :0
此方法同样适用于锁定的桌面,请确保你已经使用相同的用户名登录到桌面和ssh shell。
当有多个桌面会话时,每个会话由一个不同的数字标识为:0,:1,:2,等等。
答案4
你需要在一个单独的进程中运行Firefox,就像在本地机器上执行一样,使用配置文件管理器创建新配置文件,如下所示。export MOZ_NO_REMOTE=1
firefox -ProfileManager
答案5
简单远程浏览
如果你想在本地浏览web,就像坐在远程框的前面一样:$ ssh -X username@remote.example.com
然后,在远程终端会话中运行Firefox:$ firefox https://test-ipv6.com/
注意-X标志在ssh命令中的用法,您也可以一次完成两个步骤,如下所示:$ ssh -X username@remote.example.com firefox http://test-ipv6.com/
相关文章