Introduction
Most desktop computers do or can run an X server. This is true
for X terminals, UNIX workstations and Windows PCs with an X
emulator such as Exceed.
When your desktop computer runs an X server you often need to
start remote X applications, i.e. applications not running on your
desktop but with the windows displayed on your screen. In some
cases this is transparent for you because XDM (the X Display
Manager) takes care of the details. In other cases some manual
intervention is needed.
This article explains how to start remote X applications (also
called X clients) easily and securely. This is the recommended way
to run remote X applications which need to be displayed at
CERN.
Note: the following recipes assume that your desktop is a
standard UNIX workstation (for instance, running CERN Red Hat
Linux). If you have a Windows PC or an X terminal you should first
login to a UNIX server (such as LXPLUS), using XDM, and then follow
the recipe.
Using ssh
The recommended way to start a remote X client is to use
ssh
with its X11 forwarding feature enabled (this is
the default at CERN).
You can either start an interactive session with
ssh
and start an X client (by simply typing the
command name) or directly start the remote command with:
ssh [-l <remote-user-name>] <remote-machine> <command> [<arguments>]
For instance:
ssh lxplus001 xload
ssh -l root myserver xterm -ls
See the ssh
man page or http://cern.ch/security/ssh
for more information.
Using mxconns
If you can't use ssh
, the other recommended way is
to use mxconns
which is available on all standard UNIX
machines (through ASIS). Like ssh
, it will relay the X
traffic to your X server.
The easiest solution is to start mxconns
through
the HEPiX X11 scripts (by setting "HX_START_MXCONNS=yes" in your
~/.hepix/xprofile
). This will take effect the next
time you login and will set the environment variable
XDISPLAY
.
If you start it by hand, you should use:
setenv XDISPLAY `mxconns -fork -hunt -verbose`
Once connected to the remote machine (via ssh
,
telnet
, rlogin
...), you should set the
DISPLAY
variable on the remote machine to the value of
XDISPLAY
on the machine where mxconns
runs. For instance:
setenv DISPLAY lxplus002.cern.ch:9
You can then start your remote X client.
Note: the preceding commands assume that you are using
tcsh
. If you are using the Bourne shell then the
command is:
DISPLAY=<whatever>; export DISPLAY
See the mxconns
man page or http://cern.ch/mxconns
for more information.
About the author(s):
Lionel Cons is a member of the CERN security team (Computer.Security@cern.ch
).