This document provides a complete setup for automating two separate X sessions for different users on two displays without using `systemd` or `loginctl`.
## 1. Hardware Identification
Before applying the configurations, identify your hardware IDs:
-**GPU BusID:** Run `lspci | grep -E "VGA|3D"`. (Example: `01:00.0` becomes `PCI:1:0:0` in Xorg).
-**Input USB IDs:** Run `lsusb`. (Example: `ID 046d:c077`).
## 2. Xorg Configuration Files
Create two separate configuration files to isolate the hardware for each session.
### File: /etc/X11/xorg.seat0.conf
Section "ServerFlags"
Option "AutoAddDevices" "false"
Option "DontVTSwitch" "true"
EndSection
Section "Device"
Identifier "GPU0"
Driver "modesetting"
BusID "PCI:1:0:0" # <--- UPDATE THIS
EndSection
Section "InputClass"
Identifier "Seat0-Input"
MatchUSBID "XXXX:XXXX" # <--- UPDATE THIS (User 1 Mouse/KB)
Driver "evdev"
EndSection
### File: /etc/X11/xorg.seat1.conf
Section "ServerFlags"
Option "AutoAddDevices" "false"
Option "DontVTSwitch" "true"
EndSection
Section "Device"
Identifier "GPU1"
Driver "modesetting"
BusID "PCI:2:0:0" # <--- UPDATE THIS (Or same as above for single-GPU Zaphod)
EndSection
Section "InputClass"
Identifier "Seat1-Input"
MatchUSBID "YYYY:YYYY" # <--- UPDATE THIS (User 2 Mouse/KB)
Driver "evdev"
EndSection
## 3. LightDM Configuration
Edit your /etc/lightdm/lightdm.conf to define the seats manually and disable logind seat loading.
[LightDM]
logind-load-seats=false
[Seat:0]
xserver-command=X :0 vt7 -config xorg.seat0.conf
autologin-user=user1
autologin-user-timeout=0
user-session=your-session-name
[Seat:1]
xserver-command=X :1 vt8 -config xorg.seat1.conf
autologin-user=user2
autologin-user-timeout=0
user-session=your-session-name
## 4. Automation & Permissions Script
Save this as setup-multiseat.sh, run chmod +x setup-multiseat.sh, and execute as root.
#!/bin/bash
# 1. Ensure users exist and are in hardware groups
USERS=("user1" "user2")
for USER in "${USERS[@]}"; do
if ! id "$USER" &>/dev/null; then
useradd -m -s /bin/bash "$USER"
echo "User $USER created."
fi
# Vital: Without logind, users need direct group access to hardware