Setting up an XServer on Windows

This FlashGuideTM describes how to set up an X Window Server on Win32 platforms using Cygwin and Cygwin/X. Cygwin is a port of the GNU tool so the Windows environment. It gives you a complete Unix environment with compilors, editors and applications. Cygwin/X is a port of the X Window System to Win32 platforms.


1. Installing Cygwin on Windows

  1. Download the Cygwin setup file from http://cygwin.com.
  2. From a Command Prompt, execute the setup file - it should be called "setup.exe"
  3. The Cygwin setup window will appear to guide you through the installation process.
    1. For the screen "Choose a Download Source", click "Install from Internet"
    2. For the screen "Select Root Install Directory", the default of c:\cygwin should be fine for most installations (we'll refer to that here as $CYGWIN_HOME)
    3. For the screen "Select Local Package Directory", the default should be fine
    4. For the screen "Select Your Internet Connection", choose as approprate
    5. For the screen "Choose A Download Site", select pretty much anyone you want (theoretically the one closest to you, if you know)
    6. For the screen "Select Packages", you can choose any packages you want. The suggest defaults are already preselected. Regardless of what else you choose, you must choose the following from the X11 category:
      • X-startup-scripts
      • xorg-x11-xwin
      • xterm
    7. Click "Next" to begin the download. You will see various messages are your packages are downloading.

2. Starting Cygwin/X

There are two ways of starting the Windows X Server, shown below.

  1. Starting from DOS
    1. Make sure %CYGWIN_HOME%\usr\X11R6\bin is in your %PATH%, where %CYGWIN_HOME% refers to the directory into which you installed Cygwin (default is c:\cygwin)
    2. Run startxwin.bat (which is in %CYGINW_HOME%\usr\X11R6\bin). This will launch the X server, xterm, and a Window Manager
  2. Starting from a Cygwin shell
    1. Open up a Cygwin shell (generally by double-clicking on %CYGWIN%\cygwin.bat) and type:
        
      cp /etc/X11/xinit/xinitrc ~/.xinitrc
      /usr/X11R6/bin/startx
          

3. Running X Windows programs from another machine

If you have a headless Unix box that you want to run X Windows programs on, you can do so by having the programs display on your local Win32 machine. Once you have started the X Windows Server, follow these steps.

  1. From a local Cygwin shell window, type the following:
    xhost +
      

    This will enable any remote machine to connect to your local X Windows Server. To only allow a specify host, type "xhost ".

  2. On the remote machine, type the following (substitute your actual IP address for placeholder):
    export DISPLAY=:0.0
      
  3. Now run your X Windows program on your remote server and the screens will display on your local machine.
  4. If you have a full screen X Windows, you can type "Alt-F4" to close it.


Back to Table of Contents