In Multi-Display system display id (DISPLAY) is always 1

We connected three displays to the AGX carrier board ,

when we run command

env | grep DISPLAY

the output is


Is this an expected output?

Yes, if they are monitors connected to the same session. The “DISPLAY” is based on a server, but actual monitors usually show a subset of the complete desktop if there is more than one monitor. If “DISPLAY” differs, then those are independent login sessions, and independent of each other (imagine several users logging in to a server and each one is a different login which does not know about the others).

Although it depends on drivers, the typical syntax of “DISPLAY” is something like this:

  • :1” means server 1, and log to “/var/log/Xorg.1.log”.
  • Different desktops might be referred to like this:
    :1.0”, first desktop, “:1.1”, second desktop, so on, but they would still be the same user and not independent logins.
  • <ip address>:1” would imply the server is on a remote system at that IP address, and that on that remote machine, it uses the “:1DISPLAY.

To get a different “DISPLAY” from “:1” you would need to start a second server, and that server would need to be told to use a new “DISPLAY”, e.g., a virtual server might be added as a DISPLAY of “:10”, but the original “:1” would still be there.

How we able to differentiate each display in singe login

If you open a terminal on any given display, and run the command “echo $DISPLAY”, then you know which server is running (the one that started with that DISPLAY variable). You won’t typically see a specific desktop, and will see only the server itself, e.g., “:1”.

I’ve not done it, but I suppose you could add some argument to the X server startup to add a custom welcome message to the login manager. It is probably useful at this point to explain how login managers and X servers fit together…

If you were to run an X server with no arguments, then all you would get is a very basic gray background and an ugly cursor. There wouldn’t be much of anything you could do. An X server is designed to run one program, and only one. What people think of as the X server though is traditionally the desktop window manager…the one application the X server runs is what provides all of the nice magic for opening other applications, having a nice background image, so on.

However, as the X server starts, most of the time it runs a login manager first. This is the part where you enter the password. Desktop window managers do not have this. The idea is that the login manager respawns an X server with the window manager upon login. Both the login manager and window manager applications are a single application.

If one names the DISPLAY during start of the X server, then this is what it uses. Typically, as a login manager calls an end to its own life by respawning X with a window manager, the window manager will inherit the same DISPLAY as the login manager.

There is probably some method of adding a custom welcome message to the login manager. If you have more than one independent X server running, then the message could differ for each one. I’ve never done this, but in theory you could have one login manager say something like “welcome to DISPLAY 1”, and another something like “welcome to DISPLAY 2”. Then, as the login manager overwrites itself with the window manager upon completion of login, you’d know which DISPLAY it is.

More information on your use-case might help.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.