DistributedNetworks DistributedNetworks


Graphical Environment  «Prev  Next»
Lesson 8 Remote X sessions
Objective Run remote X clients on the local X server.

Remote X Sessions in Redhat

There may come a time when you need to run an X server on one machine, and have the windows appear on a different machine. These machines can be in the same room or on different continents; as long as they're networked, the X server will display the remote client on your display. You can connect an X server to a compatible display anywhere in the world as long as you know the correct display name.

Calling a Linux machine by name

An X server can have many different displays running, and can use several screens within one display system. X supports this for workstations with multiple graphics cards (one graphics card per display) and multiple monitors (one monitor per screen).
X Windows System designers established a naming convention that specifies the host name, the display on the host, and the screen in that display, all in a convenient string. The format is:
hostname:displaynum.screennum

Most computers don't have multiple graphics cards or stereo monitors, so the display and screen numbers are usually just "0". For example, the X server on a local machine might be named localhost:0.0.
To simplify names, X provides a shorthand version of the naming string. If the X server is on the local machine and there is only one screen, the display name is just :0. Notice that both the hostname and screen number were dropped.



Allowing X client access

The X server, by default, denies all clients trying to connect unless they originated locally. To allow a remote host to display windows on your X server, use the xhost command with the +name parameter. To deny a host, use the -name parameter.
For example, to allow the host replicant.mydomain.com to display windows on your X server, use: xhost +replicant.mydomain.com.

Displaying a remote X client

To display a remote X client on your X server:
  1. Allow access to your X server with xhost +hostname. Execute this command in any open X terminal.
  2. Login to the remote host and set the DISPLAY variable to your X server's address. For example, if your X server's name is xserv.mydomain.com:0, you'd type: DISPLAY=xserv.mydomain.com:0 ; export DISPLAY
  3. Launch the X client in the background. For example, start the xload program in the background with: xload &
The next lesson explains how to troubleshoot common X problems.