Loading...
 

Using Cygwin for remote use of Huygens




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:
  1. Go to the Cygwin/X homepage: http://x.cygwin.com.
  2. Click on Install Cygwin/X now and run the setup.exe.

During the installation:
  1. Select Install from Internet
  2. Select the path where you want to install Cygwin (preferably a directory without spaces, e.g. but c:\cygwin).
  3. Select who should be able to use Cygwin (All Users or Just Me)
  4. For Default Text File Type select DOS
  5. Select a location where the files that will be downloaded for installation should be stored (different from the installation directory above).
  6. Select Direct Connection
  7. Select a Download site nearby.
  8. 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
  9. 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

  1. Open the Windows File Explorer and navigate to the directory where Cygwin is installed (for example C:\Cygwin).
  2. Copy the file .\usr\X11R6\bin\startxwin.bat to .\usr\X11R6\bin\huygens.bat.
  3. Open the file .\usr\X11R6\bin\huygens.bat with notepad.
  4. Scroll down to the line that reads
    /run xterm -e /usr/bin/bash -l
    and replace the end with
    /run xterm -e /usr/bin/ssh -Y -C "user@server" essential
    Replace user with your username and server with the server name or ip address. essential is to start Huygens Essential, for Huygens Pro type huygenspro instead, for Huygens Scripting type huscript.
  5. 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:

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


Next, run
ssh-host-config -y
to create the service, set up the ssh host keys and create the 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.