Back to Home

Multiseat on a Debian PC

multihead · multiseat · multihead debian · multiseat debian · two jobs

Multiseat on a Debian PC

This article describes one of the ways to configure Multiseat (two independent workstations) on one computer running Debian Operating System, this solution allows you to create two full-fledged workstations on the basis of one computer, this solution has been implemented and has been successfully functioning for several months.

image


The described below was carried out on a computer with Debian 8.6 x64, with other systems the operation of this solution is not guaranteed, the display manager is LightDM, the desktop environment is XFCE.

Motherboard Gigabyte GA-P41T-D3P rev 1.5, two video cards GeForce GT 430 and GeForce 8500 GT, the motherboard can be absolutely any, the main thing is to be able to install two video cards at the same time, the video cards can also be any, the main condition is that they can work with one version of the driver, when using two powerful graphics cards, do not forget about the power of the power supply.

Please note that 2 video cards must be installed in the computer, it cannot be done on one two-headed multiseat video card, in most cases the integrated video card integrated into the motherboard also cannot be used, since it turns off when another video card is connected to the computer.

So, let's begin:

First you need to install two video cards in the computer, and connect to each video card via a monitor, if you have several PCI-E x16 slots in the motherboard, then there will not be problems if you have only one connector in the motherboard PCI-E x16, but there are PCI-E x1 connectors, you can connect it to the motherboard through a device called the pci-e 1x-16x raiser, which can be found, for example, on aliexpress.

As the first keyboard and mouse, you can use both devices with USB ports and PS / 2 ports, as a second keyboard and mouse you need to use devices with USB ports, do not try to use USB adapters> 2 PS / 2, with them you get the desired effect will not work.

LightDM should be used as the display manager; in Debian, it is used by default.

If you are using nvidia graphics cards, then you need to install a proprietary driver, as I will describe in this article, I think it will be superfluous.

Next, you need to configure X to work simultaneously with two monitors, you can do this in any way, either by creating it manually, or using any utility, if you use nvidia video cards, you can do this by running nvidia-settings from the root, to turn on the second monitor, enter X Server Display Configuration , select the second monitor, select New X screen in the Configuration field, the resolution and frequency should be set manually in the corresponding fields, at the end of the settings do not forget to click save to X configuration file.

Reboot, both monitors should work, if so, continue. We make a backup copy of the /etc/X11/xorg.conf file, after that we open it. I had it in this form:

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    Screen      1  "Screen1" RightOf "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection
Section "Files"
EndSection
Section "InputDevice"
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection
Section "InputDevice"
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection
Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "LG Electronics W2253"
    HorizSync       30.0 - 83.0
    VertRefresh     56.0 - 75.0
    Option         "DPMS"
EndSection
Section "Monitor"
    Identifier     "Monitor1"
    VendorName     "Unknown"
    ModelName      "LG Electronics LG IPS FULLHD"
    HorizSync       30.0 - 83.0
    VertRefresh     56.0 - 75.0
EndSection  
Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GT 430"
    BusID          "PCI:1:0:0"
EndSection
Section "Device"
    Identifier     "Device1"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce 8500 GT"
    BusID          "PCI:4:0:0"
EndSection
Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "metamodes" "DVI-I-1: 1920x1080_60 +0+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection
Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "metamodes" "DVI-I-1: 1920x1080_60 +0+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Make sure that you have two sections Monitor, Device and Screen , if so then we no longer touch them. We delete the ServerLayout section and add it instead:

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection
Section "ServerLayout"
    Identifier     "Layout1"
    Screen      1  "Screen1" 0 0
    InputDevice    "Keyboard1" "CoreKeyboard"
    InputDevice    "Mouse1" "CorePointer"
    Option         "Xinerama" "0"
EndSection   

Delete section InputDevice (there were two) instead add 4 sections:

Section "InputDevice"
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "ImPS/2"
    Option         "Device" "/dev/input/mouse0"
    Option         "Protocol" "ExplorerPS/2"
EndSection
Section "InputDevice"
    Identifier     "Mouse1"
    Driver         "mouse"
    Option         "Protocol" "ImPS/2"
    Option         "Device" "/dev/input/mouse1"
EndSection
Section "InputDevice"
    Identifier     "Keyboard0"
    Driver         "evdev"
    Option         "Device" "/dev/input/by-path/platform-i8042-serio-0-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-SIGMACH1P_USB_Keykoard-event-kbd"
    Option         "XkbRules" "xorg"
    Option         "XkbModel" "evdev"
    Option         "XkbLayout" "us"
    Option         "GrabDevice" "yes"
EndSection

In the Option “Device” line of each section of the InputDevice we indicate our devices , for this we look in

/ dev / input
/ dev / input / by-id
/ dev / input / by-path

their mice and keyboards, the mice are most likely to be / dev / input / mouse0 and / dev / input / mouse1, the keyboards are all individually.

After that, add the section to the beginning of the file

Section "ServerFlags"
    Option         "DefaultServerLayout" "Layout0"
    Option         "AllowMouseOpenFail"  "true"
    Option         "AutoAddDevices"      "false"
    Option         "AutoEnableDevices"   "false"
    Option         "AllowEmptyInput"     "true"
    Option         "DontZap"             "false"
    Option         "AutoAddGPU"          "false"
    Option         "DontVTSwitch"        "false"
EndSection

We make a backup copy of the /etc/lightdm/lightdm.conf file , open it, after the line:

[LightDM]

Add:

minimum-display-number=0
[SeatDefaults]
xserver-command=/usr/bin/X
user-session=xfce
greeter-session=lightdm-gtk-greeter
exit-on-failure=true
[Seat:0]
xserver-command=/usr/bin/X :0 -sharevts
autologin-guest=false
xserver-layout=Layout0
[Seat:1]
xserver-command=/usr/bin/X :1 -sharevts
autologin-guest=false
xserver-layout=Layout1

We reboot, try to log in, do not forget that you must log in under different users.

Now let's deal with the sound. In order to listen to the sound from both workstations, we do the following:

Open the /etc/pulse/default.pa file, add the line to the top of the file:

load-module module-native-protocol-unix auth-anonymous=1 socket=/tmp/my-pulse-socket-name

Open the file /etc/pulse/client.conf , insert the line at the beginning of the file

default-server = unix:/tmp/my-pulse-socket-name 

Create the file /root/pulse.sh with the following lines:

pulseaudio -k
sleep 1
pulseaudio -D
sleep 1
pulseaudio -D —system

We set permissions on it to 700. At the end of the / etc / crontab file, add the line:

@reboot root cd /root && ./pulse.sh

After this line, be sure to make one empty line. To control the sound we use pavucontrol, if it is not, then install it.

If you have two sound cards, then through pavucontrol you can choose for each application through which device to play sound, for this, in the "Play" tab opposite the corresponding application, select the desired sound card in the drop-down list, you can use one sound card for both workstations, in such In this case, sound from both workstations will be output through one speaker system.

»Just in case, I attach an archive with files from a working multiseat.zip system

Read Next