You can specify an arbitrary display, but you won’t get far if there’s no corresponding X server. The display number is specified when the X server is started, by whatever starts the X server — typically your display manager, or yourself in your Xpra example. It’s :0 by default (see the Xserver manpage). It can be chosen arbitrarily, but the X server won’t start if the corresponding resources aren’t available (port 6000 + the display number if it’s configured to listen on TCP, /tmp/.X11-unix/X followed by the display number if it’s configured to listen on a Unix domain socket, etc.). The kernel isn’t involved.
:0,:40(both starting with a colon). The kernel does not create any virtual display. You can create a virtual display withXvfb :1337, then run firefox on it withDISPLAY=:1337 firefox. – Mar 13 '19 at 00:56-listen tcpwill let it also listen on a tcp socket). Also, a xserver/display can have multiple "screens", though nowadays multiple monitors are managed as part of a single "screen". An xserver can use a hardware framebuffer, a dummy framebuffer (Xvfb) or a window on another xserver (Xephyr). The latter two are examples of "virtual" xserver/displays. – Mar 13 '19 at 01:34DISPLAY=:0andDISPLAY=localhost:10as forwarded via ssh refer to the same display/xserver, the same video card, and the same monitor. – Mar 13 '19 at 01:39$DISPLAYspecify both a listening socket and a rendering target at the same time? – Tim Mar 15 '19 at 00:01$DISPLAYdoes not specify a "rendering target". And no need to harp about what "rendering target" means -- XrandR is able to let a root window (screen) span multiple monitors rendered to through multiple GPUs. The "screen" part of the display spec (the second number of the$DISPLAY) will determine what theDefaultScreen()andDefaultRootWindow()X11 library functions will return. Unless you're using an Xserver configured with multiple old-style screens (with multiple root windows), that number should be omitted or 0. – Mar 15 '19 at 12:57