Contents
What is it?
Multi Seat refers to a PC that has more than 1 /videocard/monitor/X server/mouse/keyboard set so that more than 1 user can use the system at the same time. This is done locally with one computer, without the need for separate server hardware.
Modern computers are "multi user" in that when one person logs off another person can log in with their own unique profile, settings, and permissions-protected files. Multi-seat takes this to the next level and allows multiple users to use one computer concurrently, all with their own unique profiles and protected files.
Why?
Multiseat has several advantages:
Economic Multiple video devices are often times less expensive than whole computers, also save power
Space One computer often times take up less desk or floor room.
Networking Local multiseat implementations do not need advanced network configuration
Environment One computer is more environmentally friendly than several
Noise One computer makes less noise
Ease Adding additional computers increases package and patch upgrading complexity
Requirements
Hardware
Videocards. Plug them in and connect the monitors to them. Multiseat requires additional video devices, so if you want three seats, 3 video devices are required. Traditionally, PCI-E video cards are used for this. However, USB video devices can serve the same purpose. If your system has an Integrated Graphics Card, it can serve the function as a second video device.
If you have a modern graphics card it is possible to configure NVIDIA Optimus or PRIME, allowing additional seats to share the power of the GPU for specific tasks.
Keyboards. Multiple USB keyboards are supported well and will support 2+ users. PS/2 keyboards are also supported but you only be able to add a maximum of two PS/2 keyboards. Additional devices will need to be USB.
Mice. They'll have to be USB mice.
Software
When creating multiseat using the automatic functionality provided by loginctl, the simplest configuration is possible with Gnome Display Manager(GDM) or LightDM. Both of these have good support for automatic allocating of multiple seats across monitors.
When creating multiseat the manual way using configuration files, x.org is the only thing that is required.
Loginctl
Bookworm, Stretch, Jessie and Sid.
Through the use of systemd-loginctl, multiseat creation is handled automatically with just a few commands. This method is not supported in Buster.
The easy, modern way of setting up local multiseat requires no editing of configuration files at all. The init software systemd contains a utility called loginctl which can be used for setting up seats.
Setting up multiseat follows this pattern:
- Use loginctl to determine available devices
- Locate video card in device list, assign to seat
- Reboot
- Assign additional devices
When creating seats, loginctl sets up rules in the background only when a video card is a part of the original assignment. Without a videocard, no new seats will be created.
By default, when systemd is implemented and in use every install will be listed as seat0 and all devices will be attached to it. To get the full list of devices, determine the seat status of this seat
$loginctl seat-status seat0
loginctl will return a list of devices which include USB, sound, and other available devices. When creating a new seat simply start with the second video adapter. Video adapters in the list of devices provided by loginctl will contain the letters "drm". You may always leave card0 attached to seat0 for safety concerns. It is possible to successfully configure card0 to be on seat1+.
Theoretically your "seats" can be named anything, and in this example are named seat1. But GDM/LightDM use "seat#" format for their automatic allocation of seats.
It is easy to leave your system in an unusable state when managing devices with loginctl. Hopefully you should be able to switch to a TTY and recover, but be careful, you may need to use SysRQ. It may be difficult to get to a TTY with the right device, in such a situation it may be good to have a recovery USB on hand.
Finally, to create a working seat, issue the following command to loginctl: (using the address provided in your terminal)
#loginctl attach seat1 /sys/devices/pci0000:00/0000:00:12.0/drm/card1
After attaching the video card to the new seat, reboot. There will be two login screens now available, one on each monitor.
Use the same process as above to attach other devices to seat1 such as:
#loginctl attach seat1 /sys/devices/pci0000:00/0000:00:2.0/usb1
Using
#loginctl flush-devices
Will give back all devices to seat0, disabling all other seats. Effectively an off button for multi seat, useful if you bork something or just need to start from scratch.
Gnome Display Manager
GDM has good support for automatic multiseat out of the box. If you have issues starting your session it is likely a problem with your loginctl or Xsession configuration. Logs in /var/log/Xorg* may be helpful for debugging.
If not using proprietary NVIDIA drivers, GDM may try to default to Wayland, and that will likely not work well with multiseat. Considering disabling Wayland completely if you plan on a multiseat configuration.
Xorg has good security around the Xsession through the use of magic cookies. If local security is a concern, read through the Xsecurity manual. If keyloggers are a concern, consider airgapping your setup.
LightDM
LightDM has good support for automatic multiseat.
If you encounter bugs and LightDM does not appear on your second seat, you may need to modify /etc/lightdm/lightdm.conf
#editor /etc/lightdm/lightdm.conf ... # logind-check-graphical = True to on start seats that are marked as graphical by logind ... logind-check-graphical=true ...
See: https://help.ubuntu.com/community/MultiseatX
Bugs
Both LightDM and GDM suffer from an issue where logging out as the "master of seats", seat0, causes all sessions to logout, and leaving blank/buggy Virtual Terminals in their place.
Usually this can be fixed in place with
#systemctl restart lightdm
or
#systemctl restart gdm
Consider never logging out of seat0 and using a screen locker instead.
Why is StartX not possible? How do I use multiple TTYs?
Currently, it is impossible to use Virtual Terminals and TTYs in multiseat mode. This is due to the nature of TTYs and VTs at the kernel level. They can not differentiate between different keyboards or displays.
systemd logind does its best to work around this. It assigns "seat0" "master-of-seats", only seat0 is allowed to manage VTs. When you press CTRL+ALT+F#, that is you asking the Linux Kernel to move you to VT#.
So ideally, seat0 manages which seats spawn on which VTs and when. The problem is getting that work with StartX, and the lack of a display manager.
Which monitor Linux decides to use for VTs also seems to be at random. SystemD cannot manage where VTs spawn UNTIL you boot into X.
There appears to be no simple userspace command to manage where TTYs and VTs should appear and which seat they should be assigned to.
If you wish to attempt this, you will need to become familiar with X and logind. Recommended reading: xinit X startx loginctl logind systemd
There is also kmscon kmscon has been unmaintained since 2015 and was supposed to be a userspace replacement for TTYs. It is possible to configure multiple instances of kmscon accross multiple seats, but it is difficult to properly start the X server without a display manager.
PRIME/NVIDIA Optimus
If using a powerful display graphics card with an iGPU, it may be possible to render windows on other seats using the discrete graphics card that is powering seat0 or a different seat.
https://wiki.debian.org/AtiHowTo#Hybrid_Graphics
For free graphics drivers i.e AMD/Intel/Nouveau, test if PRIME is working with
$DRI_PRIME=1 glxinfo | grep "OpenGL renderer"
To run an application on the discrete gpu, for example SuperTuxKart
$DRI_PRIME=1 supertuxkart
With proprietary Nvidia drivers, you can use NVIDIA Optimus on the seat running on your iGPU, use this command to render a window using the GPU.
$__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia executable
$__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia supertuxkart
You can verify it is running on the discrete graphics card with nvidia-smi
$nvidia-smi
Xorg.conf specifics(LEGACY)
Wheezy, Squeeze, Etch, and Lenny.
- Everything is done in xorg.conf and gdm.conf (package gdm).
For an install that does not have systemd, install GDM and make X server links.
Assuming that you already have xorg installed, also install gdm.
- Make links to to the X server:
- for xfree86:
ln -sf /usr/X11R6/bin/X /usr/X11R6/bin/X0 ln -sf /usr/X11R6/bin/X /usr/X11R6/bin/X1
- for Xorg:
ln -sf /usr/bin/X /usr/bin/X0 ln -sf /usr/bin/X /usr/bin/X1
- Make appropriate changes in /etc/gdm/gdm.conf
... # Definition of the standard X server. [server-Standard] name=Standard server command=/usr/bin/X1 :0 -layout X1 -dpi 110 -deferglyphs 16 -isolateDevice PCI:0:10:0 vt7 flexible=true ... # Definition of the second X server. [server-2nd] name=2nd server command=/usr/bin/X0 :1 -layout X0 -dpi 110 -deferglyphs 16 -isolateDevice PCI:1:0:0 -sharevts flexible=true ...
Depending on how many users you will support. The above supports 2.
NOTE: Only the user on the first monitor has the use of vt consoles and can use Ctrl+Alt+F<x> to select them. The other users have a gdm login screen and can use X normally, but have no vt's.
The PCI addresses you get via lspci:
... 00:0a.0 VGA compatible controller: nVidia Corporation NV18 [GeForce4 MX 440 AGP 8x] (rev a2) ... 01:00.0 VGA compatible controller: nVidia Corporation NV18 [GeForce4 MX 4000 AGP 8x] (rev c1) ...
Setup xorg.conf for multiple users
Setup the keyboard Input Device sections:
... Section "InputDevice" Identifier "Keyboard0" Driver "evdev" Option "Phys" "isa0060/serio1/input0" Option "XkbLayout" "us_intl" EndSection
Section "InputDevice" Identifier "Keyboard1" Driver "evdev" Option "Phys" "isa0060/serio0/input0" Option "XkbLayout" "us_intl" EndSection ...
The Phys option data is gotten from /proc/bus/input/devices The first 2 entries read as follows:
... I: Bus=0011 Vendor=0001 Product=0002 Version=ab83 N: Name="AT Raw Set 2 keyboard" P: Phys=isa0060/serio1/input0 S: Sysfs=/class/input/input0 H: Handlers=kbd event0 B: EV=120013 B: KEY=4 2000000 3802078 f840d001 f2ffffdf ffefffff ffffffff fffffffe B: MSC=10 B: LED=7
I: Bus=0011 Vendor=0001 Product=0001 Version=ab41 N: Name="AT Translated Set 2 keyboard" P: Phys=isa0060/serio0/input0 S: Sysfs=/class/input/input1 H: Handlers=kbd event1 B: EV=120013 B: KEY=4 2000000 3802078 f840d001 f2ffffdf ffefffff ffffffff fffffffe B: MSC=10 B: LED=7 ...
Note the 2 P tags.
Setup the mouse Input Device sections:
... Section "InputDevice" Identifier "Mouse0" Driver "evdev" Option "Device" "/dev/input/event3" Option "Name" "A4Tech USB Optical Mouse" Option "ZAxisMapping" "6 7 4 5" Option "Buttons" "12" EndSection
Section "InputDevice" Identifier "Mouse1" Driver "evdev" Option "Device" "/dev/input/event4" Option "Name" "A4Tech USB Optical Mouse" Option "ZAxisMapping" "6 7 4 5" Option "Buttons" "12" EndSection ...
The Device data is gotten from the same source as the keyboards and reads as follows:
... I: Bus=000
Pulseaudio per user-sessions
- Create "/etc/profile.d/pulseaudio-multi-seat.sh" with the following content:
### Pulseaudio multi-seat # !!! Disable automatic module loading in /etc/pulse/default.pa !!! # e.g. module-detect and module-udev-detect case ${DISPLAY##*:} in 0) # TV ALSA_SINK='HDMI,3' ALSA_SOURCE='PCH,1' ;; 2) # Monitor ALSA_SINK='PCH,8' ALSA_SOURCE='PCH,0' ;; esac pactl load-module module-alsa-sink device=hw:$ALSA_SINK sink_name=default pactl load-module module-alsa-source device=hw:$ALSA_SOURCE source_name=default pactl set-sink-volume default 100% pactl set-source-volume default 100% pactl set-sink-mute default 0 pactl set-source-mute default 0
- Adjust display IDs, ALSA (sub)devices and volume level to your needs.
Sarge
Sarge (Obsolete).
Because this distribution still uses xfree86 a special module fakegetty is needed, available from http://www.ltn.lv/~aivils/?proj_id=faketty, written by Aivils Stoss, to allow for the use of multiple keyboards.
Additional Resources
For even more (assuming the resources are available) information, consider
https://en.wikipedia.org/wiki/Multiseat_configuration Has good information about theories around Multiseat but not much technical information.
https://wiki.debian.org/systemd/documentation Any advanced multiseat work will require knowledge of SystemD.
https://wiki.debian.org/LTSP - an alternative server-based solution
https://xorg.freedesktop.org/wiki/Development/Documentation/Multiseat/ Very outdated, does not take into account new systemd methods.
https://wiki.archlinux.org/title/Xorg_multiseat Very outdated, but has information on SystemD, and may have useful debugging information.
https://wiki.ubuntu.com/Multiseat Not a very useful page, some information about Linux Virtual Terminals.