Archive for September, 2007

X window system (aka X11 or X) and Microsoft Windows

Wednesday, September 12th, 2007

This topic has been beaten to death in many oracle related blogs.

Still the use of X seems to be surrounded by dark clouds, and using it with success surrounded by magic. I’ll try in this blog to clear some things up.

The X window system (mind ‘window’ and not ‘windows‘, this can upset true users of X ;-) ) is very different from the graphic interface from Microsoft Windows. Another important point is Microsoft Windows does not natively support X.

The X window system is client-server. This means (originally) it is made to be used over the network by design. This is radically different from the graphic interface from Microsoft Windows, which is not.

There are the commercial X servers, like Reflection X and Hummingbird these are pricey.

Most people (seem to) use Cygwin for X, which seems a bit odd to me, Cygwin essentially is a build platform for native linux/unix applications, and because of that it has (dynamic linked library) dependencies. As far as I know, you need to download quite some packages in order to get X running, but this can be my limited knowledge about Cygwin.

There is a very good alternative to using Cygwin for X, xming. This is a single executable X window server install!

In order to use your X server, I (still) see people logging on to a host, and setting their DISPLAY variable ‘back’ to their machine (with an X server). There are two problems with this:

1. You have to know your IP address as the host sees it (there can be NAT in between, which is often the case in hosting situations with multiple clients), and you have to set your DISPLAY variable. Also, the firewall which can be in between the host and your machine has to allow X (port 6000+) back to your machine. It is often not allowed that a machine is able to send traffic from its LAN to your machine (because your machine probably can see other client’s as well, which potentially makes it able different networks can send packets to each other)

2. If you log on to another host, you have to set DISPLAY again.

Here’s how to relieve you from this:
-Use openssh on the host(s).
-Use putty to connect to an host.
-Use xming as your X server.

First, start the X ming server. Once installed, it should be startable using [Start], [All Programs], [Xming], Xming.
This X server only accepts connections from localhost.
After startup, an ‘X’ icon should appear among the other icons in the right-most part of the taskbar.

Now startup putty, and define a connection, or load an existing one. (do not push the [Open] button yet!)
Go to Connection, SSH, X11 (in ‘Category’ window) and check ‘Enable X11 forwarding’.
Now click on ‘Session’ in the ‘Category’ window (you might have to scroll up) and press save (to save this setting).
Now [Open] can be clicked, and log on.

This should enable you to use X without any setting! (check it with xterm, xeyes or something).
Still X might not be possible; the settings of the ssh daemon can prevent a ssh connection from tunneling X (/etc/ssh/sshd_config; X11Forwarding)

In order to be able to use X even when you hop on through other hosts, set ForwardX11 to ‘yes’ in /etc/ssh/ssh_config (these are the global client settings of openssh) on all of these.