我使用xquartz从Mac机器登录到Ubuntu服务器。使用ssh -X <username>@<ip>
命令登录后,我试图启动nautilus
,但它一直给出以下错误:
Unable to init server: Could not connect: Connection refused
(nautilus:14914): Gtk-WARNING **: 14:05:38.090: cannot open display: 0:0
理想情况下,xquartz应该相应地设置适当的显示。但一些问题正在发生。我还尝试了以下命令:
launchctl load -w /Library/LaunchAgents/org.macosforge.xquartz.startx.plist
但没有成功。
验证您的(OS/X(XQuartz安装
$> brew info xquartz
xquartz: 2.8.1 (auto_updates)
https://www.xquartz.org/
/usr/local/Caskroom/xquartz/2.8.1 (103.5MB)
...
验证你的.ssh_config:
$> cat .ssh/config
Host *
ForwardX11 yes
ForwardX11Trusted yes
ForwardAgent yes
启动X11应用程序或服务:
$> launchctl start org.xquartz.startx
$> launchctl list | grep -i quart
96701 -9 org.xquartz.startx
导出X11服务器:
$> export DISPLAY=:0
连接到远程主机并测试:
$> ssh -Y remote_host
Last login: Mon Apr 26 13:14:01 2021 from host
$> xclock