3

I installed a program wireshark on my remote linux box and I'm trying to run it with X11 from my mac computer using SSH. Here's my terminal...

macosx$ echo $DISPLAY
/tmp/launch-f4w6k6/:0

macosx$ ssh -X root@myserver.com
root@myserver.com's password: 

remoteubuntu:~# echo $DISPLAY

remoteubuntu:~# wireshark

(wireshark:18927): Gtk-WARNING **: cannot open display: 

Here's a few lines from /etc/ssh/sshd_config

X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no

Thanks for the help!

5 Answers5

5

X11 is not installed in MacOS X Lion. MacOS X Lion users have to install XQuartz for ssh -X or -Y to work.

For reference: About X11 and OS X Mountain Lion

Irmak Cakmak
  • 151
  • 1
  • 1
  • +1 This was the only resource that I could find anywhere that mentioned this, and it was **exactly** what I needed to solve my problem. When I tried `ssh -X -v` on my system, `xauth` did not appear ANYWHERE in the output.... Then I installed XQuartz. One logout/login later, and it all Just Works. –  May 21 '13 at 22:06
3

Try the -Y option for X11 forwarding instead it disables some X11 security checks and tends to work better from OSX.

Zoredache
  • 128,755
  • 40
  • 271
  • 413
  • 4
    In addition to trying `-Y`, also make sure that your remote system has the `xauth` binary available: ssh **requires** that binary in order to successfully set up forwarding. – voretaq7 Apr 29 '10 at 19:36
  • 1
    Actually... the only thing I had to do was install xauth. It works with or without the -Y option now. Thanks! –  Apr 30 '10 at 02:40
0

You don't have an X server running on your local system. Don't use Terminal.app(the one with a black icon) to start your SSH session; instead, use X11.app(the one with a white icon). On my system, it's in /Applications/Utilities/X11.app.

Kevin M
  • 2,302
  • 1
  • 16
  • 21
0

Xnest -geometry 1024x768 :1& DISPLAY=:1 ssh -Y ipoftheserver gnome-session work well !

0

Another important thing: if you install xquartz via homebrew, you should relogin your macos or reboot.

As the rackpas's answer saying.

Nico
  • 1