Showing results for 
Search instead for 
Did you mean: 

What is variable DISPLAY?

Lalo Weng

What is variable DISPLAY?

Hi, Can you tell me what is variable DISPLAY?
I encountered a error message saying 'DISPLAY is incorrect' but i know nothing about this varibale. Could anyone give me a hint? Thanks.
Alex Glennie
Honored Contributor

Re: What is variable DISPLAY?

The DISPLAY variable is set to the local ip_address or HOSTNAME of the system you wish the GUI / application to appear on plus a ":0" (on single screen displays).
multi-screens will use the following syntax to differentiate

ip_address:0.1 or ip_address:0.2 etc

eg or hpbrc104:0

you may however need to grant access to X by running "xhost +" ( see man xhost) if you still encounter problems.

It also requires hostname resolution to be working correctly.
Respected Contributor

Re: What is variable DISPLAY?


The DISPLAY environment variable contains "the
location" of your X11 screen. This value is
build with your client's IP address and the
"screen number" : for example, if you are
connected to S1 server from C1 (IP :
AAA.BBB.CCC.DDD) client you need to define
your display on S1 with the value
Usually you use @IP:0.0, but sometimes (Exceed
users know that) you need to specify "screen
number" (you can define more than one screen..)
In this case you can specify @IP:num_screen.0

Remember : you specify the CLIENT display on
the SERVER where you are connected.

For others informations see this thread :,1150,0x9dc579bffde7d4118fef0090279cd0f9,00.html



Esteemed Contributor

Re: What is variable DISPLAY?


DISPLAY is an environment variable. This variable contains the address of DISPLAY, which is a combination of IP address (Hostname) and screen number.

If U are in POSIX shell U can set DISPLAY like this


AA...AA is IP address of the system.
0.0 is the sreen number
To see the variable value
#echo $DISPLAY

If U are in C shell

%set env DISPLAY=AA.AA.AA.AA:0.0

To see the value
%echo $DISPLAY

Set like this and try. I hope ur problem will get solve.

Lalo Weng

Re: What is variable DISPLAY?

Thank you all for infomation. But what is screen number? Forgive this entry question.
Alex Glennie
Honored Contributor

Re: What is variable DISPLAY?

screen number relates the number of screens (monitors) you have attached to the hpux system .... generally only one ....... so just use

ip_address:0 or ip_address:0.0 either will work

if you have 2 monitors/screens or more ....
first screen = ip_address:0.0
second = ip_address:0.1
Respected Contributor

Re: What is variable DISPLAY?

You can use screen number (for example) when
you launch several X emulator (Exceed for PC
for example).
In this case each one use a screen number and
you need to export a display like :
export DISPLAY=@IP:0.num_screen_of_emulator


Honored Contributor

Re: What is variable DISPLAY?

The first 0 determines the port of Xprotocol transport.
60000 is the default X transmission port, if you specify host:1.0 You specify a different port, 60001.
This is usefull for setting up applications to sniff Xprotocols.

The display variable is described fully in man X!
You can launch an app to open on display:0.1 just by specifying it on your commandline with the -display option.

All X application start with the line XOpenDisplay() to find out where the application is going to display.. what it's window properties are etc..

It works for me (tm)