Chapter 10. Networking

10.1 The DISPLAY Environment Variable

X-Windows consists of three components: the server, client programs, and the communications channel. The server distributes user input to and accepts output requests from various client programs (applications) located either on the same machine or elsewhere on the network.

The display name or DISPLAY environment variable is a string with the following format:

HostName:Number.Screen
HostName
Specifies the name of the host system where the display is physically attached. The host name should be followed by a : (colon).
Number
Specifies the ID number of the display server on that host machine. The display number can be followed by a . (period).
Screen
Specifies the number of the screen on that host server. Multiple screens can be connected to or controlled by a single X server.

By default, the DISPLAY environment variable is set to :screen#. When you log in to the graphic console, the DISPLAY environment variable is:

# echo $DISPLAY
:0.0
#

10.1.1 Failing to Start an X-Windows Application

By default, the DISPLAY environment variable is not set when you Telnet or rlogin to a remote host. An attempt to start an X-windows application will fail if:

Each of these conditions is dicussed in the following sections.

10.1.1.1 The DISPLAY Environment Variable is Not Set

If you have not set your DISPLAY environment variable, you will see these messages:

# echo $DISPLAY

# aixterm
1363-008 aixterm: Cannot make a connection to X server .
        If the X server is not running, run the xinit command.
        If the X server is running, check the specified display number.

Note that the name of the X-windows server is empty. Rectify this by setting up your DISPLAY environment variable.

10.1.1.2 The X-Windows Server is Not Started

If you have not started the X-Windows server, you will see these messages:

# export DISPLAY='sv1166a:0'
# aixterm
1363-008 aixterm: Cannot make a connection to X server sv1166a:0.
        If the X server is not running, run the xinit command.
        If the X server is running, check the specified display number.
#

The hostname sv1166a is just an example. Replace it with the appropriate hostname. Rectify this by starting the X-windows server on your local host using the xinit command.

10.1.1.3 X-Windows Server Access Control List

If access control is enabled and the hostname sv1166a is not on the access control list, you will see these messages:

# echo $DISPLAY
sv1166a:0
# aixterm
Xlib: connection to "sv1166a:0.0" refused by server
Xlib: Client is not authorized to connect to Server
1363-008 aixterm: Cannot make a connection to X server sv1166a:0.
        If the X server is not running, run the xinit command.
        If the X server is running, check the specified display number.
#

For AIX, rectify this from the local console on the local host by using:

10.1.2 Setting Up the DISPLAY Environment Variable

The display name or DISPLAY environment variable is a string with the following format:

HostName:Number.Screen

Instead of using the host name, you can also use the IP address in the DISPLAY environment variable.

10.1.2.1 Using the Host Name

Using the host name is more convenient. Use the hostname command on one of your local sessions to find out the host name to use:

# hostname
sv1166a
#

Go back to your Telnet session and set up your DISPLAY environment variable by entering:

export DISPLAY='sv1166a:0'

The screen number does not need to be specified if you have only one screen connected or controlled by the X-windows server.

10.1.2.2 Using the IP Address

You can use the IP address at any time. When the Domain Name Server is down or when you are using dynamic IP address, you will not be able to use the host name and using the IP address is the only possible alternative.

10.2 Security Consideration with System and TCP/IP Files