Using the Cygwin X server and ssh
When working on a remote machine through ssh it may sometimes
be useful to display a remotely generated plot on your local machine.
This is possible when you have a local X server running,
and your ssh connection can forward graphics display commands from
the remote machine to your local machine.
The easiest way to achieve this on Windows is by using the
Cygwin tools.
To set this up, first download the Cygwin installer from https://www.cygwin.com/.
Run the installer to set up the base system.
This will add the Cygwin terminal to your start menu.
Make sure you can start this and run simple commands such as ls
in the terminal.
Then, run the installer again and select packages openssh,
xorg-server, and (for testing) xeyes.
(Select Full in the drop-down list at the top left,
enter search terms in the Search field, and for each
package you want to install choose the version number from
the associated drop-down list instead of Skip.)
To start the X server, open a Cygwin terminal and
type
X -multiwindow
You can then minimize the terminal window, but don’t close it,
otherwise the X server will terminate.
To verify that the X server is running correctly, open a
second Cygwin terminal and type
export DISPLAY=:0
xeyes
This should open a follow-the-mouse demo in a separate window.
If this works, you can terminate xeyes again (either by closing its
window or by pressing Control-C in the terminal window).
Now you can connect to a remote machine from the second terminal, using
ssh with the -Y option (X11 forwarding),
for example
ssh -4 -Y user@ltsp05.usm.uni-muenchen.de
Note that to reach this machine, you need to have a
VPN connection to the Munich university
network.
Once you have authenticated with the correct password you can check
that the graphics forwarding works, by entering xeyes
at the remote prompt.
This should open the follow-the-mouse demo on your screen just like
it did for your locally installed version.
|