Using Cygwin for remote use of Huygens
Table of contents
Cygwin/X is a port of the X Window system to the Microsoft Windows. Cygwin/X runs well on most versions of Windows. The X Window system allows to foward applications through the network over an SSH connection.
Cygwin is a solution for remote display using a Unix server and Windows client. See RemoteDisplay for other ways to display the Huygens user interface over a network.
Installation
To start the installer:
- Go to the Cygwin/X homepage: http://x.cygwin.com.
- Click on Install Cygwin/X now and run the setup.exe.
During the installation:
- Select Install from Internet
- Select the path where you want to install Cygwin (preferably a directory without spaces, e.g. but
c:\cygwin
). - Select who should be able to use Cygwin (All Users or Just Me)
- For Default Text File Type select DOS
- Select a location where the files that will be downloaded for installation should be stored (different from the installation directory above).
- Select Direct Connection
- Select a Download site nearby.
- Choose what packages to download. The packages that you need for running huygens remotely are:
- Category Net:
- inetutils
- openssh
- Catergory X11
- X-startup-scripts
- xorg-x11-base
- Category Net:
- When all desired packages are selected click 'Next'
The Installer will now download and install the software. After finishing the installation, the installer will ask whether you want to create icons on your desktop and in the start menu.
Remote Display
To run huygens on a computer named server and display the user interface on the Windows client, double click the Cygwin XTerm icon. In the XTerm console window type ssh -X server
, enter your password for the server, and type e.g. huygenspro
to launch Huygens Professional:
user@client:~$ ssh -X server Password: Last login: Thu Dec 2 17:54:36 2010 from client.svi.nl Have a lot of fun... user@server:~> huygenspro
Start Huygens by a Double Click
- Open the Windows File Explorer and navigate to the directory where Cygwin is installed (for example
C:\Cygwin
). - Copy the file
.\usr\X11R6\bin\startxwin.bat
to.\usr\X11R6\bin\huygens.bat
. - Open the file
.\usr\X11R6\bin\huygens.bat
with notepad. - Scroll down to the line that reads and replace the end withCopy to clipboard/run xterm -e /usr/bin/bash -lReplaceCopy to clipboard/run xterm -e /usr/bin/ssh -Y -C "user@server" essential
user
with your username andserver
with the server name or ip address.essential
is to start Huygens Essential, for Huygens Pro typehuygenspro
instead, for Huygens Scripting typehuscript
. - Make a shortcut to
huygens.bat
(right-click→create shortcut) on your desktop.
Double click the shortcut icon and the X11 connection will start, enter your password and Huygens will start automatically.
Uninstallation of Cygwin
In case you want to de-install Cygwin on your computer please have a look here:
- http://cygwin.com/faq/faq-nochunks.html#faq.setup.uninstall-all
Install Cygwin SSH daemon
If you have already installed cygwin with its SSH components on a Windows computer, you can now make the SSH daemon run as a service to allow SSH connections to that machine. Note that this is not necessary for remote display.
Instructions for this can be found on multiple sites:
- http://pigtail.net/LRP/printsrv/cygwin-sshd.html
- http://pigtail.net/LRP/printsrv/vista-cygwin.txt
- http://ist.uwaterloo.ca/~kscully/CygwinSSHD_W2K3.html
Installing the SSH daemon service
Login as Administrator and double click the Cygwin icon, or right click the Cygwin icon and choose Run as Administrator, as many of the following operations require administrator privileges.
With some releases of cygwin, there are permission problems. Type these three commands to fix some permission settings:
chmod +r /etc/passwd chmod +r /etc/group chmod 755 /var
ssh-host-config -y
sshd_config
file in /etc/
. Note that two local users may be created, one called sshd to handle privilege separation and one that is required on some Windows versions called sshd_server that runs the service in order to use public key authentication.
- If the script asks you about privilege separation, answer yes.
- If the script asks to create a local user sshd on this machine answer yes.
- If the script asks to install sshd as a service answer yes.
- If the script asks to reate a new local account ssh_server which has the required privileges answer yes.
Firewall configuration
If you have a firewall installed, you will need to open port 22. In Vista, go to the Control Panel, select Windows Firewall, and open inbound TCP port 22.
Running the sshd service
You can start the service from Services in the Control Panel, or using either of these commands in the Cygwin terminal:
net start sshd cygrunsrv -S sshd
Avoiding typing passwords
You can connect to a computer allowing ssh connections without having to type your password each time if you first exchange security keys. See ScpBatchMode for more info.