Tim Evans Tips for X-Windows on a PC

Tim Evans Informal Home Page | Tim Evans Imperial College page

Using SSH

To connect to an X-windows box from a MS Windows machine (e.g. connecting to a Unix server called plato) use Cygwin (installed on college machines by default) or possible the eXceed programme found on some MS Windows machines. This advice came by searching on Google for "unix windows" "from a pc" and in particular from the Using eXceed instructions of the Univ. Newcastle.
  1. First you must configure the "Secure Shell Client" on the PC. Similar instructions work for any modern terminal client. See the VNC example below for examples using cygwin and putty You should need to do this only once but if you have problems try repeating this procedure.
  2. Now start the X windows server on the PC, so this can take the WX Windows being run on the Unix box. Do this by running the startwin.bat (under Windows OS) command usually found in the C:\cygwin\usr\X11R6\bin\. Find this file and just double click on it from MS Windows. You should see an "X&\quot; symbol appear in the lower right box of the PCs task bar
  3. Start SSH client by going to
    Start -> All Programs -> SSH Secure Shell -> Secure Shell Client
    Use it to connect to the Unix box required e.g. plato. To do this for the first time click on Quick Connect. In the box which appears enter the name of the system you want to connect to (e.g. plato.tp.ph.ic.ac.uk) and enter your Unix username, then click on Connect. You should shortly be prompted for your Unix password. It may ask you to store these details as a profile. Do so if you want to save time next time as you can just select the profile (e.g. call the profile plato). When connecting to a remote host for the first time, you will be sent its &\quot;public key fingerprint&\quot; and invited to save it in a local database: you should only need to do this once.
  4. You now have an SSH window in which you can execute normal UNIX commands on the chosen host. Now when a Unix application tries to open an Xwindow it will appear on the PC. For instance to open an XEmacs window type
    xemacs &
To exit from a UNIX X-Windows session, click on the Disconnect icon in the SSH toolbar and then File, Exit to close the window. If appropriate, close down the X server on your PC by right-clicking on the Cygwin X server (or equivalent Exceed program) in the Windows task bar and choosing Close.

Using VNC

This turns your PC screen into a complete X-Windows desktop. (This advice came from Gavin Nicholson).
To get VNC (Virtual Network Computing) to work you need installed on your computer both SSH and VNC clients. We will assume that a VNC server is installed on the Unix box (type vncserver -h on the Unix box to see if it is). The standard Imperial College installation of Windows comes with some or all of cygwin, putty, SSH Secure Shell, any of them will do to create the connection to the Unix box. For VNC on the WIndows machine, try the free VNC client called UltraVNC. The instructions here are for connection to an X-Windows machine called plato. We will also refer to a general VNC server display number which is some low positive integer e.g. 4. We will refer to this number below as xx.
  1. Step 1 - SSH
    In SSH Secure Shell:
    In Putty:
    In Cygwin: Once you have a terminal window plato using any of these methods, with the tunneling set up as indicated above, you need to start VNC session number xx (unless its already running) by typing on plato
    vncserver -geometry 1280x800 -depth 16 :xx
    The option geometry gives you the screen resolution and depth the number of colours (in powers of 2). Find this by right clicking on the Windows background screen, select properties from the menu then the Settings tab. Colour quantity tells you the colour depth (e.g. here it would be 16 bit) and the screen resolution is also displayed.
  2. Step 2 - VNC Viewer
    Install your chosen VNC client and make sure its server service is running. Then in the UltraVNC Viewer (Start -> All Programs -> UltraVNC ->UltraVNC Viewer) you then simply type in localhost:1 in the VNC Server box and click Connect
Useful vncserver commands on the Unix server are
vncserver -kill :xx to kill a display
vncserver -h to display help