Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

X11 Forwarding with PuTTY UNIX
PuTTY is an open-source, multi-platform SSH, Telnet, Rlogin and serial interface terminal emulation application with a host of configuration items. PuTTY can be operated from a GUI or the command-line. It is currently available for the Mac using the MacPorts environment. X11 forwarding, a tunneling function under SSH, is confused by the Leopard and later X11 DISPLAY string. This can simply be worked around by setting the 'SSH' menu » X display location item, to :0.

The SSH protocol provides a secure (encrypted) data channel between two points commonly used to provide access to interactive sessions but also providing useful functionality in X Window System (X11) tunneling and TCP port forwarding.

With X11 tunneling the target display server is determined from the originating host's DISPLAY data (commonly set and provided as a shell environment variable). This data is essentially a string and contains three delimited parts:
  • A host name or IP address,
  • A colon and a display number (commonly zero),
  • A period and a screen number.
There are meaningful defaults for each if absent. Typically this looks like

Leopard brought a previously additional, externally supported X Window System package into the official Apple distribution. With that it became somewhat more Mac-like and integrated into the launchd environment allowing X11 applications to be supported without explicit action by the user. As part of that infrastructure the DISPLAY data includes a string interpreted by launchd. This string occurs in the location traditionally used as the host name (or IP address). Typically this looks like


PuTTY during its internal processing attempts to resolve the host name component if present. If absent it defaults to the local host. When processing the X11 DISPLAY data it parses out the host component (/tmp/launch-j0aS4K/org.x in the above example) and then of course fails to resolve that as a host name which results in broken X11 forwarding.

Explicitly providing :0 as display data (on the command-line or in the 'X display location' configuration item) overrides the originating host DISPLAY data and as it does not contain a host component defaults to the local host working around the OS X DISPLAY quirk.

[crarko adds: I haven't tested this one. There is further discussion of this in this thread in the forums.]
  • Currently 2.00 / 5
  You rated: 1 / 5 (7 votes cast)

X11 Forwarding with PuTTY | 4 comments | Create New Account
Click here to return to the 'X11 Forwarding with PuTTY' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
X11 Forwarding with PuTTY
Authored by: timrand on Nov 29, '10 08:57:50AM

For many years, I've used Tynsoe's SSH Tunnel Manager for this. It's much easer to setup and manage than doing it with PuTTY.

[ Reply to This | # ]
X11 Forwarding with PuTTY
Authored by: asmeurer on Nov 29, '10 11:02:36AM
I never knew PuTTY was available on the Mac. I've always known it as the Windows SSH tool. Really, in most cases, just typing ssh -X HOST should be enough to do your X11 forwarding. This will open X11 (or XQuartz), and you can run GUI programs by typing their name in the command line (sometimes, you access the GUI by adding an x before the name of the program, for example, the command line version of Maple is maple, but you can get the GUI by typing xmaple. Also, adding an & to the end of the command is recommended so that you are not locked out of the command line while the program is running.

[ Reply to This | # ]
X11 Forwarding with PuTTY
Authored by: lithoman on Nov 29, '10 01:54:35PM

The command should be ssh -Y, not ssh -X. ssh -Y is trusted forwarding. Allowing is -X is a security hole and may be disabled on the host and is subject to the X11 SECURITY extension

[ Reply to This | # ]
X11 Forwarding with PuTTY
Authored by: Hes Nikke on Dec 02, '10 09:53:04AM
I've found that I can only get X11 forwarding to work between my linux clients to my mac server (remember with X11, your display is the server and the app is the client) by doing
ssh -XY user@host
PS: WTF is with making me wait 45 seconds before i can look at an updated PREVIEW?! what happened to the Mac OS X Hints that I knew and loved 10 years ago ?! :(
vacuums do not suck. they merely provide an absence that allows other objects to take the place of what becomes absent.
Edited on Dec 02, '10 09:54:15AM by Hes Nikke

[ Reply to This | # ]