Cygwin/X on Windows XP connecting to FreeBSD 6.2

Prerequisites:

FreeBSD (Base + Autoconf, Automake, Bash and GCC)
OpenSSH - SSH Server running on FreeBSD

Overview: You have a FreeBSD server up and running with an SSH server and now you want to run "UNIX XWindow" type programs and have them displayed on your Windows workstation.  Instead of a commercial (pay money) X Server for Windows like "Exceed" you can run Cygwin/X for free!
     Note: If Cygwin is overkill and you just need a basic SSH client without X11, Putty is free and simple.
              WinSCP is a free SFTP client.


 Step #1 - Download and Install Cygwin/X
 Step #2 - Add C:\Cygwin\bin to the Windows "Path" environment variable
 Step #3 - Create a shortcut to "C:\cygwin\usr\X11R6\bin\startxwin.bat" on your Desktop
 Step #4 - Test out running an "X" application on FreeBSD and display it on Windows XP

Step #1

Cygwin/X – Download and Install

Home: 

 http://x.cygwin.com/

Point your web browser to: http://x.cygwin.com/

Download: http://cygwin.com/setup.exe

Save setup.exe in a directory: C:\Software\Cygwin


Run C:\Software\Cygwin\setup.exe
(Either use "Start" and click "Run" or open the folder and double click setup.exe)

Click "Next" on the welcome screen then select "Install from Internet" and click "Next"


The default "Root Directory" and options are fine click "Next"


The Internet installer Setup.exe will download all packages to place of your choosing, simply click "Next"


Select the correct Internet connection based on your current location and situation and click "Next"


Choose a Download site and click "Next"


Select at least these three (3) items at minimum:
-Net
       openssh
- Shell
        bash
- X11
        xorg-x11-base
You may choose other packages if you know what you are doing, but get at least these 3 and click "Next"




Allow all the Packages to download!


Click "Finish"

 

Step #2

Add the Cygwin binaries C:\Cygwin\bin to the Windows search Path environment variable

"Right" click "My Computer" on your desktop then click "Properties"

Click the "Advanced" tab then click the "Environment Variables" button


Under "System Variables" click "Path" then click "Edit"


Add ;c:\cygwin\bin to the very end of the existing path (note the semicolon to separate new entries)
(click in the value box and use your "right arrow" key and get all the way over)


Click "OK" about three (3) times and you are done!

 

Step #3

Create a shortcut to C:\cygwin\usr\X11R6\bin\startxwin.bat on your Desktop

Create a shortcut to "C:\cygwin\usr\X11R6\bin\startxwin.bat" on your Desktop

 

Step #4

Test out an X Windows application - Run xcalc on FreeBSD and see it displayed in Windows XP

  1. Launch the X server on the Windows Workstation by clicking the "startxwin" shortcut icon on you Desktop.
  2. Type: xhost + <ENTER> in the terminal window that popped open to allow remote connections
  3. Type: ssh 172.28.0.12 <ENTER> to make an SSH connection to the FreeBSD server
  4. Login to the FreeBSD server
  5. Type: DISPLAY=172.28.0.21:0.0 <ENTER> to set the display variable to the IP of your Windows workstation
  6. Type: export DISPLAY <ENTER> to make the variable take effect
  7. Type: xcalc & <ENTER> to start the X Calculator
  8. You should now see xcalc on your workstation (with the math being performed by the server)