I am new to Linux and I had to set DISPLAY variable for running a java application. Somehow I managed to do that, and I understand that display can be set using
<host>:<display>[.<screen>]
but what I am doing is :1001.
Now, this 1001 is 1001th display of this linux? Are this many display possible in a machine or my understanding is wrong?
The DISPLAY variable is used by X11 to identify your display (and keyboard and mouse). Usually it'll be :0 on a desktop PC, referring to the primary monitor, etc. If you're using SSH with X forwarding ( ssh -X otherhost ), then it'll be set to something like localhost:10.0 .
The DISPLAY environment variable instructs an X client which X server it is to connect to by default. The X display server install itself normally as display number 0 on your local machine. In Putty, the “X display location” box reads localhost:0 by default.
This variable is used to indicate to graphical applications where to display the actual graphical user interface, the value consists of 3 parts: A host-name followed by a colon (:), a display number followed by a dot (.) and a screen number.
The Linux's display system, uses multiple technology, protocols, extensions, applications, servers (daemon), drivers and concepts to achieve the windowing system for instance: Xorg, Wayland, X11, OpenGL, RandR, XrandR, Screen Resolution, DPI, Display server, etc.
The DISPLAY
variable is used by X11 to identify your display (and keyboard and mouse). Usually it'll be :0
on a desktop PC, referring to the primary monitor, etc.
If you're using SSH with X forwarding (ssh -X otherhost
), then it'll be set to something like localhost:10.0
. This tells X applications to send their output, and receive their input from the TCP port 127.0.0.1:6010
, which SSH will forward back to your original host.
And, yes, back in the day, when "thin client" computing meant an X terminal, it was common to have several hundred displays connected to the same host.
The DISPLAY values are usually like :0
, :0.0
, etc. when running under the X Window server on the same host. Big numbers like in :1001
are typical for SSH passed X connection. The numbers are really summand to 6000 to get TCP port number; local ones start with 6000 and SSH passed ones could start with 7000. (This augment is different in different systems, e.g. 10 or 100 are also possible.)
As soon as these values are assigned dynamically, you should get the value for DISPLAY from an existing connection environment, provided that proper authorization token is also available (e.g. in ~/.Xauthority).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With