linux ssh firefox,如何通过SSH启动远程 Firefox 窗口?

问题

当我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/

相关文章

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值