With lots of trial and error and some googling, I finally managed to get CygWin/X running on my Windows box work with my Fedora Core2 Linux system. The steps are actually quite simple:
1. start the X in multiwindow mode from cygwin's bash prompt:
$ X -multiwindow &
This would run the X server in the background, showing an X icon in the Windows system tray (also known as notification area). The root X window is hidden.
2. launch xterm on the local machine:
$ xterm -display localhost:0 &
This opens an x window on the local machine.
3. From this X window, ssh into the remote Linux system:
$ ssh -X -l <user> <linux-host>
Now, any program with GUI run from this window on the remote system will open a window on the local machine. Simple, isn't it!
So, why did it take me signficant amount of trial and error and googling?
Perhpas I was misled by the ease with which CygWin/X works with an HPUX system:
$X -query <hpux-host>
This doesn't work for Linux. The explanation I found is that the above command requires xdm daemon to be running on the target host, which is disabled by default on most Linux systems (for security reasons). Apparently, the steps to enable and run xdm are not very straightforward and I gave up after a couple of false starts.
Other route I tried was to run X server on the local machine, then ssh into the remote Linux machine from a Windows command window, set the DISPLAY env. variable and then run an X program from the ssh session. This used to show the following error on the remote Linux machine:
Xlib: connection to "<local-host>:0.0" refused by server
Xlib: No protocol specified
xterm Xt error: Can't open display: <local-host>:0
And the following message on the local machine:
AUDIT: Wed Sep 22 23:52:18 2004: 2040 X: client 1 rejected from IP 192.168.1.103
These messages had me baffled for quite a while! But now that I know how to make things work, even these error messages make sense.