6

This is what I find in man X:

The phrase "display" is usually used to refer to a collection of monitors that share a common set of input devices (keyboard, mouse, tablet, etc.). Most workstations tend to only have one display. Larger, multi-user systems, however, frequently have several displays so that more than one person can be doing graphics work at once. To avoid confusion, each display on a machine is assigned a display number (beginning at 0) when the X server for that display is started. The display number must always be given in a display name.

My question is: Do we need to start multiple X servers if we want to use multiple displays, or all those displays can be handled by a single X server? Is it possible to share keyboards, mice and monitors across different displays?

Edit. The display here refers to the concept defined by the X window system, not a single monitor. I know there are Xinerama and XRandR technologies that support multi-head configurations.

4

Quoting X(7):

From the user's perspective, every X server has a display name of the form:

hostname:displaynumber.screennumber

Each X server has one display (which may include multiple monitors, or even no monitors at all). Using multiple displays (in the X sense) requires multiple X servers; that's how you get multiple seats too.

As far as sharing goes, I think each X server expects to "own" the devices it's using at any given time, so you can't have input from a single keyboard going to multiple X servers simultaneously, or the output of multiple X servers combined on a single monitor. X servers can hand hardware off, which allows you to run X servers on multiple VTs and switch between them (this is how simultaneous logins are handled e.g. in GNOME). You can also nest some X servers (Xephyr, xpra...), so input goes to your main current X server, and gets passed on to the nested X server in a window; and the output of the nested X server is displayed in a window by the main X server.

On Linux, you could write a multiplexing input driver in the input layer to share input devices, but that's a different layer altogether than the X server.

1
  • Is it possible to share (or multiplex) keyboards, mice and monitors across different displays? – Cyker Dec 19 '16 at 19:24
0

You certainly can run multiple displays with one X server -- that's what most people using two or more monitors are doing. And the mouse and keyboard are shared between them.

That said ... I don't think that's what you're asking. (Or maybe it is? Do you want to have one person use one computer with two or more monitors that all act like one monitor? If so, then that's your typical dual monitor setup and people do that all the time nowadays and most modern Linux distributions will handle it natively as long as all monitors are plugged into one video card. (Of course, if not Linux ... then it'll depend.))

You can also run more than one X server at a time, either tying one to a given monitor or switching between then when you switch between their virtual consoles.

You can even run multiple X servers with multiple monitors and multiple keyboards and mice. It's a bit complicated, but it can be done.

Here's some documentation on doing anything more complicated than your basic dual monitor setup --

https://wiki.archlinux.org/index.php/xorg_multiseat

(Whether you use their distribution or not, Archlinux does a really good job of documenting stuff!)

If you want several people logged into one machine, each with their own display, mouse and keyboard -- then yes, they'll generally each have their own X server. That page will help set it up if you want to.

This probably isn't what you're after, but you can also have multiple computers with their monitors next to each other and share one mouse and keyboard between then, having them work like a multiple monitor setup. You can even have one computer be Linux and the other be Windows or a Mac if you wish. https://symless.com/synergy/ has the software that lets that work.

(It's been a long time since I looked at that -- looks like it's now a commercial product and not free (boo) but they did remove the massive security hole in that you can now secure your mouse and keyboard (yay!))

-1

Yes, a X server Screen/Display can run on either multiple monitors (multi-monitor), it can send the same image to multiple monitors (mirroring, like a projector in a classroom or meeting), or if you have multiple monitors you can connect multiple keyboards and mice and run a multi-headed multi-user graphical station - each monitor/keyboard/mouse runs its own X server with its own login processes, etc.

There is even a way to stretch X across monitors on multiple machines using x2x - https://help.ubuntu.com/community/X2xHowto

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.