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
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 #
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.
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.
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.
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:
# xhost + access control disabled, clients can connect from any host
Do this only if it does not violate the security guideline of your company.
# xhost +sv1050a sv1166a being added to access control list # xhost access control enabled, only authorized clients can connect INET:sv1050a.itsc.austin.ibm.com #
The hostname of the remote host sv1050a is an example. Replace it with the appropriate hostname of the remote host that you have a telnet session with. You may see other hostnames on the access control list.
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.
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.
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.