61

What does the :0.0 actually mean? I know that :0 is the first X server that is started on a local machine, :1 the second, etc. But what is that .0 part after :0? Do other combinations exist? (e.g. :0.0-something)

Background: I'm trying to improve the initscript of bumblebee which currently assumes that :0 is the active display. That is not the case if I switch users. So I wanted to validate the $DISPLAY variable before passing it to vglclient.

1

1 Answer 1

64

The format of the display variable is [host]:<display>[.screen].

host refers to a network host name, and if absent means to connect to the local machine via a unix domain socket.

Each host can have multiple displays, and each display can have multiple screens. Screens aren't used much anymore, with xinerama and now xrandr combining multiple screens into a single logical screen.

8
  • 4
    Thanks, I just found the right manual page too, Xserver(1) referred to the DISPLAY NAMES section of X(7). Refer to that manual page for details.
    – Lekensteyn
    Commented Jul 17, 2011 at 9:28
  • 5
    And how would I get a list of available displays for a certain host? Ideally within an ssh session where i'm logged in at the host from a client PC.
    – con-f-use
    Commented Aug 14, 2012 at 11:59
  • 3
    The display part is also used on X over SSH. Every new SSH connection with X forwarding enabled is assigned a different display, because these screens correspond internally to a TCP port number offset, e.g. DISPLAY=localhost:10.0 will cause the client to direct graphical output to host localhost port 6010. This is required for SSH X forwarding, because if you have multiple connections to the same computer, your program must send different outputs to different ports so that the SSH server can forward the X output to the proper destination.
    – RAKK
    Commented Apr 1, 2015 at 19:02
  • 4
    @Raza: The TCP port numbers to open are 6000 + display_number. For display host:0.0 that is port 6000. For display host:10.0 that is port 6010. Note that SSH X11 forwarding is done over port 22 and not X11 ports.
    – camh
    Commented Jul 28, 2015 at 4:34
  • 1
    @Claudiu: DISPLAY=:0 will use a unix domain socket, DISPLAY=localhost:0 will use a internet domain socket (IP). It is likely your X server is not listening on a TCP/IP end point. I don't know the default unix domain socket.
    – camh
    Commented Jun 15, 2016 at 9:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .