College of Arts and Sciences

Department of Mathematics

Running X Windows applications remotely

X-windows can be used across a network easily. All that is required is X-server software on the local machine, and commands to tell the local and remote machines to work together. After starting the X-server on the local machine, you usually need to execute two commands. The first tells the local computer to accept output from the remote machine, and the second tells the remote machine where to send its graphical output.

For example, suppose that "local" is the name of the machine in front of you, and "remote" is the name of a computer in the basement. First, you make sure that local is running an X-server. If it is a Unix machine, it surely already is. If it is a Windows machine, then you might have to start a program called X-win32, or something similar.

Next, you log onto remote using a program called ssh. On a Unix machine this looks like

ssh remote

On a Windows machine, you run a program called putty.exe, ssh.exe or ttssh.exe.

Once logged into remote, you must tell it where to send its X-windows output. The command in bash is

export DISPLAY=local:0

We emphasize that you type this command on the remote machine.

The corresponding command in the C-shell (used by most of us in the Math department) is

setenv DISPLAY=local:0

Finally, you must tell local to accept the X-windows output from remote. If local is a Unix machine, you type

xhost +remote

If local is a Windows machine, you must modify the "xhost" settings (e.g. using a program called X-Util32) to include remote. After all this, you may run any X-windows program on the remote machine and see the output on the local machine.

Finally, we note that when you use ssh from one Unix machine to another, your X-windows settings should be preserved. In particular, you should not have to give the "export DISPLAY" command above if you use ssh from one Unix machine to another.

Department of Mathematics, PO Box 643113, Neill 103, Washington State University, Pullman WA 99164-3113 Phone: 509-335-3926 Fax: 509-335-1188 Contact Us