📜 ⬆️ ⬇️

Split personality or more about MultiseatX

I want to tell one success story that happened in my family.

As you know, the performance of a typical home computer, even without expensive components, is already so high that it suffices for ordinary “office” work with a large margin, so the idea of ​​making one computer with several terminals was born by itself. And then I wondered: what about games? After all, on the home computer, in contrast to the office, they usually also play.

And if you make multiseat for office use is very simple, and there are many ways (starting from a terminal connection to the server, ending with running several virtual machines with a hard association of local hardware with them) .
Once, a long time ago, I had this idea, but at that time computers still had an AGP connector, which did not mean installing more than one full-fledged video card. Now PCIe is running, and you won't surprise anyone with a motherboard with multiple PCIe slots, so the problem with installing several full-fledged video cards is no longer worth it.
')
So there are no restrictions on the iron line (although there are pitfalls, I will describe them later), it remains to figure out which software to use for this.
The last 8 years I have Linux installed on my home computer, so I will use it, specifically kubuntu, but I’ve looked for Windows solutions for interest. Judging by the reviews, the ASTER program allows you to do this, but I have not tested it yet, so I can't say for sure. By the way, the software is paid - about 2000 rubles. Windows MultiPoint Server is also not forgotten, but you don’t use video there. Doing this on OS X is at least impractical because of the price, as a maximum due to the fact that there are simply no Apple computers with powerful game graphics (even the two most powerful FirePro of the last Mac Pro lose one GTX780).

So the first idea was to use the XEN hypervisor.

XEN


The idea was this: Linux works in dom0, it immediately plays natively, a video card, USB controller is forwarded to domU, and there you can run anything, of course Windows is more interesting. Conceived - done!

The xen needs a motherboard and a processor with VT-d support, I already had a Core i5-2500 processor, and I would have to change the board anyway, since it was mini-ITX and, accordingly, with only one PCIe slot. With lists of cards that support VT-d are big problems, so you will have to google specifically for each model that is in the store. I can only say that almost all MSI motherboards do not support VT-d, ASRock seemed more likely. As a result, the choice fell on the ASRock H77 Pro4-M. I didn’t have a real gaming card at that time, so the GeForce GTX780 from ASUS was purchased. I like unusual cases, so I bought a stylish and compact SilverStone SG-09 .
This is how the computer looked like after assembly:



The Radeon cards are best forwarded, which is why it was bought for the domU.
I will not describe the xen setting for pci-passtrough for one simple reason - it did not take off. The reason is that the nVidia proprietary driver does not work with xen. After launch - just a black screen. I wanted to run this case for the test, at least on the processor's integrated card, but she also did not want to run with the intel driver. Only vesa for intel and nouveau for nvidia worked, it was possible to check, but it was impossible to play on it at all. So, experiments with xen were abandoned until better times (after all, the possibility of video card forwarding is more of a technical accident, working on xen developers enthusiasm).

Multiseatx


MultiseatX is a very old opportunity for the X server to become attached to the desired video card, which appeared in the days of the PCI video cards. After the arrival of AGP, there were few opportunities for its use, except that on several outputs of nVidia cards it was possible to run on a separate X-server.
Good instruction is here .
Since I didn’t need an ATI card anymore, I replaced it with my old GeForce GT 620. There was no particular need for this, but as a Russian I still believe in the myth that ATI does not work well in Linux. In addition, in the case of two nVidia cards, they will be both displayed in the setup program.
In fact, setting up MultiseatX in such a configuration turned out to be very simple. In fact, you need to edit only 2 files.

So, we put cards, we connect monitors, keyboards, mice, we turn on the computer. The X server without the xorg.conf file will start on one of the maps. It will not always be the card that the BIOS has chosen, so be prepared to sit at any monitor. Or you can connect remotely via ssh.

The first thing to find out is the addresses of the devices.
Let's start with the video card:

$ lspci |grep VGA 01:00.0 VGA compatible controller: NVIDIA Corporation GK110 [GeForce GTX 780] (rev a1) 02:00.0 VGA compatible controller: NVIDIA Corporation GF108 [GeForce GT 620] (rev a1) 


The meaningful values ​​for us are 01: 00.0 and 02: 00.0 - these are the addresses of the cards on the PCIe bus. They do not change and depend only on the physical PCIe slot on the motherboard, so that when swapping cards they will need to be adjusted.
Next - you need to determine the static addresses of input devices. For some reason, in the ubuntu guide, they use addressing along the way for keyboards, and for mice, they use “symbolic” paths to / dev / input / mouse *. I highly recommend it, as in this case, when connecting the keyboard to another port, it will have to be rewritten, and only in what order to assign the names to the mice is known only to the great random. So the only correct way would be to use real static paths in / dev / input / by-id /.

 $ ls -l /dev/input/by-id/  0 lrwxrwxrwx 1 root root 9  18 14:33 usb-04f3_0103-event-if01 -> ../event7 lrwxrwxrwx 1 root root 9  18 14:33 usb-04f3_0103-event-kbd -> ../event6 lrwxrwxrwx 1 root root 9  18 14:33 usb-Logitech_USB_Laser_Mouse-event-mouse -> ../event2 lrwxrwxrwx 1 root root 9  18 14:33 usb-Logitech_USB_Laser_Mouse-mouse -> ../mouse0 lrwxrwxrwx 1 root root 9  18 14:33 usb-Microsoft_Microsoft_Nano_Transceiver_v1.0-event-kbd -> ../event8 lrwxrwxrwx 1 root root 9  18 14:33 usb-Microsoft_Microsoft_Nano_Transceiver_v1.0-if01-event-mouse -> ../event9 lrwxrwxrwx 1 root root 9  18 14:33 usb-Microsoft_Microsoft_Nano_Transceiver_v1.0-if01-mouse -> ../mouse2 lrwxrwxrwx 1 root root 10  18 14:33 usb-Microsoft_Microsoft_Nano_Transceiver_v1.0-if02-event-kbd -> ../event10 lrwxrwxrwx 1 root root 6  18 14:33 usb-Microsoft_Microsoft_Nano_Transceiver_v1.0-if02-kbd -> ../js0 lrwxrwxrwx 1 root root 9  18 14:33 usb-Razer_Razer_BlackWidow_2013-event-kbd -> ../event3 lrwxrwxrwx 1 root root 9  18 14:33 usb-Razer_Razer_BlackWidow_2013-if01-event-kbd -> ../event4 lrwxrwxrwx 1 root root 9  18 14:33 usb-Razer_Razer_BlackWidow_2013-if02-event-mouse -> ../event5 lrwxrwxrwx 1 root root 9  18 14:33 usb-Razer_Razer_BlackWidow_2013-if02-mouse -> ../mouse1 


In the example above, there are 2 keyboards and 2 mice. These paths will be static and will not change when rebooting or connecting to another port. For multimedia keyboards, at least 2 devices will be seen - the keyboard itself and additional keys. The same is true for mice with buttons. The only oddity is that a mouse called Microsoft_Microsoft_Nano_Transceiver is just a wireless mouse, without buttons, and it creates as many as 5 devices. Perhaps they have a universal receiver for the entire series, and this is the reason for the presence of several logical devices. In our case, you only need a device that references mouse2.
In order to be sure what is what, you can run cat. When you press the buttons or move the mouse, symbols will appear on the screen.

You can start creating (because in modern distributions it is long gone) of the file /etc/X11/xorg.conf. I will not comment on all the options here, as many of the standard flags in this configuration are already described in the ubuntu.com guide that I have provided.

/etc/X11/xorg.conf
 Section "ServerFlags" Option "DefaultServerLayout" "seat0" Option "AllowMouseOpenFail" "true" Option "AutoAddDevices" "false" Option "AutoEnableDevices" "false" Option "AllowEmptyInput" "true" Option "DontZap" "false" Option "AutoAddGPU" "false" Option "DontVTSwitch" "false" EndSection Section "ServerLayout" Identifier "seat0" Screen 0 "Screen0" 0 0 //   .    (    )    (    ) InputDevice "Mouse0" "CorePointer" InputDevice "Keyboard0" "CoreKeyboard" InputDevice "Keyboard1" "CoreKeyboard" Option "Xinerama" "0" EndSection Section "ServerLayout" Identifier "seat1" Screen 0 "Screen1" 0 0 InputDevice "Mouse1" "CorePointer" InputDevice "Keyboard2" "CoreKeyboard" InputDevice "Keyboard3" "CoreKeyboard" Option "Xinerama" "0" EndSection Section "InputDevice" Identifier "Mouse0" Driver "mouse" //      .    ,   . Option "Protocol" "ExplorerPS/2" //   /dev/input/by-id/    - /dev/input/mouse* (  ) Option "Device" "/dev/input/by-id/usb-Logitech_USB_Laser_Mouse-mouse" EndSection #razer kbd: Section "InputDevice" Identifier "Keyboard0" //    .    ,  . Driver "evdev" //   Option "Device" "/dev/input/by-id/usb-Razer_Razer_BlackWidow_2013-event-kbd" Option "XkbRules" "xorg" Option "XkbModel" "evdev" Option "XkbLayout" "us" Option "GrabDevice" "yes" EndSection Section "InputDevice" Identifier "Keyboard1" Driver "evdev" //   .        ""     -   . Option "Device" "/dev/input/by-id/usb-Razer_Razer_BlackWidow_2013-if01-event-kbd" Option "XkbRules" "xorg" Option "XkbModel" "evdev" Option "XkbLayout" "us" Option "GrabDevice" "yes" EndSection Section "InputDevice" Identifier "Mouse1" Driver "mouse" Option "Protocol" "ExplorerPS/2" //  ,       . Option "Sensitivity" "0.7" Option "Device" "/dev/input/by-id/usb-Microsoft_Microsoft_Nano_Transceiver_v1.0-if01-mouse" EndSection Section "InputDevice" Identifier "Keyboard2" Driver "evdev" Option "Device" "/dev/input/by-id/usb-04f3_0103-event-kbd" Option "XkbRules" "xorg" Option "XkbModel" "evdev" Option "XkbLayout" "us" Option "GrabDevice" "yes" EndSection Section "InputDevice" Identifier "Keyboard3" Driver "evdev" Option "Device" "/dev/input/by-id/usb-04f3_0103-event-if01" Option "XkbRules" "xorg" Option "XkbModel" "evdev" Option "XkbLayout" "us" Option "GrabDevice" "yes" EndSection //         nvidia-settings,       Section "Monitor" # HorizSync source: edid, VertRefresh source: edid Identifier "Monitor0" VendorName "Unknown" ModelName "RX_ HD270 DVI" HorizSync 15.0 - 99.0 VertRefresh 23.0 - 76.0 Option "CalcAlgorithm" "XServerPool" Option "DPMS" EndSection Section "Monitor" # HorizSync source: unknown, VertRefresh source: unknown Identifier "Monitor1" VendorName "Unknown" ModelName "HP L1955" HorizSync 0.0 - 0.0 VertRefresh 0.0 Option "CalcAlgorithm" "XServerPool" Option "DPMS" EndSection //      nvidia-settings Section "Device" Identifier "Device0" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce GTX 780" //  .     ,      lspci. BusID "PCI:1:0:0" EndSection Section "Device" Identifier "Device1" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce GT 620" BusID "PCI:2:0:0" EndSection //    Section "Screen" Identifier "Screen0" Device "Device0" Monitor "Monitor0" DefaultDepth 24 //      opengl       Option "TripleBuffer" "true" //         Option "Coolbits" "5" SubSection "Display" Depth 24 EndSubSection EndSection Section "Screen" Identifier "Screen1" Device "Device1" Monitor "Monitor1" DefaultDepth 24 Option "TripleBuffer" "True" Option "Coolbits" "5" SubSection "Display" Depth 24 EndSubSection EndSection 



Only one file remains and the settings are complete:
/etc/lightdm/lightdm.conf
[LightDM]
minimum-display-number = 0

[SeatDefaults]
xserver-command = / usr / bin / X
user session = kde-plasma
greeter-session = lightdm-kde-greeter
exit-on-failure = true

[Seat: 0]
xserver-command = / usr / bin / X: 0 -sharevts
autologin-guest = false
autologin-user = gordon01
autologin-user-timeout = 0
autologin-session = lightdm-autologin
xserver-layout = seat0

[Seat: 1]
xserver-command = / usr / bin / X: 1 -sharevts
xserver-layout = seat1


On it, everything should be clear right away. They write that there is a bug and in multi-seat configurations at least one user with autologin is needed.
UPD : updated config. Now the username of another user does not switch vt, but it is already impossible to enter the virtual console.

In general, that's all. Switch to the first console, enter
 sudo service lightdm restart 

Both monitors should be lit. Login and play!

Underwater rocks






And the working tire width and transmission speed, here:





Photo and video


Finally, some photos and videos of the working solution:

General form:


Places separately:




So we hid the wires, so they are not visible at all:


With poppy for beauty:


Video:

Source: https://habr.com/ru/post/223379/


All Articles