X Windows


In order to run application on applicationHost and have it displayed on displayHost, on applicationHost, we need to install the "xauth" package, and configure PuTTY as mentioned elsewhere on this page or this Wiki. If we have the "xauth" package installed, when we SSH into the applicationHost through PuTTY, the .Xauthority should be automatically created. If we need to run the program as root, we need to copy the .Xauthority file to /root

In order to run application on applicationHost and have its displayed on displayHost, on applicationHost:

setenv DISPLAY displayHost:0.0

and on the displayHost you must grant permission for applicationHost using either xhost or xauth utilities. xauth is more security conscious but xhost is easier to use. With xhost:

xhost                               // display a list of machines that already have permission to display on this machine
xhost + applicationHost   // give applicationHost permission to display on this machine
xhost - applicationHost    // revoke applicationHost permission to display on this machine
xhost +                            // allow everyone to display on this machine (Don't do this if this machine is connected to the Internet)
xhost -                             // revoke all other machine permission to display on this machine

If you are unable to connect directly to applicationHost, but can connect another host on the network, from this host, you can ssh -X applicationHost, and run application on applicationHost.

If you wish to have X application display its output onto your Windows box, your Windows box must have Cygwin/X installed (must install all packages). Running Cygwin/X is just a matter of double-clicking on its icon. This will create a icon in your task bar. You need to install PuTTy and configure it to handle X11 Forwarding

Running multiple X11 sessions

switch to an unused console // Ctrl-Alt-F1 through F6
startx -- :1

More on X11:

CTRL+ALT+F1 through F6      // text consoles (tty1 .. tty6)
CTRL+ALT+F7 through F12    // graphical consoles
tty                                          // determine the name of your terminal
CTRL+TAB                               // switch between desktop pagers
ALT+TAB                                 // switch between application
CTRL+ESC                              // give a list of processes currently running on the local machine
CTRL+ALT+BACKSPACE          // kill the X server

Xorg -configure                       // generate an X11 configuration skeleton file in the /root directory called xorg.conf.new
Xorg -config xorg.conf.new       // test the new config file
cp xorg.conf.new /etc/X11/xorg.conf 
xorgcfg -textmode
startx &
init 5

To start X-server automatically, edit the initdefault entry in /etc/inittab:


This set up the default runlevel to 5, which is X-Windows.

If the Linux runs an X Windows Manager (with graphical login screen), we can connect to this Linux box (from a Windows box) using "NXClient for Windows XP". Other X11 clients: X-Win32, XManager, X-Mins


Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License