Friday, October 14 2005: X11 Forwarding
Well I've finally got X11 Forwarding working on my Cygwin installations. In fact, I'm typing this into an xterm window running a bash shell on my home machine, with the display showing up on my work machine. (The tricky part, that I wouldn't have figured out without Google was that the XWIN server must be running on *both* ends of the connection.) I now realize that there's not much I can do with my new found remote X skills because outside of xterm there's not really any other applications that run under Cygwin/X. It was an interesting xercise, though. For the 3 of you that will hit this page through a Google search on "X11 Forwarding" "Cygwin" here's what I did to get it working:
- Install Cygwin (including Cygwin/X) on your work machine, marvin.
- Install Cygwin (including Cygwin/X and OpenSSH) on your home machine, eddie.
- Configure SSHD on eddie, making sure no firewalls are blocking the SSH port. In sshd_config you need the entry X11Forwarding Yes
- Startup the XWin server by running startxwin.bat or startxwin.sh on both marvin and eddie. I recommend commenting out the penultimate command that invokes xterm, so that the script just runs XWin in its multi-window mode (both scripts are in /usr/X11R6/bin/).
- On marvin, download PuTTY and setup a session pointing to eddie. In the Connections>SSH>Tunnels section make sure "Enable X11 Forwarding" is checked.
- Open the Session you setup above and logon to eddie.
- In the bash shell running on eddie (i.e., in the puTTY window) type xterm &, to open up an xterm window that displays on marvin (but which is running its shell on eddie).