Friday, March 04, 2005

Cygwin/X displaying remote Xapps on your Win32 Box

I have a Win32 Box at office and miss GNU/Linux. So I started exploring ways of having access to a GNU/Linux box. The options available to me were to run QEMU virtual machine, or have a dual partition. But then each has their advantages and disadvantages

I luckily, had access to a RedHat 9, machine. Again questions raised in my head telnet, ssh, putty, xmanager, or Cygwin/X. As I wanted GUI access to the box, the options I had were xmanager or Cygwin/X

Cygwin/X is a Win32 port of the Xfree86 X Server and related tools, which is required to provide windowing capabilities, so one can run GUI apps on a remote GNU/Linux box and view the results on your Win32 box

Cygwin/X is what I choose as its free and non-restricting unlike some other. All I had to do was, download a small program called setup.exe from the Cygwin site. This tool provides options to install the Cygwin tools. Cygwin tools are ports of popular GNU development tools for MS Windows. Now that I have the setup.exe I could install all the binaries required to run an X server, to communicate using XDMCP with the remote X server. XDMCP stands for X Display Manager Control Protocol. It provides a way of running the X-Terminal to run on your PC (or MAC) and it uses the X Server to provide a client/server interface between display hardware (the mouse, keyboard, and video displays) and the desktop environment while also providing both the windowing infrastructure and a standardized application interface (quoted from XFree86 Project home page). Which is what I wanted :p

The cygwin site has lot of information that helped me in downloading and installing Cygwin/X.

Cygwin/X provides many ways of running the X server, and the easiest was it to fire up the Cygwin console and run:

Username@CygwinHost ~
$ sh /usr/X11R6/bin/startxwin.sh

It will start the X server and later runs xterm. Then to allow the remote X server to talk to the local X server run:

Username@CygwinHost ~
$ xhost +

This command is used to add/delete users names/ host names that can make connections to the X server.

Now to connect to the remote GNU/Linux box run:

Username@CygwinHost ~
$ ssh -Y -l username ip_address_of_remote_server

Y - Enables trusted X11 forwarding
l - login name, existing on the remote host

I have logged on the remote machine now, I will have to tell X server that GUI outputs should be directed to the remote display. To do that run:

Username@RemoteHost]$ export DISPLAY=ip_address_of_cygwinHost:0.0

Now I can run any xapp that is installed on the remote box, or I could fire up a whole gnome session as follows:

Username@RemoteHost]$ gnome-session

WOLA !!! I can access any of the remote apps

0 Comments:

Post a Comment

<< Home