22

Since modern PCs can use two screens at the same time I wonder if it is possible to plug in two keyboards and mouses as well to have the two screens run two (more or less) independent X-sessions at once?

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
Tobias Kienzler
  • 9,184
  • 13
  • 65
  • 106

2 Answers2

20

In short, yes, this is possible. The relevant search string you are looking for is "Multi-seat X".

The Ubuntu wiki, Gentoo wiki, Debian wiki and Arch wiki all have articles related to multi-seat X. A number of other articles can be found on the Xorg wiki page on multiseat and even more can be found on google.

From what I can tell from these articles, there are two ways to do this:

  • Multiple X servers, or
  • Using Xephyr on top of Xorg.

Which of these methods will work for you will depend on the version of Xorg you are running and your hardware. Multiple X servers seem to be the easier route if your hardware setup supports it. There is also work to be done with the display manager, sound server, and other components -- much of which is covered in the various articles linked above.

Additionally, there is a multiseat display manager (MDM) to automate these configurations. It's not yet integrated in most distributions, though (the mdm package in Ubuntu is a homonym).

Steven D
  • 45,310
  • 13
  • 119
  • 114
0

Multiseat is one way to go. But if you want to have 2 mice (or 2 keyboards, or both) with different input streams directed simultaneously to 2 different terminals, you can use xinput: https://wiki.archlinux.org/title/Multi-pointer_X

commands you need (self explanatory):

xinput list
xinput create-master [name]
xinput reattach [slave device name or id] [master device name or id]

I had to reattach my mouse/keyboard AFTER creating the master. Maybe it was just a glitch...

What worked on my side: I had 2 mice, 2 keyboard, 2 terminals:

  • focusing terminal-A with mouse-A
  • focusing terminal-B with mouse-B
  • typing keyboard-A showed the output on terminal-A
  • typing keyboard-B showed the output on terminal-B
user3054986
  • 101
  • 1