guptasonal
guptasonal

Reputation: 23

Cannot open GUI applications with XQuartz mac

I am using xquartz to login to an Ubuntu server from a Mac machine. After logging in using ssh -X <username>@<ip> command, I am trying to launch nautilus but it keeps giving the following error:

Unable to init server: Could not connect: Connection refused

(nautilus:14914): Gtk-WARNING **: 14:05:38.090: cannot open display: 0:0

Ideally, xquartz should have set the appropriate display accordingly. But some problem is happening. I also tried the following command:

launchctl load -w /Library/LaunchAgents/org.macosforge.xquartz.startx.plist

but no success.

Upvotes: 1

Views: 3268

Answers (2)

Walter Fan
Walter Fan

Reputation: 41

I encountered the same problem though I installed xquartz and enabled "ForwardX11"

When I change

export DISPLAY=:0

to

export DISPLAY=localhost:0.0

that works

Upvotes: 0

Andr&#233;s Aquino
Andr&#233;s Aquino

Reputation: 31

Verify your (OS/X)XQuartz installation

$> brew info xquartz
xquartz: 2.8.1 (auto_updates)
https://www.xquartz.org/
/usr/local/Caskroom/xquartz/2.8.1 (103.5MB)
...

Verify your .ssh_config:

$> cat .ssh/config
Host *
    ForwardX11 yes
    ForwardX11Trusted yes
    ForwardAgent yes

Start your X11 app or service:

$> launchctl start org.xquartz.startx

$> launchctl list | grep -i quart
96701   -9  org.xquartz.startx

Export your X11 Server:

$> export DISPLAY=:0

Connect to your remote host and test:

$> ssh -Y remote_host
Last login: Mon Apr 26 13:14:01 2021 from host
$> xclock

Upvotes: 3

Related Questions