https://wiki.archlinux.org/api.php?action=feedcontributions&user=Shillshocked&feedformat=atomArchWiki - User contributions [en]2024-03-29T07:24:40ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Xorg_multiseat&diff=297667Xorg multiseat2014-02-15T08:33:32Z<p>Shillshocked: /* For LightDM (Light Display Manager) - explanation */</p>
<hr />
<div>{{Expansion|Show how PulseAudio can be configured for multiple users without running PulseAudio system-wide. Explain how Multiseat be done using only one video card (and/or X Server) and without Xephyr.}}<br />
<br />
[[Category:X Server]]<br />
Multiseat is a certain setup where multiple users work simultaneously on one computer. This is achieved by having two monitors, two keyboards and two mice. The advantages are quite obvious:<br />
* Less power consumption (only one computer)<br />
* Less hardware to purchase<br />
* All the cool kids do it<br />
<br />
==Requirements==<br />
<br />
===Keyboards and mice===<br />
<br />
Any standard PS/2 or USB keyboards will suffice. Same thing for mice.<br />
<br />
===Graphics hardware===<br />
<br />
For the best possible result you'll need two graphics cards. I used an nVidia FX5500 AGP and an nVidia 6200 PCI. If you look around a bit you can certainly find new and decent PCI graphics card for a soft price.<br />
<br />
It is possible to use only one videocard which has dual heads (like most nvidia cards will have), but this has some limitations: you have to use Xephyr on the second monitor which seems quite a messy solution from what I've read, and for optimal usage both screens need the same resolution.<br />
<br />
If you have two pci-express slots, take advantage of them! That way you'll even be able to play two games at the same time. (PCI is too slow to play comfortably)<br />
<br />
===Processors and memory===<br />
<br />
If you really are working with two users on the same computer, I'd at least recommend a dual-core processor and plenty of RAM. A fast hard drive (10.000 RPM or higher) is also recommended for comfortable use.<br />
<br />
===Software===<br />
<br />
You'll need Xorg with the drivers for your graphics card (according to some sources, the closed source nvidia driver works better than the open source nv driver for this, I have t tested this myself) and the evdev (xf86-input-evdev) driver. That's all. All this can be found in the Arch Linux core and extra repositories.<br />
<br />
===Some X knowledge===<br />
<br />
If you know how X works this will be a lot easier. Before you start, I recommend generating a clean configuration with xorgconfig that works with a single screen. Read through this xorg configuration and make yourself familiar. And as usual the manpages will provide you with most of the answers. You may reference some man pages: xorg, xserver, startx, xdm, xinit.<br />
'''sudo X -configure''', '''X -showopts''' may give you some hint.<br />
<br />
==Definitions==<br />
<br />
For this article to be clear, I'll be using the following definitions:<br />
* screen: A screen is something Xorg can display its stuff on. A screen has a monitor and a graphics card assigned to it.<br />
* monitor: A physical monitor like the one you're now sitting in front of.<br />
* server layout: a definition of which screen, keyboard and mouse to use.<br />
* seat: A workplace with a physical monitor, physical keyboard and physical mouse.<br />
<br />
==Tips and tricks==<br />
<br />
* Set up ssh on your computer, so you can ssh to the machine from another computer (such as a laptop). This is very useful because you'll probably run into X not responding anymore or not giving you picture at all.<br />
* Finding out which keyboard and mouse is which: open a terminal and use cat to find out. For example, {{ic|cat /dev/input/mouse1}}. If you then move your mouse and you see all weird things happening than that is the mouse you're moving. Same goes for keyboards, which are called eventN.<br />
* Try a basic configuration first. Don't start with the fancy stuff yet, get a very basic Xorg working first.<br />
* Leave your {{ic|xorg.conf}} alone and create a new file, called {{ic|xorg.conf.multiseat}} in {{ic|/etc/X11}} to store your new multiseat configuration. After this configuration is working you can overwrite the {{ic|xorg.conf}} file with your new {{ic|xorg.conf.multiseat}}.<br />
* Create a backup of all relevant configuration files. What do you mean you'll skip this one?<br />
* Take a look at the full configuration I used at the end of this article before you start.<br />
<br />
==About evdev==<br />
<br />
evdev is an Xorg driver which can make use of the kernel event devices, which you can find in {{ic|/dev/input}}.<br />
<br />
==Setting up Xorg==<br />
<br />
The logic behind this is that you have two server layouts, each assigned with their own keyboard, mouse, video card and monitor. <br />
<br />
===The basics===<br />
<br />
First of all we'll set up the basics for xorg.<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "AllowMouseOpenFail" "on"<br />
Option "AllowEmptyInput" "on"<br />
Option "ZapWarning" "on"<br />
Option "HandleSpecialKeys" "off" # Zapping on<br />
Option "DRI2" "on"<br />
Option "Xinerama" "off"<br />
EndSection<br />
}}<br />
<br />
===Defining available input devices===<br />
<br />
This part of the configuration tells Xorg which input devices it has available. Input devices are keyboards and mice, but can also be, for example, touchscreens and pens.<br />
<br />
This section defines my first keyboard, called keyboard0. As you can seen it uses the evdev driver. {{ic|/dev/input/event1}} corresponds with the keyboard connected to the PS/2 port of my computer. Create a section like this for each keyboard you have. Don't forget to modify the identifier of course. Keep the identifier simple and match it with the other names. This keyboard0 will be used for screen0 together with mouse0.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
# Option "Device" "/dev/input/by-path/platform-i8042-serio-0-event-kbd" <br />
# Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-kbd"<br />
Option "xkb_rules" "evdev"<br />
Option "xkb_model" "evdev"<br />
Option "xkb_layout" "us"<br />
Option "GrabDevice" "on" # prevent send event to other X-servers<br />
# If you are using a non en_US keyboard, set the layout here.<br />
# Option "XkbLayout" "be"<br />
EndSection<br />
}}<br />
<br />
<br />
This section defines my first mouse, called mouse0. This uses the regular mouse driver. /dev/input/mouse2 corresponds with the mouse connected to the PS/2 port of my computer. Create a section like this for each mouse you have.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse2"<br />
EndSection<br />
# or use evdev, that could assign by id<br />
Section "InputDevice"<br />
Identifier "Mouse0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
}}<br />
<br />
===Graphics card===<br />
<br />
Now we'll set up the graphics card for each screen.<br />
<br />
{{bc|<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "NoLogo" "1" # Remove nvidia branding at startup<br />
BusId "PCI:1:0:0"<br />
Option "ProbeAllGpus" "false" # Only required for nvidia<br />
EndSection<br />
}}<br />
<br />
This section defines my first graphics card, called nvidia0. This uses the closed source nvidia driver. Take a close look at the BusID. This option specifies which hardware card to use. You can find out the BusId's with lspci. However, you'll soon find out this doesn't always match. That's because lspci displays the device address in hexadecimal form. Xorg however uses decimal form. So you'll need to convert your address from hexadecimal form to decimal. Thus a device address of 0:0a:0 in lspci would become 0:10:0 in {{ic|xorg.conf}}.<br />
<br />
Create a section like this for every graphics card you have.<br />
<br />
===Screens===<br />
<br />
This section defines my first screen, called screen0. Pay close attention to the "monitor" option. For easy recognition I called it the model of my monitor.<br />
<br />
{{bc|<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
}}<br />
<br />
Create a section like this for every screen you have.<br />
<br />
===Monitors===<br />
<br />
This section defines my first monitor, l1730s. Pay close attention to the identifier.<br />
<br />
{{bc|<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
}}<br />
<br />
Create section like this for every monitor you have.<br />
<br />
===Serverlayout===<br />
<br />
Here's the fun stuff. This is how everything is added up. This is my first seat, called seat0. Here I tell Xorg for the server layout called "seat0" to use my screen0, which is attached to nvidia0, using keyboard0 and mouse0.<br />
<br />
The AutoAddDevices option is now needed to keep HAL from automatically adding all your input devices to all the X servers.<br />
<br />
{{bc|<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "Clone" "off"<br />
Option "AutoAddDevices" "off"<br />
Option "DisableModInDev" "true"<br />
Option "SingleCard" "on" # use this to simplfied isolatedevice option <br />
EndSection<br />
}}<br />
<br />
Create a section like this for every seat you have with their respective keyboards, mice and screens.<br />
<br />
==Testing==<br />
Before we start modifying our login manager, we'll first start with testing out the individual seats. If these are working, then we're good to go.<br />
<br />
I've used twm (tiny window manager) to test out if my seats work, but there's no reason you can't use KDE, gnome, or any other desktop environment or window manager. I've used this in my {{ic|~/.xinitrc}}:<br />
exec twm<br />
<br />
Use the following command to test out an individual seat:<br />
startx -- -layout seat0 -config xorg.conf.multiseat<br />
<br />
Do this for every seat you have. If they are all working correctly and the keyboard/mouse combination matches, then congratulations! You are almost finished! In case you are wondering why I didn't you use the full path to my new configuration file, that's because X doesn't allow that when running as non-root. It will search for xorg.conf.multiseat relative to {{ic|/etc/X11}}.<br />
<br />
==Setting up the loginmanager==<br />
<br />
===For KDM (KDE's Display Manager)===<br />
<br />
Open {{ic|/usr/share/config/kdm/kdmrc}} and set the following variables:<br />
<br />
{{bc|1=<br />
StaticServers=:0,:1 #In the case of two seats. If you have three this would become :0,:1,:2 and so forth.<br />
ReserveServers=:2,:3 #You can define here as many as you want, but these should always start at the highest seat + 1.<br />
}}<br />
Next you'll need to add an [X-:n-Core] for each seat (where n = the seat)<br />
{{bc|1=<br />
[X-:0-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat0<br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch<br />
}}<br />
<br />
Add section like this for every seat you have, and do not forget to change the :0 and the -layout seat0. Note that the "-sharevts" and "-novtswitch" options should be added for all seats ''except'' the first one. Otherwise, you can end with rectangles of virtual terminals "showing through" on your primary screen.<br />
<br />
===For GDM (Gnome's Display Manager)===<br />
{{note|The following will work with GDM 2.20 but not with newer versions of GDM. GDM 2.20 is in AUR.}}<br />
<br />
Open {{ic|/etc/gdm/custom.conf}} and set the following variables (This sample demos two seats):<br />
{{bc|1=<br />
[servers]<br />
0=Standard0<br />
1=Standard1<br />
<br />
[server-Standard0]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat0<br />
flexible=true<br />
<br />
[server-Standard1]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat1<br />
flexible=true<br />
}}<br />
<br />
===For XDM (X Display Manager)===<br />
<br />
Open {{ic|/etc/X11/xdm/Xservers}} and set the following variables (This sample demos two seats):<br />
<br />
{{bc|<br />
# NOTE: don't add -sharevts on seat0, otherwise it may reset in about 10~20 minutes automatically.<br />
:0 local /usr/bin/X :0 vt07 -nolisten tcp -novtswitch -layout seat0 -config xorg.conf.multiseat<br />
:1 local /usr/bin/X :1 vt08 -nolisten tcp -sharevts -novtswitch -layout seat1 -config xorg.conf.multiseat<br />
}}<br />
<br />
Also if you use the Archlinux theme edit {{ic|/etc/X11/xdm/xdm-config}} for every screen:<br />
<br />
{{bc|<br />
DisplayManager._0.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._0.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._0.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
DisplayManager._1.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._1.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._1.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
}}<br />
<br />
===For LightDM (Light Display Manager)===<br />
<br />
LightDM works well with ALSA only and PulseAudio removed if you wish to have shared audio, an alsamixer equalizer and software mixing.<br />
<br />
In the example below LightDM and MATE with ALSA was installed with PulseAudio removed. PulseAudio could also be used but it requires a more complicated configuration to maintain high audio quality. The relevant hardware used is an ATI Radeon HD 5850 and an Intel Sandy Bridge (onboard) HD 3000. You configuration may vary.<br />
<br />
Open {{ic|/etc/lightdm/lightdm.conf}} and follow the sample. Autologin is optional. This works both as multi-user multiseat and single user multi-seat. In the first case only the last user to login will have audio control and access. Specific hardware could be addressed in {{ic|/etc/asound.conf}} to allocate audio to both users simultaneously if required. Another option enables two different users to both access audio with their own equalizer (described further down). The sound card will be shared equally among the seats using ALSA with PulseAudio removed - libpulse itself should be kept for various software dependencies however:<br />
<br />
{{bc|1=<br />
[LightDM]<br />
greeter-user=lightdm<br />
log-directory=/var/log/lightdm<br />
run-directory=/run/lightdm<br />
<br />
[SeatDefaults]<br />
xserver-command=/usr/bin/X<br />
greeter-session=lightdm-gtk-greeter<br />
greeter-show-manual-login=true<br />
user-session=mate<br />
session-wrapper=/etc/lightdm/Xsession<br />
pam-service=lightdm-autologin<br />
exit-on-failure=true<br />
<br />
[Seat:0]<br />
xserver-command=/usr/bin/X :0 -sharevts<br />
xserver-layout=Layout0<br />
#autologin-user=joeblow<br />
#autologin-user-timeout=-1<br />
#session-setup-script=/etc/lightdm/scripts/sound_start<br />
#session-cleanup-script=/etc/lightdm/scripts/sound_stop<br />
<br />
[Seat:1]<br />
xserver-command=/usr/bin/X :1 -sharevts<br />
xserver-layout=Layout1<br />
#autologin-user=jillschmill<br />
#autologin-user-timeout=-1<br />
}}<br />
<br />
Next, remove respective {{ic|~/.asoundrc}} files (as well as related PulseAudio config files if you removed that) and follow this template with {{ic|/etc/asound.conf}} for sound:<br />
<br />
{{bc|<br />
defaults.pcm.rate_converter "samplerate_best"<br />
<br />
ctl.equal {<br />
type equal;<br />
}<br />
<br />
pcm.plugequal {<br />
type equal;<br />
# Modify the line below if you do not<br />
# want to use sound card 0.<br />
#slave.pcm "plughw:0,0";<br />
#by default we want to play from more sources at time:<br />
slave.pcm "plug:dmix";<br />
}<br />
#pcm.equal {<br />
# If you do not want the equalizer to be your<br />
# default soundcard comment the following<br />
# line and uncomment the above line. (You can<br />
# choose it as the output device by addressing<br />
# it with specific apps,eg mpg123 -a equal 06.Back_In_Black.mp3)<br />
pcm.!default {<br />
type plug;<br />
slave.pcm plugequal;<br />
}<br />
}}<br />
<br />
But if you wish to share audio equally among different users, add each user to the audio group:<br />
<br />
Example:<br />
{{bc|<br />
usermod -a -G ftp joeblow<br />
usermod -a -G ftp jillschmill<br />
}}<br />
<br />
Then put this in each user's respective ~/.asoundrc rather than using /etc/asound.conf (this option also contains various tweaks to improve audio quality):<br />
{{bc|1=<br />
defaults.pcm.rate_converter "samplerate_best"<br />
<br />
ctl.equal {<br />
type equal;<br />
}<br />
<br />
pcm.ossmix {<br />
type dmix<br />
ipc_key 1024 # must be unique!<br />
ipc_key_add_uid false # let multiple users share<br />
ipc_perm 0666 # IPC permissions for multi-user sharing (octal, default 0600)<br />
slave {<br />
pcm "hw:0,0" # you cannot use a "plug" device here, darn.<br />
period_time 0<br />
period_size 1024 # must be power of 2.<br />
buffer_size 8192 # ditto.<br />
rate 44100<br />
#format "S32_LE"<br />
#periods 128 # dito.<br />
#rate 8000 # with rate 8000 you *will* hear,<br />
# if ossmix is used :)<br />
}<br />
# bindings are cool. This says, that only the first<br />
# two channels are to be used by dmix, which is<br />
# enough for (most) oss apps and also lets <br />
# multichannel chips work much faster:<br />
bindings {<br />
0 0 # from 0 => to 0<br />
1 1 # from 1 => to 1<br />
}<br />
}<br />
<br />
pcm.plugequal {<br />
type equal;<br />
# Modify the line below if you do not<br />
# want to use sound card 0.<br />
#slave.pcm "plughw:0,0";<br />
#by default we want to play from more sources at time:<br />
slave.pcm "plug:ossmix";<br />
}<br />
<br />
#pcm.equal {<br />
# If you do not want the equalizer to be your<br />
# default soundcard comment the following<br />
# line and uncomment the above line. (You can<br />
# choose it as the output device by addressing<br />
# it with specific apps,eg mpg123 -a equal 06.Back_In_Black.mp3)<br />
pcm.!default {<br />
type plug;<br />
slave.pcm plugequal;<br />
}<br />
}}<br />
<br />
Accessing the equalizer can be done with:<br />
<br />
{{bc|<br />
alsaequal -D equal<br />
}}<br />
<br />
In the previous case, each user has an equalizer they can configure separately.<br />
<br />
Make sure to turn down and mute the audio channels that you do not use, turn off auto-mute microphone, and make sure no channel has a gain higher than 0 to avoid ALSA audio bugs. This can be done via alsamixer.<br />
<br />
Finally you must set the {{ic|/etc/X11/xorg.conf}} file. You'll notice some options have been commented out which could be set according to your needs. Here is a sample, adjust to your own system configuration after determing hardware information:<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "DefaultServerLayout" "Layout1"<br />
# Option "AllowMouseOpenFail" "true"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "DontZap" "false"<br />
Option "Xinerama" "0"<br />
Option "AutoAddGPU" "FALSE"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "kbd_0" "CoreKeyboard"<br />
InputDevice "mouse_0" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true" <br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout1"<br />
Screen 0 "Screen1" 0 0<br />
InputDevice "kbd_1" "CoreKeyboard"<br />
InputDevice "mouse_1" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true"<br />
EndSection<br />
<br />
Section "Module"<br />
# Load "dri2"<br />
# Load "glamoregl"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.6:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:04:00.0-usb-0:1:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.5:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.3:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
# Option "DPMS" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "radeon"<br />
# Option "AccelMethod" "glamor"<br />
Option "AccelMethod" "EXA"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:1:0:0"<br />
Screen 0<br />
# Option "EXAVSync"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device1"<br />
Driver "intel"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:0:2:0"<br />
Screen 0<br />
# Option "AccelMethod" "UXA"<br />
# Option "TearFree" "1"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Device0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen1"<br />
Device "Device1"<br />
Monitor "Monitor1"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
Additional Tips:<br />
<br />
* Make sure to delete the {{ic|~/.Xauthority}} file in respective user directories before the initial reboot.<br />
<br />
* To avoid tearing this seems to help on nearly all configurations - add this to /etc/environment:<br />
{{bc|1=<br />
CLUTTER_PAINT=disable-clipped-redraws:disable-culling<br />
CLUTTER_VBLANK=True<br />
}}<br />
<br />
* To help avoid tearing on the web and maintain site compatibility it is advisable to install Pipelight for playing media online.<br />
<br />
===For Auto Login multiseat (without Display Manager)===<br />
<br />
edit a script /boot/twin.sh<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
cmd1="/bin/bash --login -c \"/usr/bin/xinit --"<br />
cmd2="-nolisten tcp -keeptty -novtswitch -config xorg.multiseat.conf"<br />
usr=(user1 user2) # FIXME: assume user1, user2 is valid user id<br />
declare -a pid<br />
while true ; do<br />
for ((i=0; i<${#usr[*]}; i++)) ; do<br />
echo "usr[$i]=${usr[$i]} pid=${pid[$i]}"<br />
if [ -z "${pid[$i]}" ] || [ ! -d "/proc/${pid[$i]}" ] ; then<br />
# echo "pid ${pid[$i]} killed, execute again" <br />
cmd3="-layout seat$i vt0"$((7+i))"\""<br />
if [ $i -gt 0 ] ; then<br />
cmd3="-sharevts $cmd3"<br />
fi<br />
#echo "cmd3=$cmd3"<br />
/bin/su ${usr[$i]} -l -c "$cmd1 :$i $cmd2 $cmd3" &<br />
pid[$i]=$!<br />
#echo "new pid=${pid[$i]}"<br />
fi<br />
done<br />
sleep 5 # check process exist per 5 second<br />
done<br />
</nowiki>}}<br />
<br />
Open {{ic|/etc/inittab}} and setup as follows:<br />
<br />
{{bc|<br />
#id:3:initdefault:<br />
id:5:initdefault:<br />
...<br />
x2:5:once:/root/twin.sh > /root/twin.log 2>&1<br />
}}<br />
<br />
==Troubleshooting==<br />
<br />
===My Windows key doesn't work anymore===<br />
<br />
Put this in [[Execute commands after X start|a startup file]]:<br />
xmodmap -e "add Mod4 = Super_L Super_R"<br />
<br />
===Unreliable behaviour (black picture without cursor)===<br />
<br />
If everything seems to be set up correctly, but for some reason you always get a black picture without a cursor, try setting the first initialized card in the BIOS to be the PCI card one.<br />
<br />
===Little black boxes/dots on the desktop===<br />
<br />
This is actually portions of the virtual terminals being painted on top of X. It seems to be caused by the Linux kernel framebuffer. This can be fixed by disabling the framebuffer, or by removing the "-sharevts" option from the primary seat's X args.<br />
<br />
===Multimedia keys not working===<br />
<br />
If your keyboard(s) has extra "multimedia" keys, you may find that they stopped working in your multiseat setup. This is because such keyboards are often represented as more then one "event" device. As you did above, cat each /dev/input/event* device, this time pressing multimedia keys. Once you've found the right event device, add a separate keyboard InputDevice section for it, then add that InputDevice section to the corresponding ServerLayout section with the "SendCoreEvents" option, which indicates that input from this device should be handled, despite not being the core keyboard. In the end you should have sections something like the following:<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "Keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event6"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "Keyboard0Multimedia"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event7"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "Keyboard0" "CoreKeyboard"<br />
InputDevice "Keyboard0Multimedia" "SendCoreEvents"<br />
InputDevice "Mouse0" "CorePointer"<br />
Option "AutoAddDevices" "no"<br />
EndSection<br />
}}<br />
<br />
===The Ctrl-Alt-Fx, Alt-Fx keys mess up with virtual terminals===<br />
<br />
(Oct 2010) I follows this guide and everything works, except for Atl-F1, Atl-F2,... mess things up. Then I follow this guide https://help.ubuntu.com/community/MultiseatX (read the part for Ubuntu 10.04):<br />
<br />
{{bc|<br />
# cd /usr/bin<br />
# ln -s X X0<br />
# ln -s X X1<br />
}}<br />
<br />
Then fix in the '''/usr/share/config/kdm/kdmrc''' as follow<br />
<br />
{{bc|1=<br />
[General]<br />
ConsoleTTYs=tty1,tty2,tty3,tty4,tty5,tty6<br />
ServerVTs=7,8<br />
StaticServers=:0,:1<br />
ReserveServers=:2,:3<br />
...<br />
<br />
[X-:0-Core]<br />
ServerVT=8<br />
ServerCmd=/usr/bin/X1<br />
ServerArgsLocal=-nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0<br />
<br />
[X-:1-Core]<br />
ServerVT=7<br />
ServerCmd=/usr/bin/X0<br />
ServerArgsLocal=-nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0<br />
...<br />
}}<br />
<br />
It works for my computer: one on-board Intel card (xf86-video-intel driver), and one Nvidia card (xf86-video-nouveau driver). You can check if the parameters are passed correctly by:<br />
<br />
{{bc|<nowiki><br />
$ ps aux | grep 'PCI' | grep -Ev 'grep'<br />
root 16993 1.6 1.3 32900 26772 ? S 08:09 0:19 /usr/bin/X0 :1 vt7 -nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0 -auth /var/run/xauth/A:1-ES6CCb<br />
root 17124 5.9 0.5 18996 11980 ? S 08:09 1:09 /usr/bin/X1 :0 vt8 -nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0 -auth /var/run/xauth/A:0-Wgiyza<br />
<br />
</nowiki>}}<br />
<br />
The '''ServerVT=7''', '''ServerVT=8''' would be pass to as '''vt7''', '''vt8'''<br />
<br />
==Final configuration==<br />
<br />
===/etc/X11/xorg.conf===<br />
<br />
This is my full xorg.conf with multiseat that works:<br />
{{bc|<br />
Section "Module"<br />
Load "dbe"<br />
<br />
SubSection "extmod"<br />
Option "omit xfree86-dga"<br />
EndSubSection<br />
<br />
Load "type1"<br />
Load "speedo"<br />
Load "freetype"<br />
Load "glx"<br />
EndSection<br />
<br />
<br />
Section "Files"<br />
RgbPath "/usr/share/X11/rgb"<br />
<br />
FontPath "/usr/share/fonts/misc"<br />
FontPath "/usr/share/fonts/75dpi"<br />
FontPath "/usr/share/fonts/100dpi"<br />
FontPath "/usr/share/fonts/TTF"<br />
FontPath "/usr/share/fonts/Type1"<br />
FontPath "/usr/share/fonts/msfonts"<br />
FontPath "/usr/share/fonts/misc2"<br />
FontPath "/usr/share/fonts/local"<br />
FontPath "/usr/local/share/fonts"<br />
EndSection<br />
<br />
<br />
Section "ServerFlags"<br />
# Option "DontZap"<br />
Option "AllowMouseOpenFail" "true"<br />
# Option "DefaultServerLayout" "alltogether"<br />
Option "Xinerama" "0"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event5"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2" # Auto detect<br />
Option "Device" "/dev/input/mouse2"<br />
Option "ZAxisMapping" "4 5"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse1"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse1"<br />
EndSection<br />
<br />
<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:1:0:0"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "nvidia1"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:0:10:0"<br />
EndSection<br />
<br />
<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "screen1"<br />
Device "nvidia1"<br />
Monitor "cpdm151"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1024x768" "800x600"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat1"<br />
Screen "screen1" 0 0<br />
InputDevice "mouse1" "CorePointer"<br />
InputDevice "keyboard1" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "Extensions"<br />
Option "Composite" "Disable"<br />
Option "RENDER" "Enable"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "cpdm151"<br />
Option "dpms"<br />
HorizSync 30-61<br />
VertRefresh 60<br />
EndSection<br />
}}<br />
<br />
===/opt/kde/share/config/kdm/kdmrc===<br />
<br />
This is my kdmrc:<br />
<br />
{{bc|1=<br />
[General]<br />
ConfigVersion=2.3<br />
ConsoleTTYs=vc/1,vc/2,vc/3,vc/4,vc/5,vc/6<br />
PidFile=/var/run/kdm.pid<br />
ReserveServers=:2,:3<br />
ServerVTs=-7<br />
StaticServers=:0,:1<br />
<br />
[Shutdown]<br />
BootManager=Grub<br />
HaltCmd=/sbin/halt<br />
RebootCmd=/sbin/reboot<br />
<br />
[X-*-Core]<br />
AllowNullPasswd=false<br />
AllowRootLogin=false<br />
AllowShutdown=Root<br />
Authorize=true<br />
AutoReLogin=false<br />
ClientLogFile=.xsession-errors-%s<br />
Reset=/opt/kde/share/config/kdm/Xreset<br />
Resources=/opt/kde/share/config/kdm/Xresources<br />
Session=/opt/kde/share/config/kdm/Xsession<br />
SessionsDirs=/etc/X11/sessions,/usr/share/xsessions,/opt/kde/share/apps/kdm/sessions<br />
Setup=/opt/kde/share/config/kdm/Xsetup<br />
Startup=/opt/kde/share/config/kdm/Xstartup<br />
<br />
[X-*-Greeter]<br />
AllowConsole=true<br />
AntiAliasing=true<br />
AuthComplain=true<br />
BackgroundCfg=/opt/kde/share/config/kdm/backgroundrc<br />
ColorScheme=<br />
DefaultUser=<br />
EchoMode=OneStar<br />
FaceSource=PreferUser<br />
FailFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
FocusPasswd=false<br />
ForgingSeed=1097313140<br />
GUIStyle=<br />
GreetFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
GreetString=Arch Linux %r (%h)<br />
GreeterPos=50,50<br />
HiddenUsers=root<br />
Language=en_US<br />
LogoArea=None<br />
LogoPixmap=<br />
MaxShowUID=65000<br />
MinShowUID=500<br />
PreselectUser=None<br />
SelectedUsers=<br />
ShowUsers=NotHidden<br />
SortUsers=true<br />
StdFont=Tahoma,11,-1,5,50,0,0,0,0,0<br />
UseBackground=false<br />
UserCompletion=false<br />
UserList=true<br />
<br />
[X-:*-Core]<br />
AllowNullPasswd=true<br />
AllowRootLogin=true<br />
AllowShutdown=All<br />
NoPassEnable=false<br />
NoPassUsers=<br />
<br />
[X-:*-Greeter]<br />
AllowClose=true<br />
DefaultUser=glenn<br />
FocusPasswd=true<br />
LoginMode=DefaultLocal<br />
PreselectUser=Previous<br />
<br />
[X-:0-Core]<br />
AutoLoginAgain=false<br />
AutoLoginDelay=0<br />
AutoLoginEnable=false<br />
AutoLoginLocked=false<br />
AutoLoginUser=glenn<br />
ClientLogFile=.xsession-errors<br />
ServerArgsLocal=-nolisten tcp -layout seat0 -sharevts -novtswitch <br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch <br />
<br />
[Xdmcp]<br />
Enable=false<br />
Willing=/opt/kde/share/config/kdm/Xwilling<br />
Xaccess=/opt/kde/share/config/kdm/Xaccess<br />
}}<br />
<br />
==Related problems==<br />
<br />
===PulseAudio===<br />
If two users want to use the sound card simultaneously, it is necessary to use a sound server, [[PulseAudio]] being most prevalent. Usually, the PulseAudio server runs only for active user and does not allow for multiple user instances. Solution to this problem is using the system-wide PulseAudio server. Although this approach is discouraged by its authors, it is probably most applicable setup.<br />
<br />
;Configuring for system-wide PulseAudio<br />
* Create user pulse and put him into group audio (PulseAudio drops root privileges and changes to user pulse. Group membership allows for device access.)<br />
* Create group pulse-access and put users, who will play sound locally into it (Group membership is used for access control for local access to PA daemon.)<br />
* In /etc/pulse/default.pa state explicitly the access rights<br />
{{bc|1=<br />
load-module module-native-protocol-unix auth-group=pulse-access auth-group-enable=1<br />
}}<br />
<br />
Start PA as system-wide, under root: {{bc|pulseaudio --system}}<br />
<br />
In {{ic|/var/run/pulse}} should appear files for communication with daemon, namely pid and native. <br />
<br />
;User access<br />
You can check communication with system daemon as non-root by e.g. {{ic|pactl -s "unix:/var/run/pulse/native" list}}.<br />
<br />
It is possible to enable automatic connection to local daemon in /etc/pulse/client.conf<br />
{{bc|1=<br />
auto-connect-localhost = yes<br />
}}<br />
<br />
The users should be able to connect to PA server. All the cons for system-wide daemon become essentially pros, e.g. ability to control volume of other users streams in pavucontrol.<br />
<br />
;Troubleshooting<br />
It is possible to enable the http interface to PA for debugging in /etc/pulse/default.pa<br />
{{ic|load-module module-http-protocol-tcp}} and then connect to it at http://localhost:4714/<br />
<br />
==See also==<br />
*[https://bbs.archlinux.org/viewtopic.php?id=105450 The original Arch Forums thread].<br />
<br />
*The arckwiki page [[Multi-pointer X]] explains how to setup two separate pair of devices on the same session.</div>Shillshockedhttps://wiki.archlinux.org/index.php?title=Xorg_multiseat&diff=297621Xorg multiseat2014-02-15T07:39:57Z<p>Shillshocked: /* For LightDM (Light Display Manager) - fixed up comments */</p>
<hr />
<div>{{Expansion|Show how PulseAudio can be configured for multiple users without running PulseAudio system-wide. Explain how Multiseat be done using only one video card (and/or X Server) and without Xephyr.}}<br />
<br />
[[Category:X Server]]<br />
Multiseat is a certain setup where multiple users work simultaneously on one computer. This is achieved by having two monitors, two keyboards and two mice. The advantages are quite obvious:<br />
* Less power consumption (only one computer)<br />
* Less hardware to purchase<br />
* All the cool kids do it<br />
<br />
==Requirements==<br />
<br />
===Keyboards and mice===<br />
<br />
Any standard PS/2 or USB keyboards will suffice. Same thing for mice.<br />
<br />
===Graphics hardware===<br />
<br />
For the best possible result you'll need two graphics cards. I used an nVidia FX5500 AGP and an nVidia 6200 PCI. If you look around a bit you can certainly find new and decent PCI graphics card for a soft price.<br />
<br />
It is possible to use only one videocard which has dual heads (like most nvidia cards will have), but this has some limitations: you have to use Xephyr on the second monitor which seems quite a messy solution from what I've read, and for optimal usage both screens need the same resolution.<br />
<br />
If you have two pci-express slots, take advantage of them! That way you'll even be able to play two games at the same time. (PCI is too slow to play comfortably)<br />
<br />
===Processors and memory===<br />
<br />
If you really are working with two users on the same computer, I'd at least recommend a dual-core processor and plenty of RAM. A fast hard drive (10.000 RPM or higher) is also recommended for comfortable use.<br />
<br />
===Software===<br />
<br />
You'll need Xorg with the drivers for your graphics card (according to some sources, the closed source nvidia driver works better than the open source nv driver for this, I have t tested this myself) and the evdev (xf86-input-evdev) driver. That's all. All this can be found in the Arch Linux core and extra repositories.<br />
<br />
===Some X knowledge===<br />
<br />
If you know how X works this will be a lot easier. Before you start, I recommend generating a clean configuration with xorgconfig that works with a single screen. Read through this xorg configuration and make yourself familiar. And as usual the manpages will provide you with most of the answers. You may reference some man pages: xorg, xserver, startx, xdm, xinit.<br />
'''sudo X -configure''', '''X -showopts''' may give you some hint.<br />
<br />
==Definitions==<br />
<br />
For this article to be clear, I'll be using the following definitions:<br />
* screen: A screen is something Xorg can display its stuff on. A screen has a monitor and a graphics card assigned to it.<br />
* monitor: A physical monitor like the one you're now sitting in front of.<br />
* server layout: a definition of which screen, keyboard and mouse to use.<br />
* seat: A workplace with a physical monitor, physical keyboard and physical mouse.<br />
<br />
==Tips and tricks==<br />
<br />
* Set up ssh on your computer, so you can ssh to the machine from another computer (such as a laptop). This is very useful because you'll probably run into X not responding anymore or not giving you picture at all.<br />
* Finding out which keyboard and mouse is which: open a terminal and use cat to find out. For example, {{ic|cat /dev/input/mouse1}}. If you then move your mouse and you see all weird things happening than that is the mouse you're moving. Same goes for keyboards, which are called eventN.<br />
* Try a basic configuration first. Don't start with the fancy stuff yet, get a very basic Xorg working first.<br />
* Leave your {{ic|xorg.conf}} alone and create a new file, called {{ic|xorg.conf.multiseat}} in {{ic|/etc/X11}} to store your new multiseat configuration. After this configuration is working you can overwrite the {{ic|xorg.conf}} file with your new {{ic|xorg.conf.multiseat}}.<br />
* Create a backup of all relevant configuration files. What do you mean you'll skip this one?<br />
* Take a look at the full configuration I used at the end of this article before you start.<br />
<br />
==About evdev==<br />
<br />
evdev is an Xorg driver which can make use of the kernel event devices, which you can find in {{ic|/dev/input}}.<br />
<br />
==Setting up Xorg==<br />
<br />
The logic behind this is that you have two server layouts, each assigned with their own keyboard, mouse, video card and monitor. <br />
<br />
===The basics===<br />
<br />
First of all we'll set up the basics for xorg.<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "AllowMouseOpenFail" "on"<br />
Option "AllowEmptyInput" "on"<br />
Option "ZapWarning" "on"<br />
Option "HandleSpecialKeys" "off" # Zapping on<br />
Option "DRI2" "on"<br />
Option "Xinerama" "off"<br />
EndSection<br />
}}<br />
<br />
===Defining available input devices===<br />
<br />
This part of the configuration tells Xorg which input devices it has available. Input devices are keyboards and mice, but can also be, for example, touchscreens and pens.<br />
<br />
This section defines my first keyboard, called keyboard0. As you can seen it uses the evdev driver. {{ic|/dev/input/event1}} corresponds with the keyboard connected to the PS/2 port of my computer. Create a section like this for each keyboard you have. Don't forget to modify the identifier of course. Keep the identifier simple and match it with the other names. This keyboard0 will be used for screen0 together with mouse0.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
# Option "Device" "/dev/input/by-path/platform-i8042-serio-0-event-kbd" <br />
# Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-kbd"<br />
Option "xkb_rules" "evdev"<br />
Option "xkb_model" "evdev"<br />
Option "xkb_layout" "us"<br />
Option "GrabDevice" "on" # prevent send event to other X-servers<br />
# If you are using a non en_US keyboard, set the layout here.<br />
# Option "XkbLayout" "be"<br />
EndSection<br />
}}<br />
<br />
<br />
This section defines my first mouse, called mouse0. This uses the regular mouse driver. /dev/input/mouse2 corresponds with the mouse connected to the PS/2 port of my computer. Create a section like this for each mouse you have.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse2"<br />
EndSection<br />
# or use evdev, that could assign by id<br />
Section "InputDevice"<br />
Identifier "Mouse0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
}}<br />
<br />
===Graphics card===<br />
<br />
Now we'll set up the graphics card for each screen.<br />
<br />
{{bc|<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "NoLogo" "1" # Remove nvidia branding at startup<br />
BusId "PCI:1:0:0"<br />
Option "ProbeAllGpus" "false" # Only required for nvidia<br />
EndSection<br />
}}<br />
<br />
This section defines my first graphics card, called nvidia0. This uses the closed source nvidia driver. Take a close look at the BusID. This option specifies which hardware card to use. You can find out the BusId's with lspci. However, you'll soon find out this doesn't always match. That's because lspci displays the device address in hexadecimal form. Xorg however uses decimal form. So you'll need to convert your address from hexadecimal form to decimal. Thus a device address of 0:0a:0 in lspci would become 0:10:0 in {{ic|xorg.conf}}.<br />
<br />
Create a section like this for every graphics card you have.<br />
<br />
===Screens===<br />
<br />
This section defines my first screen, called screen0. Pay close attention to the "monitor" option. For easy recognition I called it the model of my monitor.<br />
<br />
{{bc|<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
}}<br />
<br />
Create a section like this for every screen you have.<br />
<br />
===Monitors===<br />
<br />
This section defines my first monitor, l1730s. Pay close attention to the identifier.<br />
<br />
{{bc|<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
}}<br />
<br />
Create section like this for every monitor you have.<br />
<br />
===Serverlayout===<br />
<br />
Here's the fun stuff. This is how everything is added up. This is my first seat, called seat0. Here I tell Xorg for the server layout called "seat0" to use my screen0, which is attached to nvidia0, using keyboard0 and mouse0.<br />
<br />
The AutoAddDevices option is now needed to keep HAL from automatically adding all your input devices to all the X servers.<br />
<br />
{{bc|<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "Clone" "off"<br />
Option "AutoAddDevices" "off"<br />
Option "DisableModInDev" "true"<br />
Option "SingleCard" "on" # use this to simplfied isolatedevice option <br />
EndSection<br />
}}<br />
<br />
Create a section like this for every seat you have with their respective keyboards, mice and screens.<br />
<br />
==Testing==<br />
Before we start modifying our login manager, we'll first start with testing out the individual seats. If these are working, then we're good to go.<br />
<br />
I've used twm (tiny window manager) to test out if my seats work, but there's no reason you can't use KDE, gnome, or any other desktop environment or window manager. I've used this in my {{ic|~/.xinitrc}}:<br />
exec twm<br />
<br />
Use the following command to test out an individual seat:<br />
startx -- -layout seat0 -config xorg.conf.multiseat<br />
<br />
Do this for every seat you have. If they are all working correctly and the keyboard/mouse combination matches, then congratulations! You are almost finished! In case you are wondering why I didn't you use the full path to my new configuration file, that's because X doesn't allow that when running as non-root. It will search for xorg.conf.multiseat relative to {{ic|/etc/X11}}.<br />
<br />
==Setting up the loginmanager==<br />
<br />
===For KDM (KDE's Display Manager)===<br />
<br />
Open {{ic|/usr/share/config/kdm/kdmrc}} and set the following variables:<br />
<br />
{{bc|1=<br />
StaticServers=:0,:1 #In the case of two seats. If you have three this would become :0,:1,:2 and so forth.<br />
ReserveServers=:2,:3 #You can define here as many as you want, but these should always start at the highest seat + 1.<br />
}}<br />
Next you'll need to add an [X-:n-Core] for each seat (where n = the seat)<br />
{{bc|1=<br />
[X-:0-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat0<br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch<br />
}}<br />
<br />
Add section like this for every seat you have, and do not forget to change the :0 and the -layout seat0. Note that the "-sharevts" and "-novtswitch" options should be added for all seats ''except'' the first one. Otherwise, you can end with rectangles of virtual terminals "showing through" on your primary screen.<br />
<br />
===For GDM (Gnome's Display Manager)===<br />
{{note|The following will work with GDM 2.20 but not with newer versions of GDM. GDM 2.20 is in AUR.}}<br />
<br />
Open {{ic|/etc/gdm/custom.conf}} and set the following variables (This sample demos two seats):<br />
{{bc|1=<br />
[servers]<br />
0=Standard0<br />
1=Standard1<br />
<br />
[server-Standard0]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat0<br />
flexible=true<br />
<br />
[server-Standard1]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat1<br />
flexible=true<br />
}}<br />
<br />
===For XDM (X Display Manager)===<br />
<br />
Open {{ic|/etc/X11/xdm/Xservers}} and set the following variables (This sample demos two seats):<br />
<br />
{{bc|<br />
# NOTE: don't add -sharevts on seat0, otherwise it may reset in about 10~20 minutes automatically.<br />
:0 local /usr/bin/X :0 vt07 -nolisten tcp -novtswitch -layout seat0 -config xorg.conf.multiseat<br />
:1 local /usr/bin/X :1 vt08 -nolisten tcp -sharevts -novtswitch -layout seat1 -config xorg.conf.multiseat<br />
}}<br />
<br />
Also if you use the Archlinux theme edit {{ic|/etc/X11/xdm/xdm-config}} for every screen:<br />
<br />
{{bc|<br />
DisplayManager._0.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._0.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._0.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
DisplayManager._1.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._1.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._1.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
}}<br />
<br />
===For LightDM (Light Display Manager)===<br />
<br />
LightDM works well with ALSA only and PulseAudio removed if you wish to have shared audio, an alsamixer equalizer and software mixing.<br />
<br />
In the example below LightDM and MATE with ALSA was installed with PulseAudio removed. PulseAudio could also be used but it requires a more complicated configuration to maintain high audio quality. The relevant hardware used is an ATI Radeon HD 5850 and an Intel Sandy Bridge (onboard) HD 3000. You configuration may vary.<br />
<br />
Open {{ic|/etc/lightdm/lightdm.conf}} and follow the sample. Autologin is optional. This works both as multi-user multiseat and single user multi-seat. In the first case only the last user to login will have audio control and access. Specific hardware could be addressed in {{ic|/etc/asound.conf}} to allocate audio to both users simultaneously if required. Another option enables two different users to both access audio with their own equalizer (described further down). The sound card will be shared equally among the seats using ALSA with PulseAudio removed - libpulse itself should be kept for various software dependencies however:<br />
<br />
{{bc|1=<br />
[LightDM]<br />
greeter-user=lightdm<br />
log-directory=/var/log/lightdm<br />
run-directory=/run/lightdm<br />
<br />
[SeatDefaults]<br />
xserver-command=/usr/bin/X<br />
greeter-session=lightdm-gtk-greeter<br />
greeter-show-manual-login=true<br />
user-session=mate<br />
session-wrapper=/etc/lightdm/Xsession<br />
pam-service=lightdm-autologin<br />
exit-on-failure=true<br />
<br />
[Seat:0]<br />
xserver-command=/usr/bin/X :0 -sharevts<br />
xserver-layout=Layout0<br />
#autologin-user=joeblow<br />
#autologin-user-timeout=-1<br />
#session-setup-script=/etc/lightdm/scripts/sound_start<br />
#session-cleanup-script=/etc/lightdm/scripts/sound_stop<br />
<br />
[Seat:1]<br />
xserver-command=/usr/bin/X :1 -sharevts<br />
xserver-layout=Layout1<br />
#autologin-user=jillschmill<br />
#autologin-user-timeout=-1<br />
}}<br />
<br />
Next, remove respective {{ic|~/.asoundrc}} files (as well as related PulseAudio config files if you removed that) and follow this template with {{ic|/etc/asound.conf}} for sound:<br />
<br />
{{bc|<br />
defaults.pcm.rate_converter "samplerate_best"<br />
<br />
ctl.equal {<br />
type equal;<br />
}<br />
<br />
pcm.plugequal {<br />
type equal;<br />
# Modify the line below if you do not<br />
# want to use sound card 0.<br />
#slave.pcm "plughw:0,0";<br />
#by default we want to play from more sources at time:<br />
slave.pcm "plug:dmix";<br />
}<br />
#pcm.equal {<br />
# If you do not want the equalizer to be your<br />
# default soundcard comment the following<br />
# line and uncomment the above line. (You can<br />
# choose it as the output device by addressing<br />
# it with specific apps,eg mpg123 -a equal 06.Back_In_Black.mp3)<br />
pcm.!default {<br />
type plug;<br />
slave.pcm plugequal;<br />
}<br />
}}<br />
<br />
But if you wish to share audio equally among different users, add each user to the audio group:<br />
<br />
Example:<br />
{{bc|<br />
usermod -a -G ftp joeblow<br />
usermod -a -G ftp jillschmill<br />
}}<br />
<br />
Then put this in each user's respective ~/.asoundrc (rather than using /etc/asound.conf):<br />
{{bc|1=<br />
defaults.pcm.rate_converter "samplerate_best"<br />
<br />
ctl.equal {<br />
type equal;<br />
}<br />
<br />
pcm.ossmix {<br />
type dmix<br />
ipc_key 1024 # must be unique!<br />
ipc_key_add_uid false # let multiple users share<br />
ipc_perm 0666 # IPC permissions for multi-user sharing (octal, default 0600)<br />
slave {<br />
pcm "hw:0,0" # you cannot use a "plug" device here, darn.<br />
period_time 0<br />
period_size 1024 # must be power of 2.<br />
buffer_size 8192 # ditto.<br />
rate 44100<br />
#format "S32_LE"<br />
#periods 128 # dito.<br />
#rate 8000 # with rate 8000 you *will* hear,<br />
# if ossmix is used :)<br />
}<br />
# bindings are cool. This says, that only the first<br />
# two channels are to be used by dmix, which is<br />
# enough for (most) oss apps and also lets <br />
# multichannel chips work much faster:<br />
bindings {<br />
0 0 # from 0 => to 0<br />
1 1 # from 1 => to 1<br />
}<br />
}<br />
<br />
pcm.plugequal {<br />
type equal;<br />
# Modify the line below if you do not<br />
# want to use sound card 0.<br />
#slave.pcm "plughw:0,0";<br />
#by default we want to play from more sources at time:<br />
slave.pcm "plug:ossmix";<br />
}<br />
<br />
#pcm.equal {<br />
# If you do not want the equalizer to be your<br />
# default soundcard comment the following<br />
# line and uncomment the above line. (You can<br />
# choose it as the output device by addressing<br />
# it with specific apps,eg mpg123 -a equal 06.Back_In_Black.mp3)<br />
pcm.!default {<br />
type plug;<br />
slave.pcm plugequal;<br />
}<br />
}}<br />
<br />
Accessing the equalizer can be done with:<br />
<br />
{{bc|<br />
alsaequal -D equal<br />
}}<br />
<br />
In the previous case, each user has an equalizer they can configure separately.<br />
<br />
Make sure to turn down and mute the audio channels that you do not use, turn off auto-mute microphone, and make sure no channel has a gain higher than 0 to avoid ALSA audio bugs. This can be done via alsamixer.<br />
<br />
Finally you must set the {{ic|/etc/X11/xorg.conf}} file. You'll notice some options have been commented out which could be set according to your needs. Here is a sample, adjust to your own system configuration after determing hardware information:<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "DefaultServerLayout" "Layout1"<br />
# Option "AllowMouseOpenFail" "true"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "DontZap" "false"<br />
Option "Xinerama" "0"<br />
Option "AutoAddGPU" "FALSE"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "kbd_0" "CoreKeyboard"<br />
InputDevice "mouse_0" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true" <br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout1"<br />
Screen 0 "Screen1" 0 0<br />
InputDevice "kbd_1" "CoreKeyboard"<br />
InputDevice "mouse_1" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true"<br />
EndSection<br />
<br />
Section "Module"<br />
# Load "dri2"<br />
# Load "glamoregl"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.6:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:04:00.0-usb-0:1:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.5:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.3:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
# Option "DPMS" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "radeon"<br />
# Option "AccelMethod" "glamor"<br />
Option "AccelMethod" "EXA"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:1:0:0"<br />
Screen 0<br />
# Option "EXAVSync"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device1"<br />
Driver "intel"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:0:2:0"<br />
Screen 0<br />
# Option "AccelMethod" "UXA"<br />
# Option "TearFree" "1"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Device0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen1"<br />
Device "Device1"<br />
Monitor "Monitor1"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
Additional Tips:<br />
<br />
* Make sure to delete the {{ic|~/.Xauthority}} file in respective user directories before the initial reboot.<br />
<br />
* To avoid tearing this seems to help on nearly all configurations - add this to /etc/environment:<br />
{{bc|1=<br />
CLUTTER_PAINT=disable-clipped-redraws:disable-culling<br />
CLUTTER_VBLANK=True<br />
}}<br />
<br />
* To help avoid tearing on the web and maintain site compatibility it is advisable to install Pipelight for playing media online.<br />
<br />
===For Auto Login multiseat (without Display Manager)===<br />
<br />
edit a script /boot/twin.sh<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
cmd1="/bin/bash --login -c \"/usr/bin/xinit --"<br />
cmd2="-nolisten tcp -keeptty -novtswitch -config xorg.multiseat.conf"<br />
usr=(user1 user2) # FIXME: assume user1, user2 is valid user id<br />
declare -a pid<br />
while true ; do<br />
for ((i=0; i<${#usr[*]}; i++)) ; do<br />
echo "usr[$i]=${usr[$i]} pid=${pid[$i]}"<br />
if [ -z "${pid[$i]}" ] || [ ! -d "/proc/${pid[$i]}" ] ; then<br />
# echo "pid ${pid[$i]} killed, execute again" <br />
cmd3="-layout seat$i vt0"$((7+i))"\""<br />
if [ $i -gt 0 ] ; then<br />
cmd3="-sharevts $cmd3"<br />
fi<br />
#echo "cmd3=$cmd3"<br />
/bin/su ${usr[$i]} -l -c "$cmd1 :$i $cmd2 $cmd3" &<br />
pid[$i]=$!<br />
#echo "new pid=${pid[$i]}"<br />
fi<br />
done<br />
sleep 5 # check process exist per 5 second<br />
done<br />
</nowiki>}}<br />
<br />
Open {{ic|/etc/inittab}} and setup as follows:<br />
<br />
{{bc|<br />
#id:3:initdefault:<br />
id:5:initdefault:<br />
...<br />
x2:5:once:/root/twin.sh > /root/twin.log 2>&1<br />
}}<br />
<br />
==Troubleshooting==<br />
<br />
===My Windows key doesn't work anymore===<br />
<br />
Put this in [[Execute commands after X start|a startup file]]:<br />
xmodmap -e "add Mod4 = Super_L Super_R"<br />
<br />
===Unreliable behaviour (black picture without cursor)===<br />
<br />
If everything seems to be set up correctly, but for some reason you always get a black picture without a cursor, try setting the first initialized card in the BIOS to be the PCI card one.<br />
<br />
===Little black boxes/dots on the desktop===<br />
<br />
This is actually portions of the virtual terminals being painted on top of X. It seems to be caused by the Linux kernel framebuffer. This can be fixed by disabling the framebuffer, or by removing the "-sharevts" option from the primary seat's X args.<br />
<br />
===Multimedia keys not working===<br />
<br />
If your keyboard(s) has extra "multimedia" keys, you may find that they stopped working in your multiseat setup. This is because such keyboards are often represented as more then one "event" device. As you did above, cat each /dev/input/event* device, this time pressing multimedia keys. Once you've found the right event device, add a separate keyboard InputDevice section for it, then add that InputDevice section to the corresponding ServerLayout section with the "SendCoreEvents" option, which indicates that input from this device should be handled, despite not being the core keyboard. In the end you should have sections something like the following:<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "Keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event6"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "Keyboard0Multimedia"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event7"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "Keyboard0" "CoreKeyboard"<br />
InputDevice "Keyboard0Multimedia" "SendCoreEvents"<br />
InputDevice "Mouse0" "CorePointer"<br />
Option "AutoAddDevices" "no"<br />
EndSection<br />
}}<br />
<br />
===The Ctrl-Alt-Fx, Alt-Fx keys mess up with virtual terminals===<br />
<br />
(Oct 2010) I follows this guide and everything works, except for Atl-F1, Atl-F2,... mess things up. Then I follow this guide https://help.ubuntu.com/community/MultiseatX (read the part for Ubuntu 10.04):<br />
<br />
{{bc|<br />
# cd /usr/bin<br />
# ln -s X X0<br />
# ln -s X X1<br />
}}<br />
<br />
Then fix in the '''/usr/share/config/kdm/kdmrc''' as follow<br />
<br />
{{bc|1=<br />
[General]<br />
ConsoleTTYs=tty1,tty2,tty3,tty4,tty5,tty6<br />
ServerVTs=7,8<br />
StaticServers=:0,:1<br />
ReserveServers=:2,:3<br />
...<br />
<br />
[X-:0-Core]<br />
ServerVT=8<br />
ServerCmd=/usr/bin/X1<br />
ServerArgsLocal=-nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0<br />
<br />
[X-:1-Core]<br />
ServerVT=7<br />
ServerCmd=/usr/bin/X0<br />
ServerArgsLocal=-nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0<br />
...<br />
}}<br />
<br />
It works for my computer: one on-board Intel card (xf86-video-intel driver), and one Nvidia card (xf86-video-nouveau driver). You can check if the parameters are passed correctly by:<br />
<br />
{{bc|<nowiki><br />
$ ps aux | grep 'PCI' | grep -Ev 'grep'<br />
root 16993 1.6 1.3 32900 26772 ? S 08:09 0:19 /usr/bin/X0 :1 vt7 -nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0 -auth /var/run/xauth/A:1-ES6CCb<br />
root 17124 5.9 0.5 18996 11980 ? S 08:09 1:09 /usr/bin/X1 :0 vt8 -nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0 -auth /var/run/xauth/A:0-Wgiyza<br />
<br />
</nowiki>}}<br />
<br />
The '''ServerVT=7''', '''ServerVT=8''' would be pass to as '''vt7''', '''vt8'''<br />
<br />
==Final configuration==<br />
<br />
===/etc/X11/xorg.conf===<br />
<br />
This is my full xorg.conf with multiseat that works:<br />
{{bc|<br />
Section "Module"<br />
Load "dbe"<br />
<br />
SubSection "extmod"<br />
Option "omit xfree86-dga"<br />
EndSubSection<br />
<br />
Load "type1"<br />
Load "speedo"<br />
Load "freetype"<br />
Load "glx"<br />
EndSection<br />
<br />
<br />
Section "Files"<br />
RgbPath "/usr/share/X11/rgb"<br />
<br />
FontPath "/usr/share/fonts/misc"<br />
FontPath "/usr/share/fonts/75dpi"<br />
FontPath "/usr/share/fonts/100dpi"<br />
FontPath "/usr/share/fonts/TTF"<br />
FontPath "/usr/share/fonts/Type1"<br />
FontPath "/usr/share/fonts/msfonts"<br />
FontPath "/usr/share/fonts/misc2"<br />
FontPath "/usr/share/fonts/local"<br />
FontPath "/usr/local/share/fonts"<br />
EndSection<br />
<br />
<br />
Section "ServerFlags"<br />
# Option "DontZap"<br />
Option "AllowMouseOpenFail" "true"<br />
# Option "DefaultServerLayout" "alltogether"<br />
Option "Xinerama" "0"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event5"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2" # Auto detect<br />
Option "Device" "/dev/input/mouse2"<br />
Option "ZAxisMapping" "4 5"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse1"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse1"<br />
EndSection<br />
<br />
<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:1:0:0"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "nvidia1"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:0:10:0"<br />
EndSection<br />
<br />
<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "screen1"<br />
Device "nvidia1"<br />
Monitor "cpdm151"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1024x768" "800x600"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat1"<br />
Screen "screen1" 0 0<br />
InputDevice "mouse1" "CorePointer"<br />
InputDevice "keyboard1" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "Extensions"<br />
Option "Composite" "Disable"<br />
Option "RENDER" "Enable"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "cpdm151"<br />
Option "dpms"<br />
HorizSync 30-61<br />
VertRefresh 60<br />
EndSection<br />
}}<br />
<br />
===/opt/kde/share/config/kdm/kdmrc===<br />
<br />
This is my kdmrc:<br />
<br />
{{bc|1=<br />
[General]<br />
ConfigVersion=2.3<br />
ConsoleTTYs=vc/1,vc/2,vc/3,vc/4,vc/5,vc/6<br />
PidFile=/var/run/kdm.pid<br />
ReserveServers=:2,:3<br />
ServerVTs=-7<br />
StaticServers=:0,:1<br />
<br />
[Shutdown]<br />
BootManager=Grub<br />
HaltCmd=/sbin/halt<br />
RebootCmd=/sbin/reboot<br />
<br />
[X-*-Core]<br />
AllowNullPasswd=false<br />
AllowRootLogin=false<br />
AllowShutdown=Root<br />
Authorize=true<br />
AutoReLogin=false<br />
ClientLogFile=.xsession-errors-%s<br />
Reset=/opt/kde/share/config/kdm/Xreset<br />
Resources=/opt/kde/share/config/kdm/Xresources<br />
Session=/opt/kde/share/config/kdm/Xsession<br />
SessionsDirs=/etc/X11/sessions,/usr/share/xsessions,/opt/kde/share/apps/kdm/sessions<br />
Setup=/opt/kde/share/config/kdm/Xsetup<br />
Startup=/opt/kde/share/config/kdm/Xstartup<br />
<br />
[X-*-Greeter]<br />
AllowConsole=true<br />
AntiAliasing=true<br />
AuthComplain=true<br />
BackgroundCfg=/opt/kde/share/config/kdm/backgroundrc<br />
ColorScheme=<br />
DefaultUser=<br />
EchoMode=OneStar<br />
FaceSource=PreferUser<br />
FailFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
FocusPasswd=false<br />
ForgingSeed=1097313140<br />
GUIStyle=<br />
GreetFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
GreetString=Arch Linux %r (%h)<br />
GreeterPos=50,50<br />
HiddenUsers=root<br />
Language=en_US<br />
LogoArea=None<br />
LogoPixmap=<br />
MaxShowUID=65000<br />
MinShowUID=500<br />
PreselectUser=None<br />
SelectedUsers=<br />
ShowUsers=NotHidden<br />
SortUsers=true<br />
StdFont=Tahoma,11,-1,5,50,0,0,0,0,0<br />
UseBackground=false<br />
UserCompletion=false<br />
UserList=true<br />
<br />
[X-:*-Core]<br />
AllowNullPasswd=true<br />
AllowRootLogin=true<br />
AllowShutdown=All<br />
NoPassEnable=false<br />
NoPassUsers=<br />
<br />
[X-:*-Greeter]<br />
AllowClose=true<br />
DefaultUser=glenn<br />
FocusPasswd=true<br />
LoginMode=DefaultLocal<br />
PreselectUser=Previous<br />
<br />
[X-:0-Core]<br />
AutoLoginAgain=false<br />
AutoLoginDelay=0<br />
AutoLoginEnable=false<br />
AutoLoginLocked=false<br />
AutoLoginUser=glenn<br />
ClientLogFile=.xsession-errors<br />
ServerArgsLocal=-nolisten tcp -layout seat0 -sharevts -novtswitch <br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch <br />
<br />
[Xdmcp]<br />
Enable=false<br />
Willing=/opt/kde/share/config/kdm/Xwilling<br />
Xaccess=/opt/kde/share/config/kdm/Xaccess<br />
}}<br />
<br />
==Related problems==<br />
<br />
===PulseAudio===<br />
If two users want to use the sound card simultaneously, it is necessary to use a sound server, [[PulseAudio]] being most prevalent. Usually, the PulseAudio server runs only for active user and does not allow for multiple user instances. Solution to this problem is using the system-wide PulseAudio server. Although this approach is discouraged by its authors, it is probably most applicable setup.<br />
<br />
;Configuring for system-wide PulseAudio<br />
* Create user pulse and put him into group audio (PulseAudio drops root privileges and changes to user pulse. Group membership allows for device access.)<br />
* Create group pulse-access and put users, who will play sound locally into it (Group membership is used for access control for local access to PA daemon.)<br />
* In /etc/pulse/default.pa state explicitly the access rights<br />
{{bc|1=<br />
load-module module-native-protocol-unix auth-group=pulse-access auth-group-enable=1<br />
}}<br />
<br />
Start PA as system-wide, under root: {{bc|pulseaudio --system}}<br />
<br />
In {{ic|/var/run/pulse}} should appear files for communication with daemon, namely pid and native. <br />
<br />
;User access<br />
You can check communication with system daemon as non-root by e.g. {{ic|pactl -s "unix:/var/run/pulse/native" list}}.<br />
<br />
It is possible to enable automatic connection to local daemon in /etc/pulse/client.conf<br />
{{bc|1=<br />
auto-connect-localhost = yes<br />
}}<br />
<br />
The users should be able to connect to PA server. All the cons for system-wide daemon become essentially pros, e.g. ability to control volume of other users streams in pavucontrol.<br />
<br />
;Troubleshooting<br />
It is possible to enable the http interface to PA for debugging in /etc/pulse/default.pa<br />
{{ic|load-module module-http-protocol-tcp}} and then connect to it at http://localhost:4714/<br />
<br />
==See also==<br />
*[https://bbs.archlinux.org/viewtopic.php?id=105450 The original Arch Forums thread].<br />
<br />
*The arckwiki page [[Multi-pointer X]] explains how to setup two separate pair of devices on the same session.</div>Shillshockedhttps://wiki.archlinux.org/index.php?title=Xorg_multiseat&diff=297613Xorg multiseat2014-02-15T06:29:47Z<p>Shillshocked: /* For LightDM (Light Display Manager) - touch up */</p>
<hr />
<div>{{Expansion|Show how PulseAudio can be configured for multiple users without running PulseAudio system-wide. Explain how Multiseat be done using only one video card (and/or X Server) and without Xephyr.}}<br />
<br />
[[Category:X Server]]<br />
Multiseat is a certain setup where multiple users work simultaneously on one computer. This is achieved by having two monitors, two keyboards and two mice. The advantages are quite obvious:<br />
* Less power consumption (only one computer)<br />
* Less hardware to purchase<br />
* All the cool kids do it<br />
<br />
==Requirements==<br />
<br />
===Keyboards and mice===<br />
<br />
Any standard PS/2 or USB keyboards will suffice. Same thing for mice.<br />
<br />
===Graphics hardware===<br />
<br />
For the best possible result you'll need two graphics cards. I used an nVidia FX5500 AGP and an nVidia 6200 PCI. If you look around a bit you can certainly find new and decent PCI graphics card for a soft price.<br />
<br />
It is possible to use only one videocard which has dual heads (like most nvidia cards will have), but this has some limitations: you have to use Xephyr on the second monitor which seems quite a messy solution from what I've read, and for optimal usage both screens need the same resolution.<br />
<br />
If you have two pci-express slots, take advantage of them! That way you'll even be able to play two games at the same time. (PCI is too slow to play comfortably)<br />
<br />
===Processors and memory===<br />
<br />
If you really are working with two users on the same computer, I'd at least recommend a dual-core processor and plenty of RAM. A fast hard drive (10.000 RPM or higher) is also recommended for comfortable use.<br />
<br />
===Software===<br />
<br />
You'll need Xorg with the drivers for your graphics card (according to some sources, the closed source nvidia driver works better than the open source nv driver for this, I have t tested this myself) and the evdev (xf86-input-evdev) driver. That's all. All this can be found in the Arch Linux core and extra repositories.<br />
<br />
===Some X knowledge===<br />
<br />
If you know how X works this will be a lot easier. Before you start, I recommend generating a clean configuration with xorgconfig that works with a single screen. Read through this xorg configuration and make yourself familiar. And as usual the manpages will provide you with most of the answers. You may reference some man pages: xorg, xserver, startx, xdm, xinit.<br />
'''sudo X -configure''', '''X -showopts''' may give you some hint.<br />
<br />
==Definitions==<br />
<br />
For this article to be clear, I'll be using the following definitions:<br />
* screen: A screen is something Xorg can display its stuff on. A screen has a monitor and a graphics card assigned to it.<br />
* monitor: A physical monitor like the one you're now sitting in front of.<br />
* server layout: a definition of which screen, keyboard and mouse to use.<br />
* seat: A workplace with a physical monitor, physical keyboard and physical mouse.<br />
<br />
==Tips and tricks==<br />
<br />
* Set up ssh on your computer, so you can ssh to the machine from another computer (such as a laptop). This is very useful because you'll probably run into X not responding anymore or not giving you picture at all.<br />
* Finding out which keyboard and mouse is which: open a terminal and use cat to find out. For example, {{ic|cat /dev/input/mouse1}}. If you then move your mouse and you see all weird things happening than that is the mouse you're moving. Same goes for keyboards, which are called eventN.<br />
* Try a basic configuration first. Don't start with the fancy stuff yet, get a very basic Xorg working first.<br />
* Leave your {{ic|xorg.conf}} alone and create a new file, called {{ic|xorg.conf.multiseat}} in {{ic|/etc/X11}} to store your new multiseat configuration. After this configuration is working you can overwrite the {{ic|xorg.conf}} file with your new {{ic|xorg.conf.multiseat}}.<br />
* Create a backup of all relevant configuration files. What do you mean you'll skip this one?<br />
* Take a look at the full configuration I used at the end of this article before you start.<br />
<br />
==About evdev==<br />
<br />
evdev is an Xorg driver which can make use of the kernel event devices, which you can find in {{ic|/dev/input}}.<br />
<br />
==Setting up Xorg==<br />
<br />
The logic behind this is that you have two server layouts, each assigned with their own keyboard, mouse, video card and monitor. <br />
<br />
===The basics===<br />
<br />
First of all we'll set up the basics for xorg.<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "AllowMouseOpenFail" "on"<br />
Option "AllowEmptyInput" "on"<br />
Option "ZapWarning" "on"<br />
Option "HandleSpecialKeys" "off" # Zapping on<br />
Option "DRI2" "on"<br />
Option "Xinerama" "off"<br />
EndSection<br />
}}<br />
<br />
===Defining available input devices===<br />
<br />
This part of the configuration tells Xorg which input devices it has available. Input devices are keyboards and mice, but can also be, for example, touchscreens and pens.<br />
<br />
This section defines my first keyboard, called keyboard0. As you can seen it uses the evdev driver. {{ic|/dev/input/event1}} corresponds with the keyboard connected to the PS/2 port of my computer. Create a section like this for each keyboard you have. Don't forget to modify the identifier of course. Keep the identifier simple and match it with the other names. This keyboard0 will be used for screen0 together with mouse0.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
# Option "Device" "/dev/input/by-path/platform-i8042-serio-0-event-kbd" <br />
# Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-kbd"<br />
Option "xkb_rules" "evdev"<br />
Option "xkb_model" "evdev"<br />
Option "xkb_layout" "us"<br />
Option "GrabDevice" "on" # prevent send event to other X-servers<br />
# If you are using a non en_US keyboard, set the layout here.<br />
# Option "XkbLayout" "be"<br />
EndSection<br />
}}<br />
<br />
<br />
This section defines my first mouse, called mouse0. This uses the regular mouse driver. /dev/input/mouse2 corresponds with the mouse connected to the PS/2 port of my computer. Create a section like this for each mouse you have.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse2"<br />
EndSection<br />
# or use evdev, that could assign by id<br />
Section "InputDevice"<br />
Identifier "Mouse0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
}}<br />
<br />
===Graphics card===<br />
<br />
Now we'll set up the graphics card for each screen.<br />
<br />
{{bc|<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "NoLogo" "1" # Remove nvidia branding at startup<br />
BusId "PCI:1:0:0"<br />
Option "ProbeAllGpus" "false" # Only required for nvidia<br />
EndSection<br />
}}<br />
<br />
This section defines my first graphics card, called nvidia0. This uses the closed source nvidia driver. Take a close look at the BusID. This option specifies which hardware card to use. You can find out the BusId's with lspci. However, you'll soon find out this doesn't always match. That's because lspci displays the device address in hexadecimal form. Xorg however uses decimal form. So you'll need to convert your address from hexadecimal form to decimal. Thus a device address of 0:0a:0 in lspci would become 0:10:0 in {{ic|xorg.conf}}.<br />
<br />
Create a section like this for every graphics card you have.<br />
<br />
===Screens===<br />
<br />
This section defines my first screen, called screen0. Pay close attention to the "monitor" option. For easy recognition I called it the model of my monitor.<br />
<br />
{{bc|<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
}}<br />
<br />
Create a section like this for every screen you have.<br />
<br />
===Monitors===<br />
<br />
This section defines my first monitor, l1730s. Pay close attention to the identifier.<br />
<br />
{{bc|<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
}}<br />
<br />
Create section like this for every monitor you have.<br />
<br />
===Serverlayout===<br />
<br />
Here's the fun stuff. This is how everything is added up. This is my first seat, called seat0. Here I tell Xorg for the server layout called "seat0" to use my screen0, which is attached to nvidia0, using keyboard0 and mouse0.<br />
<br />
The AutoAddDevices option is now needed to keep HAL from automatically adding all your input devices to all the X servers.<br />
<br />
{{bc|<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "Clone" "off"<br />
Option "AutoAddDevices" "off"<br />
Option "DisableModInDev" "true"<br />
Option "SingleCard" "on" # use this to simplfied isolatedevice option <br />
EndSection<br />
}}<br />
<br />
Create a section like this for every seat you have with their respective keyboards, mice and screens.<br />
<br />
==Testing==<br />
Before we start modifying our login manager, we'll first start with testing out the individual seats. If these are working, then we're good to go.<br />
<br />
I've used twm (tiny window manager) to test out if my seats work, but there's no reason you can't use KDE, gnome, or any other desktop environment or window manager. I've used this in my {{ic|~/.xinitrc}}:<br />
exec twm<br />
<br />
Use the following command to test out an individual seat:<br />
startx -- -layout seat0 -config xorg.conf.multiseat<br />
<br />
Do this for every seat you have. If they are all working correctly and the keyboard/mouse combination matches, then congratulations! You are almost finished! In case you are wondering why I didn't you use the full path to my new configuration file, that's because X doesn't allow that when running as non-root. It will search for xorg.conf.multiseat relative to {{ic|/etc/X11}}.<br />
<br />
==Setting up the loginmanager==<br />
<br />
===For KDM (KDE's Display Manager)===<br />
<br />
Open {{ic|/usr/share/config/kdm/kdmrc}} and set the following variables:<br />
<br />
{{bc|1=<br />
StaticServers=:0,:1 #In the case of two seats. If you have three this would become :0,:1,:2 and so forth.<br />
ReserveServers=:2,:3 #You can define here as many as you want, but these should always start at the highest seat + 1.<br />
}}<br />
Next you'll need to add an [X-:n-Core] for each seat (where n = the seat)<br />
{{bc|1=<br />
[X-:0-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat0<br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch<br />
}}<br />
<br />
Add section like this for every seat you have, and do not forget to change the :0 and the -layout seat0. Note that the "-sharevts" and "-novtswitch" options should be added for all seats ''except'' the first one. Otherwise, you can end with rectangles of virtual terminals "showing through" on your primary screen.<br />
<br />
===For GDM (Gnome's Display Manager)===<br />
{{note|The following will work with GDM 2.20 but not with newer versions of GDM. GDM 2.20 is in AUR.}}<br />
<br />
Open {{ic|/etc/gdm/custom.conf}} and set the following variables (This sample demos two seats):<br />
{{bc|1=<br />
[servers]<br />
0=Standard0<br />
1=Standard1<br />
<br />
[server-Standard0]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat0<br />
flexible=true<br />
<br />
[server-Standard1]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat1<br />
flexible=true<br />
}}<br />
<br />
===For XDM (X Display Manager)===<br />
<br />
Open {{ic|/etc/X11/xdm/Xservers}} and set the following variables (This sample demos two seats):<br />
<br />
{{bc|<br />
# NOTE: don't add -sharevts on seat0, otherwise it may reset in about 10~20 minutes automatically.<br />
:0 local /usr/bin/X :0 vt07 -nolisten tcp -novtswitch -layout seat0 -config xorg.conf.multiseat<br />
:1 local /usr/bin/X :1 vt08 -nolisten tcp -sharevts -novtswitch -layout seat1 -config xorg.conf.multiseat<br />
}}<br />
<br />
Also if you use the Archlinux theme edit {{ic|/etc/X11/xdm/xdm-config}} for every screen:<br />
<br />
{{bc|<br />
DisplayManager._0.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._0.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._0.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
DisplayManager._1.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._1.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._1.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
}}<br />
<br />
===For LightDM (Light Display Manager)===<br />
<br />
LightDM works well with ALSA only and PulseAudio removed if you wish to have shared audio, an alsamixer equalizer and software mixing.<br />
<br />
In the example below LightDM and MATE with ALSA was installed with PulseAudio removed. PulseAudio could also be used but it requires a more complicated configuration to maintain high audio quality. The relevant hardware used is an ATI Radeon HD 5850 and an Intel Sandy Bridge (onboard) HD 3000. You configuration may vary.<br />
<br />
Open {{ic|/etc/lightdm/lightdm.conf}} and follow the sample. Autologin is optional. This works both as multi-user multiseat and single user multi-seat. In the first case only the last user to login will have audio control and access. Specific hardware could be addressed in {{ic|/etc/asound.conf}} to allocate audio to both users simultaneously if required. Another option enables two different users to both access audio with their own equalizer (described further down). The sound card will be shared equally among the seats using ALSA with PulseAudio removed - libpulse itself should be kept for various software dependencies however:<br />
<br />
{{bc|1=<br />
[LightDM]<br />
greeter-user=lightdm<br />
log-directory=/var/log/lightdm<br />
run-directory=/run/lightdm<br />
<br />
[SeatDefaults]<br />
xserver-command=/usr/bin/X<br />
greeter-session=lightdm-gtk-greeter<br />
greeter-show-manual-login=true<br />
user-session=mate<br />
session-wrapper=/etc/lightdm/Xsession<br />
pam-service=lightdm-autologin<br />
exit-on-failure=true<br />
<br />
[Seat:0]<br />
xserver-command=/usr/bin/X :0 -sharevts<br />
xserver-layout=Layout0<br />
#autologin-user=joeblow<br />
#autologin-user-timeout=-1<br />
#session-setup-script=/etc/lightdm/scripts/sound_start<br />
#session-cleanup-script=/etc/lightdm/scripts/sound_stop<br />
<br />
[Seat:1]<br />
xserver-command=/usr/bin/X :1 -sharevts<br />
xserver-layout=Layout1<br />
#autologin-user=jillschmill<br />
#autologin-user-timeout=-1<br />
}}<br />
<br />
Next, remove respective {{ic|~/.asoundrc}} files (as well as related PulseAudio config files if you removed that) and follow this template with {{ic|/etc/asound.conf}} for sound:<br />
<br />
{{bc|<br />
defaults.pcm.rate_converter "samplerate_best"<br />
<br />
ctl.equal {<br />
type equal;<br />
}<br />
<br />
pcm.plugequal {<br />
type equal;<br />
# Modify the line below if you do not<br />
# want to use sound card 0.<br />
#slave.pcm "plughw:0,0";<br />
#by default we want to play from more sources at time:<br />
slave.pcm "plug:dmix";<br />
}<br />
#pcm.equal {<br />
# If you do not want the equalizer to be your<br />
# default soundcard comment the following<br />
# line and uncomment the above line. (You can<br />
# choose it as the output device by addressing<br />
# it with specific apps,eg mpg123 -a equal 06.Back_In_Black.mp3)<br />
pcm.!default {<br />
type plug;<br />
slave.pcm plugequal;<br />
}<br />
}}<br />
<br />
But if you wish to share audio equally among different users, add each user to the audio group:<br />
<br />
Example:<br />
{{bc|<br />
usermod -a -G ftp joeblow<br />
usermod -a -G ftp jillschmill<br />
}}<br />
<br />
Then put this in each user's respective ~/.asoundrc (rather than using /etc/asound.conf):<br />
{{bc|1=<br />
defaults.pcm.rate_converter "samplerate_best"<br />
<br />
ctl.equal {<br />
type equal;<br />
}<br />
<br />
pcm.ossmix {<br />
type dmix<br />
ipc_key 1024 # must be unique!<br />
ipc_key_add_uid false # let multiple users share<br />
ipc_perm 0666 # IPC permissions for multi-user sharing (octal, default 0600)<br />
slave {<br />
pcm "hw:0,0" # you cannot use a "plug" device here, darn.<br />
period_time 0<br />
period_size 1024 # must be power of 2<br />
buffer_size 8192 # dito. It<br />
rate 44100<br />
#format "S32_LE"<br />
#periods 128 # dito.<br />
#rate 8000 # with rate 8000 you *will* hear,<br />
# if ossmix is used :)<br />
}<br />
# bindings are cool. This says, that only the first<br />
# two channels are to be used by dmix, which is<br />
# enough for (most) oss apps and also lets <br />
# multichannel chips work much faster:<br />
bindings {<br />
0 0 # from 0 => to 0<br />
1 1 # from 1 => to 1<br />
}<br />
}<br />
<br />
pcm.plugequal {<br />
type equal;<br />
# Modify the line below if you do not<br />
# want to use sound card 0.<br />
#slave.pcm "plughw:0,0";<br />
#by default we want to play from more sources at time:<br />
slave.pcm "plug:ossmix";<br />
}<br />
<br />
#pcm.equal {<br />
# If you do not want the equalizer to be your<br />
# default soundcard comment the following<br />
# line and uncomment the above line. (You can<br />
# choose it as the output device by addressing<br />
# it with specific apps,eg mpg123 -a equal 06.Back_In_Black.mp3)<br />
pcm.!default {<br />
type plug;<br />
slave.pcm plugequal;<br />
}<br />
}}<br />
<br />
Accessing the equalizer can be done with:<br />
<br />
{{bc|<br />
alsaequal -D equal<br />
}}<br />
<br />
In the previous case, each user has an equalizer they can configure separately.<br />
<br />
Make sure to turn down and mute the audio channels that you do not use, turn off auto-mute microphone, and make sure no channel has a gain higher than 0 to avoid ALSA audio bugs. This can be done via alsamixer.<br />
<br />
Finally you must set the {{ic|/etc/X11/xorg.conf}} file. You'll notice some options have been commented out which could be set according to your needs. Here is a sample, adjust to your own system configuration after determing hardware information:<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "DefaultServerLayout" "Layout1"<br />
# Option "AllowMouseOpenFail" "true"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "DontZap" "false"<br />
Option "Xinerama" "0"<br />
Option "AutoAddGPU" "FALSE"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "kbd_0" "CoreKeyboard"<br />
InputDevice "mouse_0" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true" <br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout1"<br />
Screen 0 "Screen1" 0 0<br />
InputDevice "kbd_1" "CoreKeyboard"<br />
InputDevice "mouse_1" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true"<br />
EndSection<br />
<br />
Section "Module"<br />
# Load "dri2"<br />
# Load "glamoregl"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.6:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:04:00.0-usb-0:1:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.5:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.3:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
# Option "DPMS" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "radeon"<br />
# Option "AccelMethod" "glamor"<br />
Option "AccelMethod" "EXA"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:1:0:0"<br />
Screen 0<br />
# Option "EXAVSync"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device1"<br />
Driver "intel"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:0:2:0"<br />
Screen 0<br />
# Option "AccelMethod" "UXA"<br />
# Option "TearFree" "1"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Device0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen1"<br />
Device "Device1"<br />
Monitor "Monitor1"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
Additional Tips:<br />
<br />
* Make sure to delete the {{ic|~/.Xauthority}} file in respective user directories before the initial reboot.<br />
<br />
* To avoid tearing this seems to help on nearly all configurations - add this to /etc/environment:<br />
{{bc|1=<br />
CLUTTER_PAINT=disable-clipped-redraws:disable-culling<br />
CLUTTER_VBLANK=True<br />
}}<br />
<br />
* To help avoid tearing on the web and maintain site compatibility it is advisable to install Pipelight for playing media online.<br />
<br />
===For Auto Login multiseat (without Display Manager)===<br />
<br />
edit a script /boot/twin.sh<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
cmd1="/bin/bash --login -c \"/usr/bin/xinit --"<br />
cmd2="-nolisten tcp -keeptty -novtswitch -config xorg.multiseat.conf"<br />
usr=(user1 user2) # FIXME: assume user1, user2 is valid user id<br />
declare -a pid<br />
while true ; do<br />
for ((i=0; i<${#usr[*]}; i++)) ; do<br />
echo "usr[$i]=${usr[$i]} pid=${pid[$i]}"<br />
if [ -z "${pid[$i]}" ] || [ ! -d "/proc/${pid[$i]}" ] ; then<br />
# echo "pid ${pid[$i]} killed, execute again" <br />
cmd3="-layout seat$i vt0"$((7+i))"\""<br />
if [ $i -gt 0 ] ; then<br />
cmd3="-sharevts $cmd3"<br />
fi<br />
#echo "cmd3=$cmd3"<br />
/bin/su ${usr[$i]} -l -c "$cmd1 :$i $cmd2 $cmd3" &<br />
pid[$i]=$!<br />
#echo "new pid=${pid[$i]}"<br />
fi<br />
done<br />
sleep 5 # check process exist per 5 second<br />
done<br />
</nowiki>}}<br />
<br />
Open {{ic|/etc/inittab}} and setup as follows:<br />
<br />
{{bc|<br />
#id:3:initdefault:<br />
id:5:initdefault:<br />
...<br />
x2:5:once:/root/twin.sh > /root/twin.log 2>&1<br />
}}<br />
<br />
==Troubleshooting==<br />
<br />
===My Windows key doesn't work anymore===<br />
<br />
Put this in [[Execute commands after X start|a startup file]]:<br />
xmodmap -e "add Mod4 = Super_L Super_R"<br />
<br />
===Unreliable behaviour (black picture without cursor)===<br />
<br />
If everything seems to be set up correctly, but for some reason you always get a black picture without a cursor, try setting the first initialized card in the BIOS to be the PCI card one.<br />
<br />
===Little black boxes/dots on the desktop===<br />
<br />
This is actually portions of the virtual terminals being painted on top of X. It seems to be caused by the Linux kernel framebuffer. This can be fixed by disabling the framebuffer, or by removing the "-sharevts" option from the primary seat's X args.<br />
<br />
===Multimedia keys not working===<br />
<br />
If your keyboard(s) has extra "multimedia" keys, you may find that they stopped working in your multiseat setup. This is because such keyboards are often represented as more then one "event" device. As you did above, cat each /dev/input/event* device, this time pressing multimedia keys. Once you've found the right event device, add a separate keyboard InputDevice section for it, then add that InputDevice section to the corresponding ServerLayout section with the "SendCoreEvents" option, which indicates that input from this device should be handled, despite not being the core keyboard. In the end you should have sections something like the following:<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "Keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event6"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "Keyboard0Multimedia"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event7"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "Keyboard0" "CoreKeyboard"<br />
InputDevice "Keyboard0Multimedia" "SendCoreEvents"<br />
InputDevice "Mouse0" "CorePointer"<br />
Option "AutoAddDevices" "no"<br />
EndSection<br />
}}<br />
<br />
===The Ctrl-Alt-Fx, Alt-Fx keys mess up with virtual terminals===<br />
<br />
(Oct 2010) I follows this guide and everything works, except for Atl-F1, Atl-F2,... mess things up. Then I follow this guide https://help.ubuntu.com/community/MultiseatX (read the part for Ubuntu 10.04):<br />
<br />
{{bc|<br />
# cd /usr/bin<br />
# ln -s X X0<br />
# ln -s X X1<br />
}}<br />
<br />
Then fix in the '''/usr/share/config/kdm/kdmrc''' as follow<br />
<br />
{{bc|1=<br />
[General]<br />
ConsoleTTYs=tty1,tty2,tty3,tty4,tty5,tty6<br />
ServerVTs=7,8<br />
StaticServers=:0,:1<br />
ReserveServers=:2,:3<br />
...<br />
<br />
[X-:0-Core]<br />
ServerVT=8<br />
ServerCmd=/usr/bin/X1<br />
ServerArgsLocal=-nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0<br />
<br />
[X-:1-Core]<br />
ServerVT=7<br />
ServerCmd=/usr/bin/X0<br />
ServerArgsLocal=-nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0<br />
...<br />
}}<br />
<br />
It works for my computer: one on-board Intel card (xf86-video-intel driver), and one Nvidia card (xf86-video-nouveau driver). You can check if the parameters are passed correctly by:<br />
<br />
{{bc|<nowiki><br />
$ ps aux | grep 'PCI' | grep -Ev 'grep'<br />
root 16993 1.6 1.3 32900 26772 ? S 08:09 0:19 /usr/bin/X0 :1 vt7 -nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0 -auth /var/run/xauth/A:1-ES6CCb<br />
root 17124 5.9 0.5 18996 11980 ? S 08:09 1:09 /usr/bin/X1 :0 vt8 -nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0 -auth /var/run/xauth/A:0-Wgiyza<br />
<br />
</nowiki>}}<br />
<br />
The '''ServerVT=7''', '''ServerVT=8''' would be pass to as '''vt7''', '''vt8'''<br />
<br />
==Final configuration==<br />
<br />
===/etc/X11/xorg.conf===<br />
<br />
This is my full xorg.conf with multiseat that works:<br />
{{bc|<br />
Section "Module"<br />
Load "dbe"<br />
<br />
SubSection "extmod"<br />
Option "omit xfree86-dga"<br />
EndSubSection<br />
<br />
Load "type1"<br />
Load "speedo"<br />
Load "freetype"<br />
Load "glx"<br />
EndSection<br />
<br />
<br />
Section "Files"<br />
RgbPath "/usr/share/X11/rgb"<br />
<br />
FontPath "/usr/share/fonts/misc"<br />
FontPath "/usr/share/fonts/75dpi"<br />
FontPath "/usr/share/fonts/100dpi"<br />
FontPath "/usr/share/fonts/TTF"<br />
FontPath "/usr/share/fonts/Type1"<br />
FontPath "/usr/share/fonts/msfonts"<br />
FontPath "/usr/share/fonts/misc2"<br />
FontPath "/usr/share/fonts/local"<br />
FontPath "/usr/local/share/fonts"<br />
EndSection<br />
<br />
<br />
Section "ServerFlags"<br />
# Option "DontZap"<br />
Option "AllowMouseOpenFail" "true"<br />
# Option "DefaultServerLayout" "alltogether"<br />
Option "Xinerama" "0"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event5"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2" # Auto detect<br />
Option "Device" "/dev/input/mouse2"<br />
Option "ZAxisMapping" "4 5"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse1"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse1"<br />
EndSection<br />
<br />
<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:1:0:0"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "nvidia1"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:0:10:0"<br />
EndSection<br />
<br />
<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "screen1"<br />
Device "nvidia1"<br />
Monitor "cpdm151"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1024x768" "800x600"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat1"<br />
Screen "screen1" 0 0<br />
InputDevice "mouse1" "CorePointer"<br />
InputDevice "keyboard1" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "Extensions"<br />
Option "Composite" "Disable"<br />
Option "RENDER" "Enable"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "cpdm151"<br />
Option "dpms"<br />
HorizSync 30-61<br />
VertRefresh 60<br />
EndSection<br />
}}<br />
<br />
===/opt/kde/share/config/kdm/kdmrc===<br />
<br />
This is my kdmrc:<br />
<br />
{{bc|1=<br />
[General]<br />
ConfigVersion=2.3<br />
ConsoleTTYs=vc/1,vc/2,vc/3,vc/4,vc/5,vc/6<br />
PidFile=/var/run/kdm.pid<br />
ReserveServers=:2,:3<br />
ServerVTs=-7<br />
StaticServers=:0,:1<br />
<br />
[Shutdown]<br />
BootManager=Grub<br />
HaltCmd=/sbin/halt<br />
RebootCmd=/sbin/reboot<br />
<br />
[X-*-Core]<br />
AllowNullPasswd=false<br />
AllowRootLogin=false<br />
AllowShutdown=Root<br />
Authorize=true<br />
AutoReLogin=false<br />
ClientLogFile=.xsession-errors-%s<br />
Reset=/opt/kde/share/config/kdm/Xreset<br />
Resources=/opt/kde/share/config/kdm/Xresources<br />
Session=/opt/kde/share/config/kdm/Xsession<br />
SessionsDirs=/etc/X11/sessions,/usr/share/xsessions,/opt/kde/share/apps/kdm/sessions<br />
Setup=/opt/kde/share/config/kdm/Xsetup<br />
Startup=/opt/kde/share/config/kdm/Xstartup<br />
<br />
[X-*-Greeter]<br />
AllowConsole=true<br />
AntiAliasing=true<br />
AuthComplain=true<br />
BackgroundCfg=/opt/kde/share/config/kdm/backgroundrc<br />
ColorScheme=<br />
DefaultUser=<br />
EchoMode=OneStar<br />
FaceSource=PreferUser<br />
FailFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
FocusPasswd=false<br />
ForgingSeed=1097313140<br />
GUIStyle=<br />
GreetFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
GreetString=Arch Linux %r (%h)<br />
GreeterPos=50,50<br />
HiddenUsers=root<br />
Language=en_US<br />
LogoArea=None<br />
LogoPixmap=<br />
MaxShowUID=65000<br />
MinShowUID=500<br />
PreselectUser=None<br />
SelectedUsers=<br />
ShowUsers=NotHidden<br />
SortUsers=true<br />
StdFont=Tahoma,11,-1,5,50,0,0,0,0,0<br />
UseBackground=false<br />
UserCompletion=false<br />
UserList=true<br />
<br />
[X-:*-Core]<br />
AllowNullPasswd=true<br />
AllowRootLogin=true<br />
AllowShutdown=All<br />
NoPassEnable=false<br />
NoPassUsers=<br />
<br />
[X-:*-Greeter]<br />
AllowClose=true<br />
DefaultUser=glenn<br />
FocusPasswd=true<br />
LoginMode=DefaultLocal<br />
PreselectUser=Previous<br />
<br />
[X-:0-Core]<br />
AutoLoginAgain=false<br />
AutoLoginDelay=0<br />
AutoLoginEnable=false<br />
AutoLoginLocked=false<br />
AutoLoginUser=glenn<br />
ClientLogFile=.xsession-errors<br />
ServerArgsLocal=-nolisten tcp -layout seat0 -sharevts -novtswitch <br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch <br />
<br />
[Xdmcp]<br />
Enable=false<br />
Willing=/opt/kde/share/config/kdm/Xwilling<br />
Xaccess=/opt/kde/share/config/kdm/Xaccess<br />
}}<br />
<br />
==Related problems==<br />
<br />
===PulseAudio===<br />
If two users want to use the sound card simultaneously, it is necessary to use a sound server, [[PulseAudio]] being most prevalent. Usually, the PulseAudio server runs only for active user and does not allow for multiple user instances. Solution to this problem is using the system-wide PulseAudio server. Although this approach is discouraged by its authors, it is probably most applicable setup.<br />
<br />
;Configuring for system-wide PulseAudio<br />
* Create user pulse and put him into group audio (PulseAudio drops root privileges and changes to user pulse. Group membership allows for device access.)<br />
* Create group pulse-access and put users, who will play sound locally into it (Group membership is used for access control for local access to PA daemon.)<br />
* In /etc/pulse/default.pa state explicitly the access rights<br />
{{bc|1=<br />
load-module module-native-protocol-unix auth-group=pulse-access auth-group-enable=1<br />
}}<br />
<br />
Start PA as system-wide, under root: {{bc|pulseaudio --system}}<br />
<br />
In {{ic|/var/run/pulse}} should appear files for communication with daemon, namely pid and native. <br />
<br />
;User access<br />
You can check communication with system daemon as non-root by e.g. {{ic|pactl -s "unix:/var/run/pulse/native" list}}.<br />
<br />
It is possible to enable automatic connection to local daemon in /etc/pulse/client.conf<br />
{{bc|1=<br />
auto-connect-localhost = yes<br />
}}<br />
<br />
The users should be able to connect to PA server. All the cons for system-wide daemon become essentially pros, e.g. ability to control volume of other users streams in pavucontrol.<br />
<br />
;Troubleshooting<br />
It is possible to enable the http interface to PA for debugging in /etc/pulse/default.pa<br />
{{ic|load-module module-http-protocol-tcp}} and then connect to it at http://localhost:4714/<br />
<br />
==See also==<br />
*[https://bbs.archlinux.org/viewtopic.php?id=105450 The original Arch Forums thread].<br />
<br />
*The arckwiki page [[Multi-pointer X]] explains how to setup two separate pair of devices on the same session.</div>Shillshockedhttps://wiki.archlinux.org/index.php?title=Xorg_multiseat&diff=297611Xorg multiseat2014-02-15T06:21:33Z<p>Shillshocked: /* For LightDM (Light Display Manager) - additional tips */</p>
<hr />
<div>{{Expansion|Show how PulseAudio can be configured for multiple users without running PulseAudio system-wide. Explain how Multiseat be done using only one video card (and/or X Server) and without Xephyr.}}<br />
<br />
[[Category:X Server]]<br />
Multiseat is a certain setup where multiple users work simultaneously on one computer. This is achieved by having two monitors, two keyboards and two mice. The advantages are quite obvious:<br />
* Less power consumption (only one computer)<br />
* Less hardware to purchase<br />
* All the cool kids do it<br />
<br />
==Requirements==<br />
<br />
===Keyboards and mice===<br />
<br />
Any standard PS/2 or USB keyboards will suffice. Same thing for mice.<br />
<br />
===Graphics hardware===<br />
<br />
For the best possible result you'll need two graphics cards. I used an nVidia FX5500 AGP and an nVidia 6200 PCI. If you look around a bit you can certainly find new and decent PCI graphics card for a soft price.<br />
<br />
It is possible to use only one videocard which has dual heads (like most nvidia cards will have), but this has some limitations: you have to use Xephyr on the second monitor which seems quite a messy solution from what I've read, and for optimal usage both screens need the same resolution.<br />
<br />
If you have two pci-express slots, take advantage of them! That way you'll even be able to play two games at the same time. (PCI is too slow to play comfortably)<br />
<br />
===Processors and memory===<br />
<br />
If you really are working with two users on the same computer, I'd at least recommend a dual-core processor and plenty of RAM. A fast hard drive (10.000 RPM or higher) is also recommended for comfortable use.<br />
<br />
===Software===<br />
<br />
You'll need Xorg with the drivers for your graphics card (according to some sources, the closed source nvidia driver works better than the open source nv driver for this, I have t tested this myself) and the evdev (xf86-input-evdev) driver. That's all. All this can be found in the Arch Linux core and extra repositories.<br />
<br />
===Some X knowledge===<br />
<br />
If you know how X works this will be a lot easier. Before you start, I recommend generating a clean configuration with xorgconfig that works with a single screen. Read through this xorg configuration and make yourself familiar. And as usual the manpages will provide you with most of the answers. You may reference some man pages: xorg, xserver, startx, xdm, xinit.<br />
'''sudo X -configure''', '''X -showopts''' may give you some hint.<br />
<br />
==Definitions==<br />
<br />
For this article to be clear, I'll be using the following definitions:<br />
* screen: A screen is something Xorg can display its stuff on. A screen has a monitor and a graphics card assigned to it.<br />
* monitor: A physical monitor like the one you're now sitting in front of.<br />
* server layout: a definition of which screen, keyboard and mouse to use.<br />
* seat: A workplace with a physical monitor, physical keyboard and physical mouse.<br />
<br />
==Tips and tricks==<br />
<br />
* Set up ssh on your computer, so you can ssh to the machine from another computer (such as a laptop). This is very useful because you'll probably run into X not responding anymore or not giving you picture at all.<br />
* Finding out which keyboard and mouse is which: open a terminal and use cat to find out. For example, {{ic|cat /dev/input/mouse1}}. If you then move your mouse and you see all weird things happening than that is the mouse you're moving. Same goes for keyboards, which are called eventN.<br />
* Try a basic configuration first. Don't start with the fancy stuff yet, get a very basic Xorg working first.<br />
* Leave your {{ic|xorg.conf}} alone and create a new file, called {{ic|xorg.conf.multiseat}} in {{ic|/etc/X11}} to store your new multiseat configuration. After this configuration is working you can overwrite the {{ic|xorg.conf}} file with your new {{ic|xorg.conf.multiseat}}.<br />
* Create a backup of all relevant configuration files. What do you mean you'll skip this one?<br />
* Take a look at the full configuration I used at the end of this article before you start.<br />
<br />
==About evdev==<br />
<br />
evdev is an Xorg driver which can make use of the kernel event devices, which you can find in {{ic|/dev/input}}.<br />
<br />
==Setting up Xorg==<br />
<br />
The logic behind this is that you have two server layouts, each assigned with their own keyboard, mouse, video card and monitor. <br />
<br />
===The basics===<br />
<br />
First of all we'll set up the basics for xorg.<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "AllowMouseOpenFail" "on"<br />
Option "AllowEmptyInput" "on"<br />
Option "ZapWarning" "on"<br />
Option "HandleSpecialKeys" "off" # Zapping on<br />
Option "DRI2" "on"<br />
Option "Xinerama" "off"<br />
EndSection<br />
}}<br />
<br />
===Defining available input devices===<br />
<br />
This part of the configuration tells Xorg which input devices it has available. Input devices are keyboards and mice, but can also be, for example, touchscreens and pens.<br />
<br />
This section defines my first keyboard, called keyboard0. As you can seen it uses the evdev driver. {{ic|/dev/input/event1}} corresponds with the keyboard connected to the PS/2 port of my computer. Create a section like this for each keyboard you have. Don't forget to modify the identifier of course. Keep the identifier simple and match it with the other names. This keyboard0 will be used for screen0 together with mouse0.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
# Option "Device" "/dev/input/by-path/platform-i8042-serio-0-event-kbd" <br />
# Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-kbd"<br />
Option "xkb_rules" "evdev"<br />
Option "xkb_model" "evdev"<br />
Option "xkb_layout" "us"<br />
Option "GrabDevice" "on" # prevent send event to other X-servers<br />
# If you are using a non en_US keyboard, set the layout here.<br />
# Option "XkbLayout" "be"<br />
EndSection<br />
}}<br />
<br />
<br />
This section defines my first mouse, called mouse0. This uses the regular mouse driver. /dev/input/mouse2 corresponds with the mouse connected to the PS/2 port of my computer. Create a section like this for each mouse you have.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse2"<br />
EndSection<br />
# or use evdev, that could assign by id<br />
Section "InputDevice"<br />
Identifier "Mouse0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
}}<br />
<br />
===Graphics card===<br />
<br />
Now we'll set up the graphics card for each screen.<br />
<br />
{{bc|<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "NoLogo" "1" # Remove nvidia branding at startup<br />
BusId "PCI:1:0:0"<br />
Option "ProbeAllGpus" "false" # Only required for nvidia<br />
EndSection<br />
}}<br />
<br />
This section defines my first graphics card, called nvidia0. This uses the closed source nvidia driver. Take a close look at the BusID. This option specifies which hardware card to use. You can find out the BusId's with lspci. However, you'll soon find out this doesn't always match. That's because lspci displays the device address in hexadecimal form. Xorg however uses decimal form. So you'll need to convert your address from hexadecimal form to decimal. Thus a device address of 0:0a:0 in lspci would become 0:10:0 in {{ic|xorg.conf}}.<br />
<br />
Create a section like this for every graphics card you have.<br />
<br />
===Screens===<br />
<br />
This section defines my first screen, called screen0. Pay close attention to the "monitor" option. For easy recognition I called it the model of my monitor.<br />
<br />
{{bc|<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
}}<br />
<br />
Create a section like this for every screen you have.<br />
<br />
===Monitors===<br />
<br />
This section defines my first monitor, l1730s. Pay close attention to the identifier.<br />
<br />
{{bc|<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
}}<br />
<br />
Create section like this for every monitor you have.<br />
<br />
===Serverlayout===<br />
<br />
Here's the fun stuff. This is how everything is added up. This is my first seat, called seat0. Here I tell Xorg for the server layout called "seat0" to use my screen0, which is attached to nvidia0, using keyboard0 and mouse0.<br />
<br />
The AutoAddDevices option is now needed to keep HAL from automatically adding all your input devices to all the X servers.<br />
<br />
{{bc|<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "Clone" "off"<br />
Option "AutoAddDevices" "off"<br />
Option "DisableModInDev" "true"<br />
Option "SingleCard" "on" # use this to simplfied isolatedevice option <br />
EndSection<br />
}}<br />
<br />
Create a section like this for every seat you have with their respective keyboards, mice and screens.<br />
<br />
==Testing==<br />
Before we start modifying our login manager, we'll first start with testing out the individual seats. If these are working, then we're good to go.<br />
<br />
I've used twm (tiny window manager) to test out if my seats work, but there's no reason you can't use KDE, gnome, or any other desktop environment or window manager. I've used this in my {{ic|~/.xinitrc}}:<br />
exec twm<br />
<br />
Use the following command to test out an individual seat:<br />
startx -- -layout seat0 -config xorg.conf.multiseat<br />
<br />
Do this for every seat you have. If they are all working correctly and the keyboard/mouse combination matches, then congratulations! You are almost finished! In case you are wondering why I didn't you use the full path to my new configuration file, that's because X doesn't allow that when running as non-root. It will search for xorg.conf.multiseat relative to {{ic|/etc/X11}}.<br />
<br />
==Setting up the loginmanager==<br />
<br />
===For KDM (KDE's Display Manager)===<br />
<br />
Open {{ic|/usr/share/config/kdm/kdmrc}} and set the following variables:<br />
<br />
{{bc|1=<br />
StaticServers=:0,:1 #In the case of two seats. If you have three this would become :0,:1,:2 and so forth.<br />
ReserveServers=:2,:3 #You can define here as many as you want, but these should always start at the highest seat + 1.<br />
}}<br />
Next you'll need to add an [X-:n-Core] for each seat (where n = the seat)<br />
{{bc|1=<br />
[X-:0-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat0<br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch<br />
}}<br />
<br />
Add section like this for every seat you have, and do not forget to change the :0 and the -layout seat0. Note that the "-sharevts" and "-novtswitch" options should be added for all seats ''except'' the first one. Otherwise, you can end with rectangles of virtual terminals "showing through" on your primary screen.<br />
<br />
===For GDM (Gnome's Display Manager)===<br />
{{note|The following will work with GDM 2.20 but not with newer versions of GDM. GDM 2.20 is in AUR.}}<br />
<br />
Open {{ic|/etc/gdm/custom.conf}} and set the following variables (This sample demos two seats):<br />
{{bc|1=<br />
[servers]<br />
0=Standard0<br />
1=Standard1<br />
<br />
[server-Standard0]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat0<br />
flexible=true<br />
<br />
[server-Standard1]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat1<br />
flexible=true<br />
}}<br />
<br />
===For XDM (X Display Manager)===<br />
<br />
Open {{ic|/etc/X11/xdm/Xservers}} and set the following variables (This sample demos two seats):<br />
<br />
{{bc|<br />
# NOTE: don't add -sharevts on seat0, otherwise it may reset in about 10~20 minutes automatically.<br />
:0 local /usr/bin/X :0 vt07 -nolisten tcp -novtswitch -layout seat0 -config xorg.conf.multiseat<br />
:1 local /usr/bin/X :1 vt08 -nolisten tcp -sharevts -novtswitch -layout seat1 -config xorg.conf.multiseat<br />
}}<br />
<br />
Also if you use the Archlinux theme edit {{ic|/etc/X11/xdm/xdm-config}} for every screen:<br />
<br />
{{bc|<br />
DisplayManager._0.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._0.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._0.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
DisplayManager._1.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._1.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._1.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
}}<br />
<br />
===For LightDM (Light Display Manager)===<br />
<br />
LightDM works well with ALSA only and PulseAudio removed if you wish to have shared audio, an alsamixer equalizer and software mixing.<br />
<br />
In the example below LightDM and MATE with ALSA was installed with PulseAudio removed. PulseAudio could also be used but it requires a more complicated configuration to maintain high audio quality. The relevant hardware used is an ATI Radeon HD 5850 and an Intel Sandy Bridge (onboard) HD 3000. You configuration may vary.<br />
<br />
Open {{ic|/etc/lightdm/lightdm.conf}} and follow the sample. Autologin is optional. This works both as multi-user multiseat and single user multi-seat. In the first case only the last user to login will have audio control and access. Specific hardware could be addressed in {{ic|/etc/asound.conf}} to allocate audio to both users simultaneously if required. Another option enables two different users to both access audio with their own equalizer (described further down). The sound card will be shared equally among the seats using ALSA with PulseAudio removed - libpulse itself should be kept for various software dependencies however:<br />
<br />
{{bc|1=<br />
[LightDM]<br />
greeter-user=lightdm<br />
log-directory=/var/log/lightdm<br />
run-directory=/run/lightdm<br />
<br />
[SeatDefaults]<br />
xserver-command=/usr/bin/X<br />
greeter-session=lightdm-gtk-greeter<br />
greeter-show-manual-login=true<br />
user-session=mate<br />
session-wrapper=/etc/lightdm/Xsession<br />
pam-service=lightdm-autologin<br />
exit-on-failure=true<br />
<br />
[Seat:0]<br />
xserver-command=/usr/bin/X :0 -sharevts<br />
xserver-layout=Layout0<br />
#autologin-user=joeblow<br />
#autologin-user-timeout=-1<br />
#session-setup-script=/etc/lightdm/scripts/sound_start<br />
#session-cleanup-script=/etc/lightdm/scripts/sound_stop<br />
<br />
[Seat:1]<br />
xserver-command=/usr/bin/X :1 -sharevts<br />
xserver-layout=Layout1<br />
#autologin-user=jillschmill<br />
#autologin-user-timeout=-1<br />
}}<br />
<br />
Next, remove respective {{ic|~/.asoundrc}} files (as well as related PulseAudio config files if you removed that) and follow this template with {{ic|/etc/asound.conf}} for sound:<br />
<br />
{{bc|<br />
defaults.pcm.rate_converter "samplerate_best"<br />
<br />
ctl.equal {<br />
type equal;<br />
}<br />
<br />
pcm.plugequal {<br />
type equal;<br />
# Modify the line below if you do not<br />
# want to use sound card 0.<br />
#slave.pcm "plughw:0,0";<br />
#by default we want to play from more sources at time:<br />
slave.pcm "plug:dmix";<br />
}<br />
#pcm.equal {<br />
# If you do not want the equalizer to be your<br />
# default soundcard comment the following<br />
# line and uncomment the above line. (You can<br />
# choose it as the output device by addressing<br />
# it with specific apps,eg mpg123 -a equal 06.Back_In_Black.mp3)<br />
pcm.!default {<br />
type plug;<br />
slave.pcm plugequal;<br />
}<br />
}}<br />
<br />
If you wish to share audio equally among different users, add each user to the audio group:<br />
<br />
Example:<br />
{{bc|<br />
usermod -a -G ftp joeblow<br />
usermod -a -G ftp jillschmill<br />
}}<br />
<br />
Then put this in each user's respective ~/.asoundrc:<br />
{{bc|1=<br />
defaults.pcm.rate_converter "samplerate_best"<br />
<br />
ctl.equal {<br />
type equal;<br />
}<br />
<br />
pcm.ossmix {<br />
type dmix<br />
ipc_key 1024 # must be unique!<br />
ipc_key_add_uid false # let multiple users share<br />
ipc_perm 0666 # IPC permissions for multi-user sharing (octal, default 0600)<br />
slave {<br />
pcm "hw:0,0" # you cannot use a "plug" device here, darn.<br />
period_time 0<br />
period_size 1024 # must be power of 2<br />
buffer_size 8192 # dito. It<br />
rate 44100<br />
#format "S32_LE"<br />
#periods 128 # dito.<br />
#rate 8000 # with rate 8000 you *will* hear,<br />
# if ossmix is used :)<br />
}<br />
# bindings are cool. This says, that only the first<br />
# two channels are to be used by dmix, which is<br />
# enough for (most) oss apps and also lets <br />
# multichannel chips work much faster:<br />
bindings {<br />
0 0 # from 0 => to 0<br />
1 1 # from 1 => to 1<br />
}<br />
}<br />
<br />
pcm.plugequal {<br />
type equal;<br />
# Modify the line below if you do not<br />
# want to use sound card 0.<br />
#slave.pcm "plughw:0,0";<br />
#by default we want to play from more sources at time:<br />
slave.pcm "plug:ossmix";<br />
}<br />
<br />
#pcm.equal {<br />
# If you do not want the equalizer to be your<br />
# default soundcard comment the following<br />
# line and uncomment the above line. (You can<br />
# choose it as the output device by addressing<br />
# it with specific apps,eg mpg123 -a equal 06.Back_In_Black.mp3)<br />
pcm.!default {<br />
type plug;<br />
slave.pcm plugequal;<br />
}<br />
}}<br />
<br />
Accessing the equalizer can be done with:<br />
<br />
{{bc|<br />
alsaequal -D equal<br />
}}<br />
<br />
In the previous case, each user has an equalizer they can configure separately.<br />
<br />
Make sure to turn down and mute the audio channels that you do not use, turn off auto-mute microphone, and make sure no channel has a gain higher than 0 to avoid ALSA audio bugs. This can be done via alsamixer.<br />
<br />
Finally you must set the {{ic|/etc/X11/xorg.conf}} file. You'll notice some options have been commented out which could be set according to your needs. Here is a sample, adjust to your own system configuration after determing hardware information:<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "DefaultServerLayout" "Layout1"<br />
# Option "AllowMouseOpenFail" "true"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "DontZap" "false"<br />
Option "Xinerama" "0"<br />
Option "AutoAddGPU" "FALSE"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "kbd_0" "CoreKeyboard"<br />
InputDevice "mouse_0" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true" <br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout1"<br />
Screen 0 "Screen1" 0 0<br />
InputDevice "kbd_1" "CoreKeyboard"<br />
InputDevice "mouse_1" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true"<br />
EndSection<br />
<br />
Section "Module"<br />
# Load "dri2"<br />
# Load "glamoregl"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.6:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:04:00.0-usb-0:1:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.5:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.3:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
# Option "DPMS" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "radeon"<br />
# Option "AccelMethod" "glamor"<br />
Option "AccelMethod" "EXA"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:1:0:0"<br />
Screen 0<br />
# Option "EXAVSync"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device1"<br />
Driver "intel"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:0:2:0"<br />
Screen 0<br />
# Option "AccelMethod" "UXA"<br />
# Option "TearFree" "1"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Device0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen1"<br />
Device "Device1"<br />
Monitor "Monitor1"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
Additional Tips:<br />
<br />
* Make sure to delete the {{ic|~/.Xauthority}} file in respective user directories before the initial reboot.<br />
<br />
* To avoid tearing this seems to help on nearly all configurations - add this to /etc/environment:<br />
{{bc|1=<br />
CLUTTER_PAINT=disable-clipped-redraws:disable-culling<br />
CLUTTER_VBLANK=True<br />
}}<br />
<br />
* To help avoid tearing on the web and maintain site compatibility it is advisable to install Pipelight for playing media online.<br />
<br />
===For Auto Login multiseat (without Display Manager)===<br />
<br />
edit a script /boot/twin.sh<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
cmd1="/bin/bash --login -c \"/usr/bin/xinit --"<br />
cmd2="-nolisten tcp -keeptty -novtswitch -config xorg.multiseat.conf"<br />
usr=(user1 user2) # FIXME: assume user1, user2 is valid user id<br />
declare -a pid<br />
while true ; do<br />
for ((i=0; i<${#usr[*]}; i++)) ; do<br />
echo "usr[$i]=${usr[$i]} pid=${pid[$i]}"<br />
if [ -z "${pid[$i]}" ] || [ ! -d "/proc/${pid[$i]}" ] ; then<br />
# echo "pid ${pid[$i]} killed, execute again" <br />
cmd3="-layout seat$i vt0"$((7+i))"\""<br />
if [ $i -gt 0 ] ; then<br />
cmd3="-sharevts $cmd3"<br />
fi<br />
#echo "cmd3=$cmd3"<br />
/bin/su ${usr[$i]} -l -c "$cmd1 :$i $cmd2 $cmd3" &<br />
pid[$i]=$!<br />
#echo "new pid=${pid[$i]}"<br />
fi<br />
done<br />
sleep 5 # check process exist per 5 second<br />
done<br />
</nowiki>}}<br />
<br />
Open {{ic|/etc/inittab}} and setup as follows:<br />
<br />
{{bc|<br />
#id:3:initdefault:<br />
id:5:initdefault:<br />
...<br />
x2:5:once:/root/twin.sh > /root/twin.log 2>&1<br />
}}<br />
<br />
==Troubleshooting==<br />
<br />
===My Windows key doesn't work anymore===<br />
<br />
Put this in [[Execute commands after X start|a startup file]]:<br />
xmodmap -e "add Mod4 = Super_L Super_R"<br />
<br />
===Unreliable behaviour (black picture without cursor)===<br />
<br />
If everything seems to be set up correctly, but for some reason you always get a black picture without a cursor, try setting the first initialized card in the BIOS to be the PCI card one.<br />
<br />
===Little black boxes/dots on the desktop===<br />
<br />
This is actually portions of the virtual terminals being painted on top of X. It seems to be caused by the Linux kernel framebuffer. This can be fixed by disabling the framebuffer, or by removing the "-sharevts" option from the primary seat's X args.<br />
<br />
===Multimedia keys not working===<br />
<br />
If your keyboard(s) has extra "multimedia" keys, you may find that they stopped working in your multiseat setup. This is because such keyboards are often represented as more then one "event" device. As you did above, cat each /dev/input/event* device, this time pressing multimedia keys. Once you've found the right event device, add a separate keyboard InputDevice section for it, then add that InputDevice section to the corresponding ServerLayout section with the "SendCoreEvents" option, which indicates that input from this device should be handled, despite not being the core keyboard. In the end you should have sections something like the following:<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "Keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event6"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "Keyboard0Multimedia"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event7"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "Keyboard0" "CoreKeyboard"<br />
InputDevice "Keyboard0Multimedia" "SendCoreEvents"<br />
InputDevice "Mouse0" "CorePointer"<br />
Option "AutoAddDevices" "no"<br />
EndSection<br />
}}<br />
<br />
===The Ctrl-Alt-Fx, Alt-Fx keys mess up with virtual terminals===<br />
<br />
(Oct 2010) I follows this guide and everything works, except for Atl-F1, Atl-F2,... mess things up. Then I follow this guide https://help.ubuntu.com/community/MultiseatX (read the part for Ubuntu 10.04):<br />
<br />
{{bc|<br />
# cd /usr/bin<br />
# ln -s X X0<br />
# ln -s X X1<br />
}}<br />
<br />
Then fix in the '''/usr/share/config/kdm/kdmrc''' as follow<br />
<br />
{{bc|1=<br />
[General]<br />
ConsoleTTYs=tty1,tty2,tty3,tty4,tty5,tty6<br />
ServerVTs=7,8<br />
StaticServers=:0,:1<br />
ReserveServers=:2,:3<br />
...<br />
<br />
[X-:0-Core]<br />
ServerVT=8<br />
ServerCmd=/usr/bin/X1<br />
ServerArgsLocal=-nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0<br />
<br />
[X-:1-Core]<br />
ServerVT=7<br />
ServerCmd=/usr/bin/X0<br />
ServerArgsLocal=-nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0<br />
...<br />
}}<br />
<br />
It works for my computer: one on-board Intel card (xf86-video-intel driver), and one Nvidia card (xf86-video-nouveau driver). You can check if the parameters are passed correctly by:<br />
<br />
{{bc|<nowiki><br />
$ ps aux | grep 'PCI' | grep -Ev 'grep'<br />
root 16993 1.6 1.3 32900 26772 ? S 08:09 0:19 /usr/bin/X0 :1 vt7 -nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0 -auth /var/run/xauth/A:1-ES6CCb<br />
root 17124 5.9 0.5 18996 11980 ? S 08:09 1:09 /usr/bin/X1 :0 vt8 -nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0 -auth /var/run/xauth/A:0-Wgiyza<br />
<br />
</nowiki>}}<br />
<br />
The '''ServerVT=7''', '''ServerVT=8''' would be pass to as '''vt7''', '''vt8'''<br />
<br />
==Final configuration==<br />
<br />
===/etc/X11/xorg.conf===<br />
<br />
This is my full xorg.conf with multiseat that works:<br />
{{bc|<br />
Section "Module"<br />
Load "dbe"<br />
<br />
SubSection "extmod"<br />
Option "omit xfree86-dga"<br />
EndSubSection<br />
<br />
Load "type1"<br />
Load "speedo"<br />
Load "freetype"<br />
Load "glx"<br />
EndSection<br />
<br />
<br />
Section "Files"<br />
RgbPath "/usr/share/X11/rgb"<br />
<br />
FontPath "/usr/share/fonts/misc"<br />
FontPath "/usr/share/fonts/75dpi"<br />
FontPath "/usr/share/fonts/100dpi"<br />
FontPath "/usr/share/fonts/TTF"<br />
FontPath "/usr/share/fonts/Type1"<br />
FontPath "/usr/share/fonts/msfonts"<br />
FontPath "/usr/share/fonts/misc2"<br />
FontPath "/usr/share/fonts/local"<br />
FontPath "/usr/local/share/fonts"<br />
EndSection<br />
<br />
<br />
Section "ServerFlags"<br />
# Option "DontZap"<br />
Option "AllowMouseOpenFail" "true"<br />
# Option "DefaultServerLayout" "alltogether"<br />
Option "Xinerama" "0"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event5"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2" # Auto detect<br />
Option "Device" "/dev/input/mouse2"<br />
Option "ZAxisMapping" "4 5"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse1"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse1"<br />
EndSection<br />
<br />
<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:1:0:0"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "nvidia1"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:0:10:0"<br />
EndSection<br />
<br />
<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "screen1"<br />
Device "nvidia1"<br />
Monitor "cpdm151"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1024x768" "800x600"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat1"<br />
Screen "screen1" 0 0<br />
InputDevice "mouse1" "CorePointer"<br />
InputDevice "keyboard1" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "Extensions"<br />
Option "Composite" "Disable"<br />
Option "RENDER" "Enable"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "cpdm151"<br />
Option "dpms"<br />
HorizSync 30-61<br />
VertRefresh 60<br />
EndSection<br />
}}<br />
<br />
===/opt/kde/share/config/kdm/kdmrc===<br />
<br />
This is my kdmrc:<br />
<br />
{{bc|1=<br />
[General]<br />
ConfigVersion=2.3<br />
ConsoleTTYs=vc/1,vc/2,vc/3,vc/4,vc/5,vc/6<br />
PidFile=/var/run/kdm.pid<br />
ReserveServers=:2,:3<br />
ServerVTs=-7<br />
StaticServers=:0,:1<br />
<br />
[Shutdown]<br />
BootManager=Grub<br />
HaltCmd=/sbin/halt<br />
RebootCmd=/sbin/reboot<br />
<br />
[X-*-Core]<br />
AllowNullPasswd=false<br />
AllowRootLogin=false<br />
AllowShutdown=Root<br />
Authorize=true<br />
AutoReLogin=false<br />
ClientLogFile=.xsession-errors-%s<br />
Reset=/opt/kde/share/config/kdm/Xreset<br />
Resources=/opt/kde/share/config/kdm/Xresources<br />
Session=/opt/kde/share/config/kdm/Xsession<br />
SessionsDirs=/etc/X11/sessions,/usr/share/xsessions,/opt/kde/share/apps/kdm/sessions<br />
Setup=/opt/kde/share/config/kdm/Xsetup<br />
Startup=/opt/kde/share/config/kdm/Xstartup<br />
<br />
[X-*-Greeter]<br />
AllowConsole=true<br />
AntiAliasing=true<br />
AuthComplain=true<br />
BackgroundCfg=/opt/kde/share/config/kdm/backgroundrc<br />
ColorScheme=<br />
DefaultUser=<br />
EchoMode=OneStar<br />
FaceSource=PreferUser<br />
FailFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
FocusPasswd=false<br />
ForgingSeed=1097313140<br />
GUIStyle=<br />
GreetFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
GreetString=Arch Linux %r (%h)<br />
GreeterPos=50,50<br />
HiddenUsers=root<br />
Language=en_US<br />
LogoArea=None<br />
LogoPixmap=<br />
MaxShowUID=65000<br />
MinShowUID=500<br />
PreselectUser=None<br />
SelectedUsers=<br />
ShowUsers=NotHidden<br />
SortUsers=true<br />
StdFont=Tahoma,11,-1,5,50,0,0,0,0,0<br />
UseBackground=false<br />
UserCompletion=false<br />
UserList=true<br />
<br />
[X-:*-Core]<br />
AllowNullPasswd=true<br />
AllowRootLogin=true<br />
AllowShutdown=All<br />
NoPassEnable=false<br />
NoPassUsers=<br />
<br />
[X-:*-Greeter]<br />
AllowClose=true<br />
DefaultUser=glenn<br />
FocusPasswd=true<br />
LoginMode=DefaultLocal<br />
PreselectUser=Previous<br />
<br />
[X-:0-Core]<br />
AutoLoginAgain=false<br />
AutoLoginDelay=0<br />
AutoLoginEnable=false<br />
AutoLoginLocked=false<br />
AutoLoginUser=glenn<br />
ClientLogFile=.xsession-errors<br />
ServerArgsLocal=-nolisten tcp -layout seat0 -sharevts -novtswitch <br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch <br />
<br />
[Xdmcp]<br />
Enable=false<br />
Willing=/opt/kde/share/config/kdm/Xwilling<br />
Xaccess=/opt/kde/share/config/kdm/Xaccess<br />
}}<br />
<br />
==Related problems==<br />
<br />
===PulseAudio===<br />
If two users want to use the sound card simultaneously, it is necessary to use a sound server, [[PulseAudio]] being most prevalent. Usually, the PulseAudio server runs only for active user and does not allow for multiple user instances. Solution to this problem is using the system-wide PulseAudio server. Although this approach is discouraged by its authors, it is probably most applicable setup.<br />
<br />
;Configuring for system-wide PulseAudio<br />
* Create user pulse and put him into group audio (PulseAudio drops root privileges and changes to user pulse. Group membership allows for device access.)<br />
* Create group pulse-access and put users, who will play sound locally into it (Group membership is used for access control for local access to PA daemon.)<br />
* In /etc/pulse/default.pa state explicitly the access rights<br />
{{bc|1=<br />
load-module module-native-protocol-unix auth-group=pulse-access auth-group-enable=1<br />
}}<br />
<br />
Start PA as system-wide, under root: {{bc|pulseaudio --system}}<br />
<br />
In {{ic|/var/run/pulse}} should appear files for communication with daemon, namely pid and native. <br />
<br />
;User access<br />
You can check communication with system daemon as non-root by e.g. {{ic|pactl -s "unix:/var/run/pulse/native" list}}.<br />
<br />
It is possible to enable automatic connection to local daemon in /etc/pulse/client.conf<br />
{{bc|1=<br />
auto-connect-localhost = yes<br />
}}<br />
<br />
The users should be able to connect to PA server. All the cons for system-wide daemon become essentially pros, e.g. ability to control volume of other users streams in pavucontrol.<br />
<br />
;Troubleshooting<br />
It is possible to enable the http interface to PA for debugging in /etc/pulse/default.pa<br />
{{ic|load-module module-http-protocol-tcp}} and then connect to it at http://localhost:4714/<br />
<br />
==See also==<br />
*[https://bbs.archlinux.org/viewtopic.php?id=105450 The original Arch Forums thread].<br />
<br />
*The arckwiki page [[Multi-pointer X]] explains how to setup two separate pair of devices on the same session.</div>Shillshockedhttps://wiki.archlinux.org/index.php?title=Xorg_multiseat&diff=297103Xorg multiseat2014-02-13T04:23:51Z<p>Shillshocked: /* For LightDM (Light Display Manager) - alsamixer tips */</p>
<hr />
<div>{{Expansion|Show how PulseAudio can be configured for multiple users without running PulseAudio system-wide. Explain how Multiseat be done using only one video card (and/or X Server) and without Xephyr.}}<br />
<br />
[[Category:X Server]]<br />
Multiseat is a certain setup where multiple users work simultaneously on one computer. This is achieved by having two monitors, two keyboards and two mice. The advantages are quite obvious:<br />
* Less power consumption (only one computer)<br />
* Less hardware to purchase<br />
* All the cool kids do it<br />
<br />
==Requirements==<br />
<br />
===Keyboards and mice===<br />
<br />
Any standard PS/2 or USB keyboards will suffice. Same thing for mice.<br />
<br />
===Graphics hardware===<br />
<br />
For the best possible result you'll need two graphics cards. I used an nVidia FX5500 AGP and an nVidia 6200 PCI. If you look around a bit you can certainly find new and decent PCI graphics card for a soft price.<br />
<br />
It is possible to use only one videocard which has dual heads (like most nvidia cards will have), but this has some limitations: you have to use Xephyr on the second monitor which seems quite a messy solution from what I've read, and for optimal usage both screens need the same resolution.<br />
<br />
If you have two pci-express slots, take advantage of them! That way you'll even be able to play two games at the same time. (PCI is too slow to play comfortably)<br />
<br />
===Processors and memory===<br />
<br />
If you really are working with two users on the same computer, I'd at least recommend a dual-core processor and plenty of RAM. A fast hard drive (10.000 RPM or higher) is also recommended for comfortable use.<br />
<br />
===Software===<br />
<br />
You'll need Xorg with the drivers for your graphics card (according to some sources, the closed source nvidia driver works better than the open source nv driver for this, I have t tested this myself) and the evdev (xf86-input-evdev) driver. That's all. All this can be found in the Arch Linux core and extra repositories.<br />
<br />
===Some X knowledge===<br />
<br />
If you know how X works this will be a lot easier. Before you start, I recommend generating a clean configuration with xorgconfig that works with a single screen. Read through this xorg configuration and make yourself familiar. And as usual the manpages will provide you with most of the answers. You may reference some man pages: xorg, xserver, startx, xdm, xinit.<br />
'''sudo X -configure''', '''X -showopts''' may give you some hint.<br />
<br />
==Definitions==<br />
<br />
For this article to be clear, I'll be using the following definitions:<br />
* screen: A screen is something Xorg can display its stuff on. A screen has a monitor and a graphics card assigned to it.<br />
* monitor: A physical monitor like the one you're now sitting in front of.<br />
* server layout: a definition of which screen, keyboard and mouse to use.<br />
* seat: A workplace with a physical monitor, physical keyboard and physical mouse.<br />
<br />
==Tips and tricks==<br />
<br />
* Set up ssh on your computer, so you can ssh to the machine from another computer (such as a laptop). This is very useful because you'll probably run into X not responding anymore or not giving you picture at all.<br />
* Finding out which keyboard and mouse is which: open a terminal and use cat to find out. For example, {{ic|cat /dev/input/mouse1}}. If you then move your mouse and you see all weird things happening than that is the mouse you're moving. Same goes for keyboards, which are called eventN.<br />
* Try a basic configuration first. Don't start with the fancy stuff yet, get a very basic Xorg working first.<br />
* Leave your {{ic|xorg.conf}} alone and create a new file, called {{ic|xorg.conf.multiseat}} in {{ic|/etc/X11}} to store your new multiseat configuration. After this configuration is working you can overwrite the {{ic|xorg.conf}} file with your new {{ic|xorg.conf.multiseat}}.<br />
* Create a backup of all relevant configuration files. What do you mean you'll skip this one?<br />
* Take a look at the full configuration I used at the end of this article before you start.<br />
<br />
==About evdev==<br />
<br />
evdev is an Xorg driver which can make use of the kernel event devices, which you can find in {{ic|/dev/input}}.<br />
<br />
==Setting up Xorg==<br />
<br />
The logic behind this is that you have two server layouts, each assigned with their own keyboard, mouse, video card and monitor. <br />
<br />
===The basics===<br />
<br />
First of all we'll set up the basics for xorg.<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "AllowMouseOpenFail" "on"<br />
Option "AllowEmptyInput" "on"<br />
Option "ZapWarning" "on"<br />
Option "HandleSpecialKeys" "off" # Zapping on<br />
Option "DRI2" "on"<br />
Option "Xinerama" "off"<br />
EndSection<br />
}}<br />
<br />
===Defining available input devices===<br />
<br />
This part of the configuration tells Xorg which input devices it has available. Input devices are keyboards and mice, but can also be, for example, touchscreens and pens.<br />
<br />
This section defines my first keyboard, called keyboard0. As you can seen it uses the evdev driver. {{ic|/dev/input/event1}} corresponds with the keyboard connected to the PS/2 port of my computer. Create a section like this for each keyboard you have. Don't forget to modify the identifier of course. Keep the identifier simple and match it with the other names. This keyboard0 will be used for screen0 together with mouse0.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
# Option "Device" "/dev/input/by-path/platform-i8042-serio-0-event-kbd" <br />
# Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-kbd"<br />
Option "xkb_rules" "evdev"<br />
Option "xkb_model" "evdev"<br />
Option "xkb_layout" "us"<br />
Option "GrabDevice" "on" # prevent send event to other X-servers<br />
# If you are using a non en_US keyboard, set the layout here.<br />
# Option "XkbLayout" "be"<br />
EndSection<br />
}}<br />
<br />
<br />
This section defines my first mouse, called mouse0. This uses the regular mouse driver. /dev/input/mouse2 corresponds with the mouse connected to the PS/2 port of my computer. Create a section like this for each mouse you have.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse2"<br />
EndSection<br />
# or use evdev, that could assign by id<br />
Section "InputDevice"<br />
Identifier "Mouse0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
}}<br />
<br />
===Graphics card===<br />
<br />
Now we'll set up the graphics card for each screen.<br />
<br />
{{bc|<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "NoLogo" "1" # Remove nvidia branding at startup<br />
BusId "PCI:1:0:0"<br />
Option "ProbeAllGpus" "false" # Only required for nvidia<br />
EndSection<br />
}}<br />
<br />
This section defines my first graphics card, called nvidia0. This uses the closed source nvidia driver. Take a close look at the BusID. This option specifies which hardware card to use. You can find out the BusId's with lspci. However, you'll soon find out this doesn't always match. That's because lspci displays the device address in hexadecimal form. Xorg however uses decimal form. So you'll need to convert your address from hexadecimal form to decimal. Thus a device address of 0:0a:0 in lspci would become 0:10:0 in {{ic|xorg.conf}}.<br />
<br />
Create a section like this for every graphics card you have.<br />
<br />
===Screens===<br />
<br />
This section defines my first screen, called screen0. Pay close attention to the "monitor" option. For easy recognition I called it the model of my monitor.<br />
<br />
{{bc|<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
}}<br />
<br />
Create a section like this for every screen you have.<br />
<br />
===Monitors===<br />
<br />
This section defines my first monitor, l1730s. Pay close attention to the identifier.<br />
<br />
{{bc|<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
}}<br />
<br />
Create section like this for every monitor you have.<br />
<br />
===Serverlayout===<br />
<br />
Here's the fun stuff. This is how everything is added up. This is my first seat, called seat0. Here I tell Xorg for the server layout called "seat0" to use my screen0, which is attached to nvidia0, using keyboard0 and mouse0.<br />
<br />
The AutoAddDevices option is now needed to keep HAL from automatically adding all your input devices to all the X servers.<br />
<br />
{{bc|<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "Clone" "off"<br />
Option "AutoAddDevices" "off"<br />
Option "DisableModInDev" "true"<br />
Option "SingleCard" "on" # use this to simplfied isolatedevice option <br />
EndSection<br />
}}<br />
<br />
Create a section like this for every seat you have with their respective keyboards, mice and screens.<br />
<br />
==Testing==<br />
Before we start modifying our login manager, we'll first start with testing out the individual seats. If these are working, then we're good to go.<br />
<br />
I've used twm (tiny window manager) to test out if my seats work, but there's no reason you can't use KDE, gnome, or any other desktop environment or window manager. I've used this in my {{ic|~/.xinitrc}}:<br />
exec twm<br />
<br />
Use the following command to test out an individual seat:<br />
startx -- -layout seat0 -config xorg.conf.multiseat<br />
<br />
Do this for every seat you have. If they are all working correctly and the keyboard/mouse combination matches, then congratulations! You are almost finished! In case you are wondering why I didn't you use the full path to my new configuration file, that's because X doesn't allow that when running as non-root. It will search for xorg.conf.multiseat relative to {{ic|/etc/X11}}.<br />
<br />
==Setting up the loginmanager==<br />
<br />
===For KDM (KDE's Display Manager)===<br />
<br />
Open {{ic|/usr/share/config/kdm/kdmrc}} and set the following variables:<br />
<br />
{{bc|1=<br />
StaticServers=:0,:1 #In the case of two seats. If you have three this would become :0,:1,:2 and so forth.<br />
ReserveServers=:2,:3 #You can define here as many as you want, but these should always start at the highest seat + 1.<br />
}}<br />
Next you'll need to add an [X-:n-Core] for each seat (where n = the seat)<br />
{{bc|1=<br />
[X-:0-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat0<br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch<br />
}}<br />
<br />
Add section like this for every seat you have, and do not forget to change the :0 and the -layout seat0. Note that the "-sharevts" and "-novtswitch" options should be added for all seats ''except'' the first one. Otherwise, you can end with rectangles of virtual terminals "showing through" on your primary screen.<br />
<br />
===For GDM (Gnome's Display Manager)===<br />
{{note|The following will work with GDM 2.20 but not with newer versions of GDM. GDM 2.20 is in AUR.}}<br />
<br />
Open {{ic|/etc/gdm/custom.conf}} and set the following variables (This sample demos two seats):<br />
{{bc|1=<br />
[servers]<br />
0=Standard0<br />
1=Standard1<br />
<br />
[server-Standard0]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat0<br />
flexible=true<br />
<br />
[server-Standard1]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat1<br />
flexible=true<br />
}}<br />
<br />
===For XDM (X Display Manager)===<br />
<br />
Open {{ic|/etc/X11/xdm/Xservers}} and set the following variables (This sample demos two seats):<br />
<br />
{{bc|<br />
# NOTE: don't add -sharevts on seat0, otherwise it may reset in about 10~20 minutes automatically.<br />
:0 local /usr/bin/X :0 vt07 -nolisten tcp -novtswitch -layout seat0 -config xorg.conf.multiseat<br />
:1 local /usr/bin/X :1 vt08 -nolisten tcp -sharevts -novtswitch -layout seat1 -config xorg.conf.multiseat<br />
}}<br />
<br />
Also if you use the Archlinux theme edit {{ic|/etc/X11/xdm/xdm-config}} for every screen:<br />
<br />
{{bc|<br />
DisplayManager._0.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._0.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._0.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
DisplayManager._1.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._1.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._1.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
}}<br />
<br />
===For LightDM (Light Display Manager)===<br />
<br />
LightDM works well with ALSA only and PulseAudio removed if you wish to have shared audio, an alsamixer equalizer and software mixing.<br />
<br />
In the example below LightDM and MATE with ALSA was installed with PulseAudio removed. PulseAudio could also be used but it requires a more complicated configuration to maintain high audio quality. The relevant hardware used is an ATI Radeon HD 5850 and an Intel Sandy Bridge (onboard) HD 3000. You configuration may vary.<br />
<br />
Open {{ic|/etc/lightdm/lightdm.conf}} and follow the sample. Autologin is optional. This works both as multi-user multiseat and single user multi-seat. In the first case only the last user to login will have audio control and access. Specific hardware could be addressed in {{ic|/etc/asound.conf}} to allocate audio to both users simultaneously if required. Another option enables two different users to both access audio with their own equalizer (described further down). The sound card will be shared equally among the seats using ALSA with PulseAudio removed - libpulse itself should be kept for various software dependencies however:<br />
<br />
{{bc|1=<br />
[LightDM]<br />
greeter-user=lightdm<br />
log-directory=/var/log/lightdm<br />
run-directory=/run/lightdm<br />
<br />
[SeatDefaults]<br />
xserver-command=/usr/bin/X<br />
greeter-session=lightdm-gtk-greeter<br />
greeter-show-manual-login=true<br />
user-session=mate<br />
session-wrapper=/etc/lightdm/Xsession<br />
pam-service=lightdm-autologin<br />
exit-on-failure=true<br />
<br />
[Seat:0]<br />
xserver-command=/usr/bin/X :0 -sharevts<br />
xserver-layout=Layout0<br />
#autologin-user=joeblow<br />
#autologin-user-timeout=-1<br />
#session-setup-script=/etc/lightdm/scripts/sound_start<br />
#session-cleanup-script=/etc/lightdm/scripts/sound_stop<br />
<br />
[Seat:1]<br />
xserver-command=/usr/bin/X :1 -sharevts<br />
xserver-layout=Layout1<br />
#autologin-user=jillschmill<br />
#autologin-user-timeout=-1<br />
}}<br />
<br />
Next, remove respective {{ic|~/.asoundrc}} files (as well as related PulseAudio config files if you removed that) and follow this template with {{ic|/etc/asound.conf}} for sound:<br />
<br />
{{bc|<br />
defaults.pcm.rate_converter "samplerate_best"<br />
<br />
ctl.equal {<br />
type equal;<br />
}<br />
<br />
pcm.plugequal {<br />
type equal;<br />
# Modify the line below if you do not<br />
# want to use sound card 0.<br />
#slave.pcm "plughw:0,0";<br />
#by default we want to play from more sources at time:<br />
slave.pcm "plug:dmix";<br />
}<br />
#pcm.equal {<br />
# If you do not want the equalizer to be your<br />
# default soundcard comment the following<br />
# line and uncomment the above line. (You can<br />
# choose it as the output device by addressing<br />
# it with specific apps,eg mpg123 -a equal 06.Back_In_Black.mp3)<br />
pcm.!default {<br />
type plug;<br />
slave.pcm plugequal;<br />
}<br />
}}<br />
<br />
If you wish to share audio equally among different users, add each user to the audio group:<br />
<br />
Example:<br />
{{bc|<br />
usermod -a -G ftp joeblow<br />
usermod -a -G ftp jillschmill<br />
}}<br />
<br />
Then put this in each user's respective ~/.asoundrc:<br />
{{bc|1=<br />
defaults.pcm.rate_converter "samplerate_best"<br />
<br />
ctl.equal {<br />
type equal;<br />
}<br />
<br />
pcm.ossmix {<br />
type dmix<br />
ipc_key 1024 # must be unique!<br />
ipc_key_add_uid false # let multiple users share<br />
ipc_perm 0666 # IPC permissions for multi-user sharing (octal, default 0600)<br />
slave {<br />
pcm "hw:0,0" # you cannot use a "plug" device here, darn.<br />
period_time 0<br />
period_size 1024 # must be power of 2<br />
buffer_size 8192 # dito. It<br />
#format "S32_LE"<br />
#periods 128 # dito.<br />
#rate 8000 # with rate 8000 you *will* hear,<br />
# if ossmix is used :)<br />
}<br />
# bindings are cool. This says, that only the first<br />
# two channels are to be used by dmix, which is<br />
# enough for (most) oss apps and also lets <br />
# multichannel chips work much faster:<br />
bindings {<br />
0 0 # from 0 => to 0<br />
1 1 # from 1 => to 1<br />
}<br />
}<br />
<br />
pcm.plugequal {<br />
type equal;<br />
# Modify the line below if you do not<br />
# want to use sound card 0.<br />
#slave.pcm "plughw:0,0";<br />
#by default we want to play from more sources at time:<br />
slave.pcm "plug:ossmix";<br />
}<br />
<br />
#pcm.equal {<br />
# If you do not want the equalizer to be your<br />
# default soundcard comment the following<br />
# line and uncomment the above line. (You can<br />
# choose it as the output device by addressing<br />
# it with specific apps,eg mpg123 -a equal 06.Back_In_Black.mp3)<br />
pcm.!default {<br />
type plug;<br />
slave.pcm plugequal;<br />
}<br />
}}<br />
<br />
Accessing the equalizer can be done with:<br />
<br />
{{bc|<br />
alsaequal -D equal<br />
}}<br />
<br />
In the previous case, each user has an equalizer they can configure separately.<br />
<br />
Make sure to turn down and mute the audio channels that you do not use, turn off auto-mute microphone, and make sure no channel has a gain higher than 0 to avoid ALSA audio bugs. This can be done via alsamixer.<br />
<br />
Finally you must set the {{ic|/etc/X11/xorg.conf}} file. You'll notice some options have been commented out which could be set according to your needs. Here is a sample, adjust to your own system configuration after determing hardware information:<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "DefaultServerLayout" "Layout1"<br />
# Option "AllowMouseOpenFail" "true"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "DontZap" "false"<br />
Option "Xinerama" "0"<br />
Option "AutoAddGPU" "FALSE"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "kbd_0" "CoreKeyboard"<br />
InputDevice "mouse_0" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true" <br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout1"<br />
Screen 0 "Screen1" 0 0<br />
InputDevice "kbd_1" "CoreKeyboard"<br />
InputDevice "mouse_1" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true"<br />
EndSection<br />
<br />
Section "Module"<br />
# Load "dri2"<br />
# Load "glamoregl"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.6:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:04:00.0-usb-0:1:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.5:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.3:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
# Option "DPMS" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "radeon"<br />
# Option "AccelMethod" "glamor"<br />
Option "AccelMethod" "EXA"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:1:0:0"<br />
Screen 0<br />
# Option "EXAVSync"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device1"<br />
Driver "intel"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:0:2:0"<br />
Screen 0<br />
# Option "AccelMethod" "UXA"<br />
# Option "TearFree" "1"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Device0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen1"<br />
Device "Device1"<br />
Monitor "Monitor1"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
Make sure to delete the {{ic|~/.Xauthority}} file in respective user directories before the initial reboot.<br />
<br />
===For Auto Login multiseat (without Display Manager)===<br />
<br />
edit a script /boot/twin.sh<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
cmd1="/bin/bash --login -c \"/usr/bin/xinit --"<br />
cmd2="-nolisten tcp -keeptty -novtswitch -config xorg.multiseat.conf"<br />
usr=(user1 user2) # FIXME: assume user1, user2 is valid user id<br />
declare -a pid<br />
while true ; do<br />
for ((i=0; i<${#usr[*]}; i++)) ; do<br />
echo "usr[$i]=${usr[$i]} pid=${pid[$i]}"<br />
if [ -z "${pid[$i]}" ] || [ ! -d "/proc/${pid[$i]}" ] ; then<br />
# echo "pid ${pid[$i]} killed, execute again" <br />
cmd3="-layout seat$i vt0"$((7+i))"\""<br />
if [ $i -gt 0 ] ; then<br />
cmd3="-sharevts $cmd3"<br />
fi<br />
#echo "cmd3=$cmd3"<br />
/bin/su ${usr[$i]} -l -c "$cmd1 :$i $cmd2 $cmd3" &<br />
pid[$i]=$!<br />
#echo "new pid=${pid[$i]}"<br />
fi<br />
done<br />
sleep 5 # check process exist per 5 second<br />
done<br />
</nowiki>}}<br />
<br />
Open {{ic|/etc/inittab}} and setup as follows:<br />
<br />
{{bc|<br />
#id:3:initdefault:<br />
id:5:initdefault:<br />
...<br />
x2:5:once:/root/twin.sh > /root/twin.log 2>&1<br />
}}<br />
<br />
==Troubleshooting==<br />
<br />
===My Windows key doesn't work anymore===<br />
<br />
Put this in [[Execute commands after X start|a startup file]]:<br />
xmodmap -e "add Mod4 = Super_L Super_R"<br />
<br />
===Unreliable behaviour (black picture without cursor)===<br />
<br />
If everything seems to be set up correctly, but for some reason you always get a black picture without a cursor, try setting the first initialized card in the BIOS to be the PCI card one.<br />
<br />
===Little black boxes/dots on the desktop===<br />
<br />
This is actually portions of the virtual terminals being painted on top of X. It seems to be caused by the Linux kernel framebuffer. This can be fixed by disabling the framebuffer, or by removing the "-sharevts" option from the primary seat's X args.<br />
<br />
===Multimedia keys not working===<br />
<br />
If your keyboard(s) has extra "multimedia" keys, you may find that they stopped working in your multiseat setup. This is because such keyboards are often represented as more then one "event" device. As you did above, cat each /dev/input/event* device, this time pressing multimedia keys. Once you've found the right event device, add a separate keyboard InputDevice section for it, then add that InputDevice section to the corresponding ServerLayout section with the "SendCoreEvents" option, which indicates that input from this device should be handled, despite not being the core keyboard. In the end you should have sections something like the following:<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "Keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event6"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "Keyboard0Multimedia"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event7"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "Keyboard0" "CoreKeyboard"<br />
InputDevice "Keyboard0Multimedia" "SendCoreEvents"<br />
InputDevice "Mouse0" "CorePointer"<br />
Option "AutoAddDevices" "no"<br />
EndSection<br />
}}<br />
<br />
===The Ctrl-Alt-Fx, Alt-Fx keys mess up with virtual terminals===<br />
<br />
(Oct 2010) I follows this guide and everything works, except for Atl-F1, Atl-F2,... mess things up. Then I follow this guide https://help.ubuntu.com/community/MultiseatX (read the part for Ubuntu 10.04):<br />
<br />
{{bc|<br />
# cd /usr/bin<br />
# ln -s X X0<br />
# ln -s X X1<br />
}}<br />
<br />
Then fix in the '''/usr/share/config/kdm/kdmrc''' as follow<br />
<br />
{{bc|1=<br />
[General]<br />
ConsoleTTYs=tty1,tty2,tty3,tty4,tty5,tty6<br />
ServerVTs=7,8<br />
StaticServers=:0,:1<br />
ReserveServers=:2,:3<br />
...<br />
<br />
[X-:0-Core]<br />
ServerVT=8<br />
ServerCmd=/usr/bin/X1<br />
ServerArgsLocal=-nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0<br />
<br />
[X-:1-Core]<br />
ServerVT=7<br />
ServerCmd=/usr/bin/X0<br />
ServerArgsLocal=-nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0<br />
...<br />
}}<br />
<br />
It works for my computer: one on-board Intel card (xf86-video-intel driver), and one Nvidia card (xf86-video-nouveau driver). You can check if the parameters are passed correctly by:<br />
<br />
{{bc|<nowiki><br />
$ ps aux | grep 'PCI' | grep -Ev 'grep'<br />
root 16993 1.6 1.3 32900 26772 ? S 08:09 0:19 /usr/bin/X0 :1 vt7 -nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0 -auth /var/run/xauth/A:1-ES6CCb<br />
root 17124 5.9 0.5 18996 11980 ? S 08:09 1:09 /usr/bin/X1 :0 vt8 -nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0 -auth /var/run/xauth/A:0-Wgiyza<br />
<br />
</nowiki>}}<br />
<br />
The '''ServerVT=7''', '''ServerVT=8''' would be pass to as '''vt7''', '''vt8'''<br />
<br />
==Final configuration==<br />
<br />
===/etc/X11/xorg.conf===<br />
<br />
This is my full xorg.conf with multiseat that works:<br />
{{bc|<br />
Section "Module"<br />
Load "dbe"<br />
<br />
SubSection "extmod"<br />
Option "omit xfree86-dga"<br />
EndSubSection<br />
<br />
Load "type1"<br />
Load "speedo"<br />
Load "freetype"<br />
Load "glx"<br />
EndSection<br />
<br />
<br />
Section "Files"<br />
RgbPath "/usr/share/X11/rgb"<br />
<br />
FontPath "/usr/share/fonts/misc"<br />
FontPath "/usr/share/fonts/75dpi"<br />
FontPath "/usr/share/fonts/100dpi"<br />
FontPath "/usr/share/fonts/TTF"<br />
FontPath "/usr/share/fonts/Type1"<br />
FontPath "/usr/share/fonts/msfonts"<br />
FontPath "/usr/share/fonts/misc2"<br />
FontPath "/usr/share/fonts/local"<br />
FontPath "/usr/local/share/fonts"<br />
EndSection<br />
<br />
<br />
Section "ServerFlags"<br />
# Option "DontZap"<br />
Option "AllowMouseOpenFail" "true"<br />
# Option "DefaultServerLayout" "alltogether"<br />
Option "Xinerama" "0"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event5"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2" # Auto detect<br />
Option "Device" "/dev/input/mouse2"<br />
Option "ZAxisMapping" "4 5"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse1"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse1"<br />
EndSection<br />
<br />
<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:1:0:0"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "nvidia1"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:0:10:0"<br />
EndSection<br />
<br />
<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "screen1"<br />
Device "nvidia1"<br />
Monitor "cpdm151"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1024x768" "800x600"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat1"<br />
Screen "screen1" 0 0<br />
InputDevice "mouse1" "CorePointer"<br />
InputDevice "keyboard1" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "Extensions"<br />
Option "Composite" "Disable"<br />
Option "RENDER" "Enable"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "cpdm151"<br />
Option "dpms"<br />
HorizSync 30-61<br />
VertRefresh 60<br />
EndSection<br />
}}<br />
<br />
===/opt/kde/share/config/kdm/kdmrc===<br />
<br />
This is my kdmrc:<br />
<br />
{{bc|1=<br />
[General]<br />
ConfigVersion=2.3<br />
ConsoleTTYs=vc/1,vc/2,vc/3,vc/4,vc/5,vc/6<br />
PidFile=/var/run/kdm.pid<br />
ReserveServers=:2,:3<br />
ServerVTs=-7<br />
StaticServers=:0,:1<br />
<br />
[Shutdown]<br />
BootManager=Grub<br />
HaltCmd=/sbin/halt<br />
RebootCmd=/sbin/reboot<br />
<br />
[X-*-Core]<br />
AllowNullPasswd=false<br />
AllowRootLogin=false<br />
AllowShutdown=Root<br />
Authorize=true<br />
AutoReLogin=false<br />
ClientLogFile=.xsession-errors-%s<br />
Reset=/opt/kde/share/config/kdm/Xreset<br />
Resources=/opt/kde/share/config/kdm/Xresources<br />
Session=/opt/kde/share/config/kdm/Xsession<br />
SessionsDirs=/etc/X11/sessions,/usr/share/xsessions,/opt/kde/share/apps/kdm/sessions<br />
Setup=/opt/kde/share/config/kdm/Xsetup<br />
Startup=/opt/kde/share/config/kdm/Xstartup<br />
<br />
[X-*-Greeter]<br />
AllowConsole=true<br />
AntiAliasing=true<br />
AuthComplain=true<br />
BackgroundCfg=/opt/kde/share/config/kdm/backgroundrc<br />
ColorScheme=<br />
DefaultUser=<br />
EchoMode=OneStar<br />
FaceSource=PreferUser<br />
FailFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
FocusPasswd=false<br />
ForgingSeed=1097313140<br />
GUIStyle=<br />
GreetFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
GreetString=Arch Linux %r (%h)<br />
GreeterPos=50,50<br />
HiddenUsers=root<br />
Language=en_US<br />
LogoArea=None<br />
LogoPixmap=<br />
MaxShowUID=65000<br />
MinShowUID=500<br />
PreselectUser=None<br />
SelectedUsers=<br />
ShowUsers=NotHidden<br />
SortUsers=true<br />
StdFont=Tahoma,11,-1,5,50,0,0,0,0,0<br />
UseBackground=false<br />
UserCompletion=false<br />
UserList=true<br />
<br />
[X-:*-Core]<br />
AllowNullPasswd=true<br />
AllowRootLogin=true<br />
AllowShutdown=All<br />
NoPassEnable=false<br />
NoPassUsers=<br />
<br />
[X-:*-Greeter]<br />
AllowClose=true<br />
DefaultUser=glenn<br />
FocusPasswd=true<br />
LoginMode=DefaultLocal<br />
PreselectUser=Previous<br />
<br />
[X-:0-Core]<br />
AutoLoginAgain=false<br />
AutoLoginDelay=0<br />
AutoLoginEnable=false<br />
AutoLoginLocked=false<br />
AutoLoginUser=glenn<br />
ClientLogFile=.xsession-errors<br />
ServerArgsLocal=-nolisten tcp -layout seat0 -sharevts -novtswitch <br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch <br />
<br />
[Xdmcp]<br />
Enable=false<br />
Willing=/opt/kde/share/config/kdm/Xwilling<br />
Xaccess=/opt/kde/share/config/kdm/Xaccess<br />
}}<br />
<br />
==Related problems==<br />
<br />
===PulseAudio===<br />
If two users want to use the sound card simultaneously, it is necessary to use a sound server, [[PulseAudio]] being most prevalent. Usually, the PulseAudio server runs only for active user and does not allow for multiple user instances. Solution to this problem is using the system-wide PulseAudio server. Although this approach is discouraged by its authors, it is probably most applicable setup.<br />
<br />
;Configuring for system-wide PulseAudio<br />
* Create user pulse and put him into group audio (PulseAudio drops root privileges and changes to user pulse. Group membership allows for device access.)<br />
* Create group pulse-access and put users, who will play sound locally into it (Group membership is used for access control for local access to PA daemon.)<br />
* In /etc/pulse/default.pa state explicitly the access rights<br />
{{bc|1=<br />
load-module module-native-protocol-unix auth-group=pulse-access auth-group-enable=1<br />
}}<br />
<br />
Start PA as system-wide, under root: {{bc|pulseaudio --system}}<br />
<br />
In {{ic|/var/run/pulse}} should appear files for communication with daemon, namely pid and native. <br />
<br />
;User access<br />
You can check communication with system daemon as non-root by e.g. {{ic|pactl -s "unix:/var/run/pulse/native" list}}.<br />
<br />
It is possible to enable automatic connection to local daemon in /etc/pulse/client.conf<br />
{{bc|1=<br />
auto-connect-localhost = yes<br />
}}<br />
<br />
The users should be able to connect to PA server. All the cons for system-wide daemon become essentially pros, e.g. ability to control volume of other users streams in pavucontrol.<br />
<br />
;Troubleshooting<br />
It is possible to enable the http interface to PA for debugging in /etc/pulse/default.pa<br />
{{ic|load-module module-http-protocol-tcp}} and then connect to it at http://localhost:4714/<br />
<br />
==See also==<br />
*[https://bbs.archlinux.org/viewtopic.php?id=105450 The original Arch Forums thread].<br />
<br />
*The arckwiki page [[Multi-pointer X]] explains how to setup two separate pair of devices on the same session.</div>Shillshockedhttps://wiki.archlinux.org/index.php?title=Xorg_multiseat&diff=297102Xorg multiseat2014-02-13T04:12:57Z<p>Shillshocked: /* For LightDM (Light Display Manager) - Added sharing audio how-to */</p>
<hr />
<div>{{Expansion|Show how PulseAudio can be configured for multiple users without running PulseAudio system-wide. Explain how Multiseat be done using only one video card (and/or X Server) and without Xephyr.}}<br />
<br />
[[Category:X Server]]<br />
Multiseat is a certain setup where multiple users work simultaneously on one computer. This is achieved by having two monitors, two keyboards and two mice. The advantages are quite obvious:<br />
* Less power consumption (only one computer)<br />
* Less hardware to purchase<br />
* All the cool kids do it<br />
<br />
==Requirements==<br />
<br />
===Keyboards and mice===<br />
<br />
Any standard PS/2 or USB keyboards will suffice. Same thing for mice.<br />
<br />
===Graphics hardware===<br />
<br />
For the best possible result you'll need two graphics cards. I used an nVidia FX5500 AGP and an nVidia 6200 PCI. If you look around a bit you can certainly find new and decent PCI graphics card for a soft price.<br />
<br />
It is possible to use only one videocard which has dual heads (like most nvidia cards will have), but this has some limitations: you have to use Xephyr on the second monitor which seems quite a messy solution from what I've read, and for optimal usage both screens need the same resolution.<br />
<br />
If you have two pci-express slots, take advantage of them! That way you'll even be able to play two games at the same time. (PCI is too slow to play comfortably)<br />
<br />
===Processors and memory===<br />
<br />
If you really are working with two users on the same computer, I'd at least recommend a dual-core processor and plenty of RAM. A fast hard drive (10.000 RPM or higher) is also recommended for comfortable use.<br />
<br />
===Software===<br />
<br />
You'll need Xorg with the drivers for your graphics card (according to some sources, the closed source nvidia driver works better than the open source nv driver for this, I have t tested this myself) and the evdev (xf86-input-evdev) driver. That's all. All this can be found in the Arch Linux core and extra repositories.<br />
<br />
===Some X knowledge===<br />
<br />
If you know how X works this will be a lot easier. Before you start, I recommend generating a clean configuration with xorgconfig that works with a single screen. Read through this xorg configuration and make yourself familiar. And as usual the manpages will provide you with most of the answers. You may reference some man pages: xorg, xserver, startx, xdm, xinit.<br />
'''sudo X -configure''', '''X -showopts''' may give you some hint.<br />
<br />
==Definitions==<br />
<br />
For this article to be clear, I'll be using the following definitions:<br />
* screen: A screen is something Xorg can display its stuff on. A screen has a monitor and a graphics card assigned to it.<br />
* monitor: A physical monitor like the one you're now sitting in front of.<br />
* server layout: a definition of which screen, keyboard and mouse to use.<br />
* seat: A workplace with a physical monitor, physical keyboard and physical mouse.<br />
<br />
==Tips and tricks==<br />
<br />
* Set up ssh on your computer, so you can ssh to the machine from another computer (such as a laptop). This is very useful because you'll probably run into X not responding anymore or not giving you picture at all.<br />
* Finding out which keyboard and mouse is which: open a terminal and use cat to find out. For example, {{ic|cat /dev/input/mouse1}}. If you then move your mouse and you see all weird things happening than that is the mouse you're moving. Same goes for keyboards, which are called eventN.<br />
* Try a basic configuration first. Don't start with the fancy stuff yet, get a very basic Xorg working first.<br />
* Leave your {{ic|xorg.conf}} alone and create a new file, called {{ic|xorg.conf.multiseat}} in {{ic|/etc/X11}} to store your new multiseat configuration. After this configuration is working you can overwrite the {{ic|xorg.conf}} file with your new {{ic|xorg.conf.multiseat}}.<br />
* Create a backup of all relevant configuration files. What do you mean you'll skip this one?<br />
* Take a look at the full configuration I used at the end of this article before you start.<br />
<br />
==About evdev==<br />
<br />
evdev is an Xorg driver which can make use of the kernel event devices, which you can find in {{ic|/dev/input}}.<br />
<br />
==Setting up Xorg==<br />
<br />
The logic behind this is that you have two server layouts, each assigned with their own keyboard, mouse, video card and monitor. <br />
<br />
===The basics===<br />
<br />
First of all we'll set up the basics for xorg.<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "AllowMouseOpenFail" "on"<br />
Option "AllowEmptyInput" "on"<br />
Option "ZapWarning" "on"<br />
Option "HandleSpecialKeys" "off" # Zapping on<br />
Option "DRI2" "on"<br />
Option "Xinerama" "off"<br />
EndSection<br />
}}<br />
<br />
===Defining available input devices===<br />
<br />
This part of the configuration tells Xorg which input devices it has available. Input devices are keyboards and mice, but can also be, for example, touchscreens and pens.<br />
<br />
This section defines my first keyboard, called keyboard0. As you can seen it uses the evdev driver. {{ic|/dev/input/event1}} corresponds with the keyboard connected to the PS/2 port of my computer. Create a section like this for each keyboard you have. Don't forget to modify the identifier of course. Keep the identifier simple and match it with the other names. This keyboard0 will be used for screen0 together with mouse0.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
# Option "Device" "/dev/input/by-path/platform-i8042-serio-0-event-kbd" <br />
# Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-kbd"<br />
Option "xkb_rules" "evdev"<br />
Option "xkb_model" "evdev"<br />
Option "xkb_layout" "us"<br />
Option "GrabDevice" "on" # prevent send event to other X-servers<br />
# If you are using a non en_US keyboard, set the layout here.<br />
# Option "XkbLayout" "be"<br />
EndSection<br />
}}<br />
<br />
<br />
This section defines my first mouse, called mouse0. This uses the regular mouse driver. /dev/input/mouse2 corresponds with the mouse connected to the PS/2 port of my computer. Create a section like this for each mouse you have.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse2"<br />
EndSection<br />
# or use evdev, that could assign by id<br />
Section "InputDevice"<br />
Identifier "Mouse0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
}}<br />
<br />
===Graphics card===<br />
<br />
Now we'll set up the graphics card for each screen.<br />
<br />
{{bc|<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "NoLogo" "1" # Remove nvidia branding at startup<br />
BusId "PCI:1:0:0"<br />
Option "ProbeAllGpus" "false" # Only required for nvidia<br />
EndSection<br />
}}<br />
<br />
This section defines my first graphics card, called nvidia0. This uses the closed source nvidia driver. Take a close look at the BusID. This option specifies which hardware card to use. You can find out the BusId's with lspci. However, you'll soon find out this doesn't always match. That's because lspci displays the device address in hexadecimal form. Xorg however uses decimal form. So you'll need to convert your address from hexadecimal form to decimal. Thus a device address of 0:0a:0 in lspci would become 0:10:0 in {{ic|xorg.conf}}.<br />
<br />
Create a section like this for every graphics card you have.<br />
<br />
===Screens===<br />
<br />
This section defines my first screen, called screen0. Pay close attention to the "monitor" option. For easy recognition I called it the model of my monitor.<br />
<br />
{{bc|<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
}}<br />
<br />
Create a section like this for every screen you have.<br />
<br />
===Monitors===<br />
<br />
This section defines my first monitor, l1730s. Pay close attention to the identifier.<br />
<br />
{{bc|<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
}}<br />
<br />
Create section like this for every monitor you have.<br />
<br />
===Serverlayout===<br />
<br />
Here's the fun stuff. This is how everything is added up. This is my first seat, called seat0. Here I tell Xorg for the server layout called "seat0" to use my screen0, which is attached to nvidia0, using keyboard0 and mouse0.<br />
<br />
The AutoAddDevices option is now needed to keep HAL from automatically adding all your input devices to all the X servers.<br />
<br />
{{bc|<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "Clone" "off"<br />
Option "AutoAddDevices" "off"<br />
Option "DisableModInDev" "true"<br />
Option "SingleCard" "on" # use this to simplfied isolatedevice option <br />
EndSection<br />
}}<br />
<br />
Create a section like this for every seat you have with their respective keyboards, mice and screens.<br />
<br />
==Testing==<br />
Before we start modifying our login manager, we'll first start with testing out the individual seats. If these are working, then we're good to go.<br />
<br />
I've used twm (tiny window manager) to test out if my seats work, but there's no reason you can't use KDE, gnome, or any other desktop environment or window manager. I've used this in my {{ic|~/.xinitrc}}:<br />
exec twm<br />
<br />
Use the following command to test out an individual seat:<br />
startx -- -layout seat0 -config xorg.conf.multiseat<br />
<br />
Do this for every seat you have. If they are all working correctly and the keyboard/mouse combination matches, then congratulations! You are almost finished! In case you are wondering why I didn't you use the full path to my new configuration file, that's because X doesn't allow that when running as non-root. It will search for xorg.conf.multiseat relative to {{ic|/etc/X11}}.<br />
<br />
==Setting up the loginmanager==<br />
<br />
===For KDM (KDE's Display Manager)===<br />
<br />
Open {{ic|/usr/share/config/kdm/kdmrc}} and set the following variables:<br />
<br />
{{bc|1=<br />
StaticServers=:0,:1 #In the case of two seats. If you have three this would become :0,:1,:2 and so forth.<br />
ReserveServers=:2,:3 #You can define here as many as you want, but these should always start at the highest seat + 1.<br />
}}<br />
Next you'll need to add an [X-:n-Core] for each seat (where n = the seat)<br />
{{bc|1=<br />
[X-:0-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat0<br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch<br />
}}<br />
<br />
Add section like this for every seat you have, and do not forget to change the :0 and the -layout seat0. Note that the "-sharevts" and "-novtswitch" options should be added for all seats ''except'' the first one. Otherwise, you can end with rectangles of virtual terminals "showing through" on your primary screen.<br />
<br />
===For GDM (Gnome's Display Manager)===<br />
{{note|The following will work with GDM 2.20 but not with newer versions of GDM. GDM 2.20 is in AUR.}}<br />
<br />
Open {{ic|/etc/gdm/custom.conf}} and set the following variables (This sample demos two seats):<br />
{{bc|1=<br />
[servers]<br />
0=Standard0<br />
1=Standard1<br />
<br />
[server-Standard0]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat0<br />
flexible=true<br />
<br />
[server-Standard1]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat1<br />
flexible=true<br />
}}<br />
<br />
===For XDM (X Display Manager)===<br />
<br />
Open {{ic|/etc/X11/xdm/Xservers}} and set the following variables (This sample demos two seats):<br />
<br />
{{bc|<br />
# NOTE: don't add -sharevts on seat0, otherwise it may reset in about 10~20 minutes automatically.<br />
:0 local /usr/bin/X :0 vt07 -nolisten tcp -novtswitch -layout seat0 -config xorg.conf.multiseat<br />
:1 local /usr/bin/X :1 vt08 -nolisten tcp -sharevts -novtswitch -layout seat1 -config xorg.conf.multiseat<br />
}}<br />
<br />
Also if you use the Archlinux theme edit {{ic|/etc/X11/xdm/xdm-config}} for every screen:<br />
<br />
{{bc|<br />
DisplayManager._0.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._0.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._0.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
DisplayManager._1.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._1.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._1.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
}}<br />
<br />
===For LightDM (Light Display Manager)===<br />
<br />
LightDM works well with ALSA only and PulseAudio removed if you wish to have shared audio, an alsamixer equalizer and software mixing.<br />
<br />
In the example below LightDM and MATE with ALSA was installed with PulseAudio removed. PulseAudio could also be used but it requires a more complicated configuration to maintain high audio quality. The relevant hardware used is an ATI Radeon HD 5850 and an Intel Sandy Bridge (onboard) HD 3000. You configuration may vary.<br />
<br />
Open {{ic|/etc/lightdm/lightdm.conf}} and follow the sample. Autologin is optional. This works both as multi-user multiseat and single user multi-seat. In the first case only the last user to login will have audio control and access. Specific hardware could be addressed in {{ic|/etc/asound.conf}} to allocate audio to both users simultaneously if required. Another option enables two different users to both access audio with their own equalizer (described further down). The sound card will be shared equally among the seats using ALSA with PulseAudio removed - libpulse itself should be kept for various software dependencies however:<br />
<br />
{{bc|1=<br />
[LightDM]<br />
greeter-user=lightdm<br />
log-directory=/var/log/lightdm<br />
run-directory=/run/lightdm<br />
<br />
[SeatDefaults]<br />
xserver-command=/usr/bin/X<br />
greeter-session=lightdm-gtk-greeter<br />
greeter-show-manual-login=true<br />
user-session=mate<br />
session-wrapper=/etc/lightdm/Xsession<br />
pam-service=lightdm-autologin<br />
exit-on-failure=true<br />
<br />
[Seat:0]<br />
xserver-command=/usr/bin/X :0 -sharevts<br />
xserver-layout=Layout0<br />
#autologin-user=joeblow<br />
#autologin-user-timeout=-1<br />
#session-setup-script=/etc/lightdm/scripts/sound_start<br />
#session-cleanup-script=/etc/lightdm/scripts/sound_stop<br />
<br />
[Seat:1]<br />
xserver-command=/usr/bin/X :1 -sharevts<br />
xserver-layout=Layout1<br />
#autologin-user=jillschmill<br />
#autologin-user-timeout=-1<br />
}}<br />
<br />
Next, remove respective {{ic|~/.asoundrc}} files (as well as related PulseAudio config files if you removed that) and follow this template with {{ic|/etc/asound.conf}} for sound:<br />
<br />
{{bc|<br />
defaults.pcm.rate_converter "samplerate_best"<br />
<br />
ctl.equal {<br />
type equal;<br />
}<br />
<br />
pcm.plugequal {<br />
type equal;<br />
# Modify the line below if you do not<br />
# want to use sound card 0.<br />
#slave.pcm "plughw:0,0";<br />
#by default we want to play from more sources at time:<br />
slave.pcm "plug:dmix";<br />
}<br />
#pcm.equal {<br />
# If you do not want the equalizer to be your<br />
# default soundcard comment the following<br />
# line and uncomment the above line. (You can<br />
# choose it as the output device by addressing<br />
# it with specific apps,eg mpg123 -a equal 06.Back_In_Black.mp3)<br />
pcm.!default {<br />
type plug;<br />
slave.pcm plugequal;<br />
}<br />
}}<br />
<br />
If you wish to share audio equally among different users, add each user to the audio group:<br />
<br />
Example:<br />
{{bc|<br />
usermod -a -G ftp joeblow<br />
usermod -a -G ftp jillschmill<br />
}}<br />
<br />
Then put this in each user's respective ~/.asoundrc:<br />
{{bc|1=<br />
defaults.pcm.rate_converter "samplerate_best"<br />
<br />
ctl.equal {<br />
type equal;<br />
}<br />
<br />
pcm.ossmix {<br />
type dmix<br />
ipc_key 1024 # must be unique!<br />
ipc_key_add_uid false # let multiple users share<br />
ipc_perm 0666 # IPC permissions for multi-user sharing (octal, default 0600)<br />
slave {<br />
pcm "hw:0,0" # you cannot use a "plug" device here, darn.<br />
period_time 0<br />
period_size 1024 # must be power of 2<br />
buffer_size 8192 # dito. It<br />
#format "S32_LE"<br />
#periods 128 # dito.<br />
#rate 8000 # with rate 8000 you *will* hear,<br />
# if ossmix is used :)<br />
}<br />
# bindings are cool. This says, that only the first<br />
# two channels are to be used by dmix, which is<br />
# enough for (most) oss apps and also lets <br />
# multichannel chips work much faster:<br />
bindings {<br />
0 0 # from 0 => to 0<br />
1 1 # from 1 => to 1<br />
}<br />
}<br />
<br />
pcm.plugequal {<br />
type equal;<br />
# Modify the line below if you do not<br />
# want to use sound card 0.<br />
#slave.pcm "plughw:0,0";<br />
#by default we want to play from more sources at time:<br />
slave.pcm "plug:ossmix";<br />
}<br />
<br />
#pcm.equal {<br />
# If you do not want the equalizer to be your<br />
# default soundcard comment the following<br />
# line and uncomment the above line. (You can<br />
# choose it as the output device by addressing<br />
# it with specific apps,eg mpg123 -a equal 06.Back_In_Black.mp3)<br />
pcm.!default {<br />
type plug;<br />
slave.pcm plugequal;<br />
}<br />
}}<br />
<br />
Accessing the equalizer can be done with:<br />
<br />
{{bc|<br />
alsaequal -D equal<br />
}}<br />
<br />
In the previous case, each user has an equalizer they can configure separately.<br />
<br />
Make sure to turn down and mute the audio channels that you do not use and turn off auto-mute microphone to avoid ALSA audio bugs.<br />
<br />
Finally you must set the {{ic|/etc/X11/xorg.conf}} file. You'll notice some options have been commented out which could be set according to your needs. Here is a sample, adjust to your own system configuration after determing hardware information:<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "DefaultServerLayout" "Layout1"<br />
# Option "AllowMouseOpenFail" "true"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "DontZap" "false"<br />
Option "Xinerama" "0"<br />
Option "AutoAddGPU" "FALSE"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "kbd_0" "CoreKeyboard"<br />
InputDevice "mouse_0" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true" <br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout1"<br />
Screen 0 "Screen1" 0 0<br />
InputDevice "kbd_1" "CoreKeyboard"<br />
InputDevice "mouse_1" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true"<br />
EndSection<br />
<br />
Section "Module"<br />
# Load "dri2"<br />
# Load "glamoregl"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.6:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:04:00.0-usb-0:1:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.5:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.3:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
# Option "DPMS" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "radeon"<br />
# Option "AccelMethod" "glamor"<br />
Option "AccelMethod" "EXA"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:1:0:0"<br />
Screen 0<br />
# Option "EXAVSync"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device1"<br />
Driver "intel"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:0:2:0"<br />
Screen 0<br />
# Option "AccelMethod" "UXA"<br />
# Option "TearFree" "1"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Device0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen1"<br />
Device "Device1"<br />
Monitor "Monitor1"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
Make sure to delete the {{ic|~/.Xauthority}} file in respective user directories before the initial reboot.<br />
<br />
===For Auto Login multiseat (without Display Manager)===<br />
<br />
edit a script /boot/twin.sh<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
cmd1="/bin/bash --login -c \"/usr/bin/xinit --"<br />
cmd2="-nolisten tcp -keeptty -novtswitch -config xorg.multiseat.conf"<br />
usr=(user1 user2) # FIXME: assume user1, user2 is valid user id<br />
declare -a pid<br />
while true ; do<br />
for ((i=0; i<${#usr[*]}; i++)) ; do<br />
echo "usr[$i]=${usr[$i]} pid=${pid[$i]}"<br />
if [ -z "${pid[$i]}" ] || [ ! -d "/proc/${pid[$i]}" ] ; then<br />
# echo "pid ${pid[$i]} killed, execute again" <br />
cmd3="-layout seat$i vt0"$((7+i))"\""<br />
if [ $i -gt 0 ] ; then<br />
cmd3="-sharevts $cmd3"<br />
fi<br />
#echo "cmd3=$cmd3"<br />
/bin/su ${usr[$i]} -l -c "$cmd1 :$i $cmd2 $cmd3" &<br />
pid[$i]=$!<br />
#echo "new pid=${pid[$i]}"<br />
fi<br />
done<br />
sleep 5 # check process exist per 5 second<br />
done<br />
</nowiki>}}<br />
<br />
Open {{ic|/etc/inittab}} and setup as follows:<br />
<br />
{{bc|<br />
#id:3:initdefault:<br />
id:5:initdefault:<br />
...<br />
x2:5:once:/root/twin.sh > /root/twin.log 2>&1<br />
}}<br />
<br />
==Troubleshooting==<br />
<br />
===My Windows key doesn't work anymore===<br />
<br />
Put this in [[Execute commands after X start|a startup file]]:<br />
xmodmap -e "add Mod4 = Super_L Super_R"<br />
<br />
===Unreliable behaviour (black picture without cursor)===<br />
<br />
If everything seems to be set up correctly, but for some reason you always get a black picture without a cursor, try setting the first initialized card in the BIOS to be the PCI card one.<br />
<br />
===Little black boxes/dots on the desktop===<br />
<br />
This is actually portions of the virtual terminals being painted on top of X. It seems to be caused by the Linux kernel framebuffer. This can be fixed by disabling the framebuffer, or by removing the "-sharevts" option from the primary seat's X args.<br />
<br />
===Multimedia keys not working===<br />
<br />
If your keyboard(s) has extra "multimedia" keys, you may find that they stopped working in your multiseat setup. This is because such keyboards are often represented as more then one "event" device. As you did above, cat each /dev/input/event* device, this time pressing multimedia keys. Once you've found the right event device, add a separate keyboard InputDevice section for it, then add that InputDevice section to the corresponding ServerLayout section with the "SendCoreEvents" option, which indicates that input from this device should be handled, despite not being the core keyboard. In the end you should have sections something like the following:<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "Keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event6"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "Keyboard0Multimedia"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event7"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "Keyboard0" "CoreKeyboard"<br />
InputDevice "Keyboard0Multimedia" "SendCoreEvents"<br />
InputDevice "Mouse0" "CorePointer"<br />
Option "AutoAddDevices" "no"<br />
EndSection<br />
}}<br />
<br />
===The Ctrl-Alt-Fx, Alt-Fx keys mess up with virtual terminals===<br />
<br />
(Oct 2010) I follows this guide and everything works, except for Atl-F1, Atl-F2,... mess things up. Then I follow this guide https://help.ubuntu.com/community/MultiseatX (read the part for Ubuntu 10.04):<br />
<br />
{{bc|<br />
# cd /usr/bin<br />
# ln -s X X0<br />
# ln -s X X1<br />
}}<br />
<br />
Then fix in the '''/usr/share/config/kdm/kdmrc''' as follow<br />
<br />
{{bc|1=<br />
[General]<br />
ConsoleTTYs=tty1,tty2,tty3,tty4,tty5,tty6<br />
ServerVTs=7,8<br />
StaticServers=:0,:1<br />
ReserveServers=:2,:3<br />
...<br />
<br />
[X-:0-Core]<br />
ServerVT=8<br />
ServerCmd=/usr/bin/X1<br />
ServerArgsLocal=-nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0<br />
<br />
[X-:1-Core]<br />
ServerVT=7<br />
ServerCmd=/usr/bin/X0<br />
ServerArgsLocal=-nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0<br />
...<br />
}}<br />
<br />
It works for my computer: one on-board Intel card (xf86-video-intel driver), and one Nvidia card (xf86-video-nouveau driver). You can check if the parameters are passed correctly by:<br />
<br />
{{bc|<nowiki><br />
$ ps aux | grep 'PCI' | grep -Ev 'grep'<br />
root 16993 1.6 1.3 32900 26772 ? S 08:09 0:19 /usr/bin/X0 :1 vt7 -nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0 -auth /var/run/xauth/A:1-ES6CCb<br />
root 17124 5.9 0.5 18996 11980 ? S 08:09 1:09 /usr/bin/X1 :0 vt8 -nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0 -auth /var/run/xauth/A:0-Wgiyza<br />
<br />
</nowiki>}}<br />
<br />
The '''ServerVT=7''', '''ServerVT=8''' would be pass to as '''vt7''', '''vt8'''<br />
<br />
==Final configuration==<br />
<br />
===/etc/X11/xorg.conf===<br />
<br />
This is my full xorg.conf with multiseat that works:<br />
{{bc|<br />
Section "Module"<br />
Load "dbe"<br />
<br />
SubSection "extmod"<br />
Option "omit xfree86-dga"<br />
EndSubSection<br />
<br />
Load "type1"<br />
Load "speedo"<br />
Load "freetype"<br />
Load "glx"<br />
EndSection<br />
<br />
<br />
Section "Files"<br />
RgbPath "/usr/share/X11/rgb"<br />
<br />
FontPath "/usr/share/fonts/misc"<br />
FontPath "/usr/share/fonts/75dpi"<br />
FontPath "/usr/share/fonts/100dpi"<br />
FontPath "/usr/share/fonts/TTF"<br />
FontPath "/usr/share/fonts/Type1"<br />
FontPath "/usr/share/fonts/msfonts"<br />
FontPath "/usr/share/fonts/misc2"<br />
FontPath "/usr/share/fonts/local"<br />
FontPath "/usr/local/share/fonts"<br />
EndSection<br />
<br />
<br />
Section "ServerFlags"<br />
# Option "DontZap"<br />
Option "AllowMouseOpenFail" "true"<br />
# Option "DefaultServerLayout" "alltogether"<br />
Option "Xinerama" "0"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event5"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2" # Auto detect<br />
Option "Device" "/dev/input/mouse2"<br />
Option "ZAxisMapping" "4 5"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse1"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse1"<br />
EndSection<br />
<br />
<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:1:0:0"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "nvidia1"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:0:10:0"<br />
EndSection<br />
<br />
<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "screen1"<br />
Device "nvidia1"<br />
Monitor "cpdm151"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1024x768" "800x600"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat1"<br />
Screen "screen1" 0 0<br />
InputDevice "mouse1" "CorePointer"<br />
InputDevice "keyboard1" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "Extensions"<br />
Option "Composite" "Disable"<br />
Option "RENDER" "Enable"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "cpdm151"<br />
Option "dpms"<br />
HorizSync 30-61<br />
VertRefresh 60<br />
EndSection<br />
}}<br />
<br />
===/opt/kde/share/config/kdm/kdmrc===<br />
<br />
This is my kdmrc:<br />
<br />
{{bc|1=<br />
[General]<br />
ConfigVersion=2.3<br />
ConsoleTTYs=vc/1,vc/2,vc/3,vc/4,vc/5,vc/6<br />
PidFile=/var/run/kdm.pid<br />
ReserveServers=:2,:3<br />
ServerVTs=-7<br />
StaticServers=:0,:1<br />
<br />
[Shutdown]<br />
BootManager=Grub<br />
HaltCmd=/sbin/halt<br />
RebootCmd=/sbin/reboot<br />
<br />
[X-*-Core]<br />
AllowNullPasswd=false<br />
AllowRootLogin=false<br />
AllowShutdown=Root<br />
Authorize=true<br />
AutoReLogin=false<br />
ClientLogFile=.xsession-errors-%s<br />
Reset=/opt/kde/share/config/kdm/Xreset<br />
Resources=/opt/kde/share/config/kdm/Xresources<br />
Session=/opt/kde/share/config/kdm/Xsession<br />
SessionsDirs=/etc/X11/sessions,/usr/share/xsessions,/opt/kde/share/apps/kdm/sessions<br />
Setup=/opt/kde/share/config/kdm/Xsetup<br />
Startup=/opt/kde/share/config/kdm/Xstartup<br />
<br />
[X-*-Greeter]<br />
AllowConsole=true<br />
AntiAliasing=true<br />
AuthComplain=true<br />
BackgroundCfg=/opt/kde/share/config/kdm/backgroundrc<br />
ColorScheme=<br />
DefaultUser=<br />
EchoMode=OneStar<br />
FaceSource=PreferUser<br />
FailFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
FocusPasswd=false<br />
ForgingSeed=1097313140<br />
GUIStyle=<br />
GreetFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
GreetString=Arch Linux %r (%h)<br />
GreeterPos=50,50<br />
HiddenUsers=root<br />
Language=en_US<br />
LogoArea=None<br />
LogoPixmap=<br />
MaxShowUID=65000<br />
MinShowUID=500<br />
PreselectUser=None<br />
SelectedUsers=<br />
ShowUsers=NotHidden<br />
SortUsers=true<br />
StdFont=Tahoma,11,-1,5,50,0,0,0,0,0<br />
UseBackground=false<br />
UserCompletion=false<br />
UserList=true<br />
<br />
[X-:*-Core]<br />
AllowNullPasswd=true<br />
AllowRootLogin=true<br />
AllowShutdown=All<br />
NoPassEnable=false<br />
NoPassUsers=<br />
<br />
[X-:*-Greeter]<br />
AllowClose=true<br />
DefaultUser=glenn<br />
FocusPasswd=true<br />
LoginMode=DefaultLocal<br />
PreselectUser=Previous<br />
<br />
[X-:0-Core]<br />
AutoLoginAgain=false<br />
AutoLoginDelay=0<br />
AutoLoginEnable=false<br />
AutoLoginLocked=false<br />
AutoLoginUser=glenn<br />
ClientLogFile=.xsession-errors<br />
ServerArgsLocal=-nolisten tcp -layout seat0 -sharevts -novtswitch <br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch <br />
<br />
[Xdmcp]<br />
Enable=false<br />
Willing=/opt/kde/share/config/kdm/Xwilling<br />
Xaccess=/opt/kde/share/config/kdm/Xaccess<br />
}}<br />
<br />
==Related problems==<br />
<br />
===PulseAudio===<br />
If two users want to use the sound card simultaneously, it is necessary to use a sound server, [[PulseAudio]] being most prevalent. Usually, the PulseAudio server runs only for active user and does not allow for multiple user instances. Solution to this problem is using the system-wide PulseAudio server. Although this approach is discouraged by its authors, it is probably most applicable setup.<br />
<br />
;Configuring for system-wide PulseAudio<br />
* Create user pulse and put him into group audio (PulseAudio drops root privileges and changes to user pulse. Group membership allows for device access.)<br />
* Create group pulse-access and put users, who will play sound locally into it (Group membership is used for access control for local access to PA daemon.)<br />
* In /etc/pulse/default.pa state explicitly the access rights<br />
{{bc|1=<br />
load-module module-native-protocol-unix auth-group=pulse-access auth-group-enable=1<br />
}}<br />
<br />
Start PA as system-wide, under root: {{bc|pulseaudio --system}}<br />
<br />
In {{ic|/var/run/pulse}} should appear files for communication with daemon, namely pid and native. <br />
<br />
;User access<br />
You can check communication with system daemon as non-root by e.g. {{ic|pactl -s "unix:/var/run/pulse/native" list}}.<br />
<br />
It is possible to enable automatic connection to local daemon in /etc/pulse/client.conf<br />
{{bc|1=<br />
auto-connect-localhost = yes<br />
}}<br />
<br />
The users should be able to connect to PA server. All the cons for system-wide daemon become essentially pros, e.g. ability to control volume of other users streams in pavucontrol.<br />
<br />
;Troubleshooting<br />
It is possible to enable the http interface to PA for debugging in /etc/pulse/default.pa<br />
{{ic|load-module module-http-protocol-tcp}} and then connect to it at http://localhost:4714/<br />
<br />
==See also==<br />
*[https://bbs.archlinux.org/viewtopic.php?id=105450 The original Arch Forums thread].<br />
<br />
*The arckwiki page [[Multi-pointer X]] explains how to setup two separate pair of devices on the same session.</div>Shillshockedhttps://wiki.archlinux.org/index.php?title=Xorg_multiseat&diff=297077Xorg multiseat2014-02-13T01:38:17Z<p>Shillshocked: </p>
<hr />
<div>{{Expansion|Show how PulseAudio can be configured for multiple users without running PulseAudio system-wide. Explain how Multiseat be done using only one video card (and/or X Server) and without Xephyr.}}<br />
<br />
[[Category:X Server]]<br />
Multiseat is a certain setup where multiple users work simultaneously on one computer. This is achieved by having two monitors, two keyboards and two mice. The advantages are quite obvious:<br />
* Less power consumption (only one computer)<br />
* Less hardware to purchase<br />
* All the cool kids do it<br />
<br />
==Requirements==<br />
<br />
===Keyboards and mice===<br />
<br />
Any standard PS/2 or USB keyboards will suffice. Same thing for mice.<br />
<br />
===Graphics hardware===<br />
<br />
For the best possible result you'll need two graphics cards. I used an nVidia FX5500 AGP and an nVidia 6200 PCI. If you look around a bit you can certainly find new and decent PCI graphics card for a soft price.<br />
<br />
It is possible to use only one videocard which has dual heads (like most nvidia cards will have), but this has some limitations: you have to use Xephyr on the second monitor which seems quite a messy solution from what I've read, and for optimal usage both screens need the same resolution.<br />
<br />
If you have two pci-express slots, take advantage of them! That way you'll even be able to play two games at the same time. (PCI is too slow to play comfortably)<br />
<br />
===Processors and memory===<br />
<br />
If you really are working with two users on the same computer, I'd at least recommend a dual-core processor and plenty of RAM. A fast hard drive (10.000 RPM or higher) is also recommended for comfortable use.<br />
<br />
===Software===<br />
<br />
You'll need Xorg with the drivers for your graphics card (according to some sources, the closed source nvidia driver works better than the open source nv driver for this, I have t tested this myself) and the evdev (xf86-input-evdev) driver. That's all. All this can be found in the Arch Linux core and extra repositories.<br />
<br />
===Some X knowledge===<br />
<br />
If you know how X works this will be a lot easier. Before you start, I recommend generating a clean configuration with xorgconfig that works with a single screen. Read through this xorg configuration and make yourself familiar. And as usual the manpages will provide you with most of the answers. You may reference some man pages: xorg, xserver, startx, xdm, xinit.<br />
'''sudo X -configure''', '''X -showopts''' may give you some hint.<br />
<br />
==Definitions==<br />
<br />
For this article to be clear, I'll be using the following definitions:<br />
* screen: A screen is something Xorg can display its stuff on. A screen has a monitor and a graphics card assigned to it.<br />
* monitor: A physical monitor like the one you're now sitting in front of.<br />
* server layout: a definition of which screen, keyboard and mouse to use.<br />
* seat: A workplace with a physical monitor, physical keyboard and physical mouse.<br />
<br />
==Tips and tricks==<br />
<br />
* Set up ssh on your computer, so you can ssh to the machine from another computer (such as a laptop). This is very useful because you'll probably run into X not responding anymore or not giving you picture at all.<br />
* Finding out which keyboard and mouse is which: open a terminal and use cat to find out. For example, {{ic|cat /dev/input/mouse1}}. If you then move your mouse and you see all weird things happening than that is the mouse you're moving. Same goes for keyboards, which are called eventN.<br />
* Try a basic configuration first. Don't start with the fancy stuff yet, get a very basic Xorg working first.<br />
* Leave your {{ic|xorg.conf}} alone and create a new file, called {{ic|xorg.conf.multiseat}} in {{ic|/etc/X11}} to store your new multiseat configuration. After this configuration is working you can overwrite the {{ic|xorg.conf}} file with your new {{ic|xorg.conf.multiseat}}.<br />
* Create a backup of all relevant configuration files. What do you mean you'll skip this one?<br />
* Take a look at the full configuration I used at the end of this article before you start.<br />
<br />
==About evdev==<br />
<br />
evdev is an Xorg driver which can make use of the kernel event devices, which you can find in {{ic|/dev/input}}.<br />
<br />
==Setting up Xorg==<br />
<br />
The logic behind this is that you have two server layouts, each assigned with their own keyboard, mouse, video card and monitor. <br />
<br />
===The basics===<br />
<br />
First of all we'll set up the basics for xorg.<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "AllowMouseOpenFail" "on"<br />
Option "AllowEmptyInput" "on"<br />
Option "ZapWarning" "on"<br />
Option "HandleSpecialKeys" "off" # Zapping on<br />
Option "DRI2" "on"<br />
Option "Xinerama" "off"<br />
EndSection<br />
}}<br />
<br />
===Defining available input devices===<br />
<br />
This part of the configuration tells Xorg which input devices it has available. Input devices are keyboards and mice, but can also be, for example, touchscreens and pens.<br />
<br />
This section defines my first keyboard, called keyboard0. As you can seen it uses the evdev driver. {{ic|/dev/input/event1}} corresponds with the keyboard connected to the PS/2 port of my computer. Create a section like this for each keyboard you have. Don't forget to modify the identifier of course. Keep the identifier simple and match it with the other names. This keyboard0 will be used for screen0 together with mouse0.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
# Option "Device" "/dev/input/by-path/platform-i8042-serio-0-event-kbd" <br />
# Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-kbd"<br />
Option "xkb_rules" "evdev"<br />
Option "xkb_model" "evdev"<br />
Option "xkb_layout" "us"<br />
Option "GrabDevice" "on" # prevent send event to other X-servers<br />
# If you are using a non en_US keyboard, set the layout here.<br />
# Option "XkbLayout" "be"<br />
EndSection<br />
}}<br />
<br />
<br />
This section defines my first mouse, called mouse0. This uses the regular mouse driver. /dev/input/mouse2 corresponds with the mouse connected to the PS/2 port of my computer. Create a section like this for each mouse you have.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse2"<br />
EndSection<br />
# or use evdev, that could assign by id<br />
Section "InputDevice"<br />
Identifier "Mouse0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
}}<br />
<br />
===Graphics card===<br />
<br />
Now we'll set up the graphics card for each screen.<br />
<br />
{{bc|<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "NoLogo" "1" # Remove nvidia branding at startup<br />
BusId "PCI:1:0:0"<br />
Option "ProbeAllGpus" "false" # Only required for nvidia<br />
EndSection<br />
}}<br />
<br />
This section defines my first graphics card, called nvidia0. This uses the closed source nvidia driver. Take a close look at the BusID. This option specifies which hardware card to use. You can find out the BusId's with lspci. However, you'll soon find out this doesn't always match. That's because lspci displays the device address in hexadecimal form. Xorg however uses decimal form. So you'll need to convert your address from hexadecimal form to decimal. Thus a device address of 0:0a:0 in lspci would become 0:10:0 in {{ic|xorg.conf}}.<br />
<br />
Create a section like this for every graphics card you have.<br />
<br />
===Screens===<br />
<br />
This section defines my first screen, called screen0. Pay close attention to the "monitor" option. For easy recognition I called it the model of my monitor.<br />
<br />
{{bc|<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
}}<br />
<br />
Create a section like this for every screen you have.<br />
<br />
===Monitors===<br />
<br />
This section defines my first monitor, l1730s. Pay close attention to the identifier.<br />
<br />
{{bc|<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
}}<br />
<br />
Create section like this for every monitor you have.<br />
<br />
===Serverlayout===<br />
<br />
Here's the fun stuff. This is how everything is added up. This is my first seat, called seat0. Here I tell Xorg for the server layout called "seat0" to use my screen0, which is attached to nvidia0, using keyboard0 and mouse0.<br />
<br />
The AutoAddDevices option is now needed to keep HAL from automatically adding all your input devices to all the X servers.<br />
<br />
{{bc|<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "Clone" "off"<br />
Option "AutoAddDevices" "off"<br />
Option "DisableModInDev" "true"<br />
Option "SingleCard" "on" # use this to simplfied isolatedevice option <br />
EndSection<br />
}}<br />
<br />
Create a section like this for every seat you have with their respective keyboards, mice and screens.<br />
<br />
==Testing==<br />
Before we start modifying our login manager, we'll first start with testing out the individual seats. If these are working, then we're good to go.<br />
<br />
I've used twm (tiny window manager) to test out if my seats work, but there's no reason you can't use KDE, gnome, or any other desktop environment or window manager. I've used this in my {{ic|~/.xinitrc}}:<br />
exec twm<br />
<br />
Use the following command to test out an individual seat:<br />
startx -- -layout seat0 -config xorg.conf.multiseat<br />
<br />
Do this for every seat you have. If they are all working correctly and the keyboard/mouse combination matches, then congratulations! You are almost finished! In case you are wondering why I didn't you use the full path to my new configuration file, that's because X doesn't allow that when running as non-root. It will search for xorg.conf.multiseat relative to {{ic|/etc/X11}}.<br />
<br />
==Setting up the loginmanager==<br />
<br />
===For KDM (KDE's Display Manager)===<br />
<br />
Open {{ic|/usr/share/config/kdm/kdmrc}} and set the following variables:<br />
<br />
{{bc|1=<br />
StaticServers=:0,:1 #In the case of two seats. If you have three this would become :0,:1,:2 and so forth.<br />
ReserveServers=:2,:3 #You can define here as many as you want, but these should always start at the highest seat + 1.<br />
}}<br />
Next you'll need to add an [X-:n-Core] for each seat (where n = the seat)<br />
{{bc|1=<br />
[X-:0-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat0<br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch<br />
}}<br />
<br />
Add section like this for every seat you have, and do not forget to change the :0 and the -layout seat0. Note that the "-sharevts" and "-novtswitch" options should be added for all seats ''except'' the first one. Otherwise, you can end with rectangles of virtual terminals "showing through" on your primary screen.<br />
<br />
===For GDM (Gnome's Display Manager)===<br />
{{note|The following will work with GDM 2.20 but not with newer versions of GDM. GDM 2.20 is in AUR.}}<br />
<br />
Open {{ic|/etc/gdm/custom.conf}} and set the following variables (This sample demos two seats):<br />
{{bc|1=<br />
[servers]<br />
0=Standard0<br />
1=Standard1<br />
<br />
[server-Standard0]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat0<br />
flexible=true<br />
<br />
[server-Standard1]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat1<br />
flexible=true<br />
}}<br />
<br />
===For XDM (X Display Manager)===<br />
<br />
Open {{ic|/etc/X11/xdm/Xservers}} and set the following variables (This sample demos two seats):<br />
<br />
{{bc|<br />
# NOTE: don't add -sharevts on seat0, otherwise it may reset in about 10~20 minutes automatically.<br />
:0 local /usr/bin/X :0 vt07 -nolisten tcp -novtswitch -layout seat0 -config xorg.conf.multiseat<br />
:1 local /usr/bin/X :1 vt08 -nolisten tcp -sharevts -novtswitch -layout seat1 -config xorg.conf.multiseat<br />
}}<br />
<br />
Also if you use the Archlinux theme edit {{ic|/etc/X11/xdm/xdm-config}} for every screen:<br />
<br />
{{bc|<br />
DisplayManager._0.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._0.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._0.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
DisplayManager._1.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._1.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._1.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
}}<br />
<br />
===For LightDM (Light Display Manager)===<br />
<br />
LightDM works well with ALSA only and PulseAudio removed if you wish to have shared audio, an alsamixer equalizer and software mixing.<br />
<br />
In the example below LightDM and MATE with ALSA was installed with PulseAudio removed. PulseAudio could also be used but it requires a more complicated configuration to maintain high audio quality. The relevant hardware used is an ATI Radeon HD 5850 and an Intel Sandy Bridge (onboard) HD 3000. You configuration may vary.<br />
<br />
Open {{ic|/etc/lightdm/lightdm.conf}} and follow the sample. Autologin is optional. This works both as multi-user multiseat and single user multi-seat. In the former case only the last user to login will have audio control and access. Specific hardware could be addressed in {{ic|/etc/asound.conf}} to allocate audio to both users simultaneously if required. In the latter case the sound card will be shared equally among the seats using ALSA with PulseAudio removed - libpulse itself should be kept for various software dependencies however:<br />
<br />
{{bc|1=<br />
[LightDM]<br />
greeter-user=lightdm<br />
log-directory=/var/log/lightdm<br />
run-directory=/run/lightdm<br />
<br />
[SeatDefaults]<br />
xserver-command=/usr/bin/X<br />
greeter-session=lightdm-gtk-greeter<br />
greeter-show-manual-login=true<br />
user-session=mate<br />
session-wrapper=/etc/lightdm/Xsession<br />
pam-service=lightdm-autologin<br />
exit-on-failure=true<br />
<br />
[Seat:0]<br />
xserver-command=/usr/bin/X :0 -sharevts<br />
xserver-layout=Layout0<br />
#autologin-user=joeblow<br />
#autologin-user-timeout=-1<br />
#session-setup-script=/etc/lightdm/scripts/sound_start<br />
#session-cleanup-script=/etc/lightdm/scripts/sound_stop<br />
<br />
[Seat:1]<br />
xserver-command=/usr/bin/X :1 -sharevts<br />
xserver-layout=Layout1<br />
#autologin-user=jillschmill<br />
#autologin-user-timeout=-1<br />
}}<br />
<br />
Next, remove respective {{ic|~/.asoundrc}} files (as well as related PulseAudio config files if you removed that) and follow this template with {{ic|/etc/asound.conf}} for sound:<br />
<br />
{{bc|<br />
defaults.pcm.rate_converter "samplerate_best"<br />
<br />
ctl.equal {<br />
type equal;<br />
}<br />
<br />
pcm.plugequal {<br />
type equal;<br />
# Modify the line below if you do not<br />
# want to use sound card 0.<br />
#slave.pcm "plughw:0,0";<br />
#by default we want to play from more sources at time:<br />
slave.pcm "plug:dmix";<br />
}<br />
#pcm.equal {<br />
# If you do not want the equalizer to be your<br />
# default soundcard comment the following<br />
# line and uncomment the above line. (You can<br />
# choose it as the output device by addressing<br />
# it with specific apps,eg mpg123 -a equal 06.Back_In_Black.mp3)<br />
pcm.!default {<br />
type plug;<br />
slave.pcm plugequal;<br />
}<br />
}}<br />
<br />
Finally you must set the {{ic|/etc/X11/xorg.conf}} file. You'll notice some options have been commented out which could be set according to your needs. Here is a sample, adjust to your own system configuration after determing hardware information:<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "DefaultServerLayout" "Layout1"<br />
# Option "AllowMouseOpenFail" "true"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "DontZap" "false"<br />
Option "Xinerama" "0"<br />
Option "AutoAddGPU" "FALSE"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "kbd_0" "CoreKeyboard"<br />
InputDevice "mouse_0" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true" <br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout1"<br />
Screen 0 "Screen1" 0 0<br />
InputDevice "kbd_1" "CoreKeyboard"<br />
InputDevice "mouse_1" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true"<br />
EndSection<br />
<br />
Section "Module"<br />
# Load "dri2"<br />
# Load "glamoregl"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.6:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:04:00.0-usb-0:1:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.5:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.3:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
# Option "DPMS" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "radeon"<br />
# Option "AccelMethod" "glamor"<br />
Option "AccelMethod" "EXA"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:1:0:0"<br />
Screen 0<br />
# Option "EXAVSync"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device1"<br />
Driver "intel"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:0:2:0"<br />
Screen 0<br />
# Option "AccelMethod" "UXA"<br />
# Option "TearFree" "1"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Device0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen1"<br />
Device "Device1"<br />
Monitor "Monitor1"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
Make sure to delete the {{ic|~/.Xauthority}} file in respective user directories before the initial reboot.<br />
<br />
===For Auto Login multiseat (without Display Manager)===<br />
<br />
edit a script /boot/twin.sh<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
cmd1="/bin/bash --login -c \"/usr/bin/xinit --"<br />
cmd2="-nolisten tcp -keeptty -novtswitch -config xorg.multiseat.conf"<br />
usr=(user1 user2) # FIXME: assume user1, user2 is valid user id<br />
declare -a pid<br />
while true ; do<br />
for ((i=0; i<${#usr[*]}; i++)) ; do<br />
echo "usr[$i]=${usr[$i]} pid=${pid[$i]}"<br />
if [ -z "${pid[$i]}" ] || [ ! -d "/proc/${pid[$i]}" ] ; then<br />
# echo "pid ${pid[$i]} killed, execute again" <br />
cmd3="-layout seat$i vt0"$((7+i))"\""<br />
if [ $i -gt 0 ] ; then<br />
cmd3="-sharevts $cmd3"<br />
fi<br />
#echo "cmd3=$cmd3"<br />
/bin/su ${usr[$i]} -l -c "$cmd1 :$i $cmd2 $cmd3" &<br />
pid[$i]=$!<br />
#echo "new pid=${pid[$i]}"<br />
fi<br />
done<br />
sleep 5 # check process exist per 5 second<br />
done<br />
</nowiki>}}<br />
<br />
Open {{ic|/etc/inittab}} and setup as follows:<br />
<br />
{{bc|<br />
#id:3:initdefault:<br />
id:5:initdefault:<br />
...<br />
x2:5:once:/root/twin.sh > /root/twin.log 2>&1<br />
}}<br />
<br />
==Troubleshooting==<br />
<br />
===My Windows key doesn't work anymore===<br />
<br />
Put this in [[Execute commands after X start|a startup file]]:<br />
xmodmap -e "add Mod4 = Super_L Super_R"<br />
<br />
===Unreliable behaviour (black picture without cursor)===<br />
<br />
If everything seems to be set up correctly, but for some reason you always get a black picture without a cursor, try setting the first initialized card in the BIOS to be the PCI card one.<br />
<br />
===Little black boxes/dots on the desktop===<br />
<br />
This is actually portions of the virtual terminals being painted on top of X. It seems to be caused by the Linux kernel framebuffer. This can be fixed by disabling the framebuffer, or by removing the "-sharevts" option from the primary seat's X args.<br />
<br />
===Multimedia keys not working===<br />
<br />
If your keyboard(s) has extra "multimedia" keys, you may find that they stopped working in your multiseat setup. This is because such keyboards are often represented as more then one "event" device. As you did above, cat each /dev/input/event* device, this time pressing multimedia keys. Once you've found the right event device, add a separate keyboard InputDevice section for it, then add that InputDevice section to the corresponding ServerLayout section with the "SendCoreEvents" option, which indicates that input from this device should be handled, despite not being the core keyboard. In the end you should have sections something like the following:<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "Keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event6"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "Keyboard0Multimedia"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event7"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "Keyboard0" "CoreKeyboard"<br />
InputDevice "Keyboard0Multimedia" "SendCoreEvents"<br />
InputDevice "Mouse0" "CorePointer"<br />
Option "AutoAddDevices" "no"<br />
EndSection<br />
}}<br />
<br />
===The Ctrl-Alt-Fx, Alt-Fx keys mess up with virtual terminals===<br />
<br />
(Oct 2010) I follows this guide and everything works, except for Atl-F1, Atl-F2,... mess things up. Then I follow this guide https://help.ubuntu.com/community/MultiseatX (read the part for Ubuntu 10.04):<br />
<br />
{{bc|<br />
# cd /usr/bin<br />
# ln -s X X0<br />
# ln -s X X1<br />
}}<br />
<br />
Then fix in the '''/usr/share/config/kdm/kdmrc''' as follow<br />
<br />
{{bc|1=<br />
[General]<br />
ConsoleTTYs=tty1,tty2,tty3,tty4,tty5,tty6<br />
ServerVTs=7,8<br />
StaticServers=:0,:1<br />
ReserveServers=:2,:3<br />
...<br />
<br />
[X-:0-Core]<br />
ServerVT=8<br />
ServerCmd=/usr/bin/X1<br />
ServerArgsLocal=-nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0<br />
<br />
[X-:1-Core]<br />
ServerVT=7<br />
ServerCmd=/usr/bin/X0<br />
ServerArgsLocal=-nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0<br />
...<br />
}}<br />
<br />
It works for my computer: one on-board Intel card (xf86-video-intel driver), and one Nvidia card (xf86-video-nouveau driver). You can check if the parameters are passed correctly by:<br />
<br />
{{bc|<nowiki><br />
$ ps aux | grep 'PCI' | grep -Ev 'grep'<br />
root 16993 1.6 1.3 32900 26772 ? S 08:09 0:19 /usr/bin/X0 :1 vt7 -nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0 -auth /var/run/xauth/A:1-ES6CCb<br />
root 17124 5.9 0.5 18996 11980 ? S 08:09 1:09 /usr/bin/X1 :0 vt8 -nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0 -auth /var/run/xauth/A:0-Wgiyza<br />
<br />
</nowiki>}}<br />
<br />
The '''ServerVT=7''', '''ServerVT=8''' would be pass to as '''vt7''', '''vt8'''<br />
<br />
==Final configuration==<br />
<br />
===/etc/X11/xorg.conf===<br />
<br />
This is my full xorg.conf with multiseat that works:<br />
{{bc|<br />
Section "Module"<br />
Load "dbe"<br />
<br />
SubSection "extmod"<br />
Option "omit xfree86-dga"<br />
EndSubSection<br />
<br />
Load "type1"<br />
Load "speedo"<br />
Load "freetype"<br />
Load "glx"<br />
EndSection<br />
<br />
<br />
Section "Files"<br />
RgbPath "/usr/share/X11/rgb"<br />
<br />
FontPath "/usr/share/fonts/misc"<br />
FontPath "/usr/share/fonts/75dpi"<br />
FontPath "/usr/share/fonts/100dpi"<br />
FontPath "/usr/share/fonts/TTF"<br />
FontPath "/usr/share/fonts/Type1"<br />
FontPath "/usr/share/fonts/msfonts"<br />
FontPath "/usr/share/fonts/misc2"<br />
FontPath "/usr/share/fonts/local"<br />
FontPath "/usr/local/share/fonts"<br />
EndSection<br />
<br />
<br />
Section "ServerFlags"<br />
# Option "DontZap"<br />
Option "AllowMouseOpenFail" "true"<br />
# Option "DefaultServerLayout" "alltogether"<br />
Option "Xinerama" "0"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event5"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2" # Auto detect<br />
Option "Device" "/dev/input/mouse2"<br />
Option "ZAxisMapping" "4 5"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse1"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse1"<br />
EndSection<br />
<br />
<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:1:0:0"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "nvidia1"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:0:10:0"<br />
EndSection<br />
<br />
<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "screen1"<br />
Device "nvidia1"<br />
Monitor "cpdm151"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1024x768" "800x600"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat1"<br />
Screen "screen1" 0 0<br />
InputDevice "mouse1" "CorePointer"<br />
InputDevice "keyboard1" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "Extensions"<br />
Option "Composite" "Disable"<br />
Option "RENDER" "Enable"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "cpdm151"<br />
Option "dpms"<br />
HorizSync 30-61<br />
VertRefresh 60<br />
EndSection<br />
}}<br />
<br />
===/opt/kde/share/config/kdm/kdmrc===<br />
<br />
This is my kdmrc:<br />
<br />
{{bc|1=<br />
[General]<br />
ConfigVersion=2.3<br />
ConsoleTTYs=vc/1,vc/2,vc/3,vc/4,vc/5,vc/6<br />
PidFile=/var/run/kdm.pid<br />
ReserveServers=:2,:3<br />
ServerVTs=-7<br />
StaticServers=:0,:1<br />
<br />
[Shutdown]<br />
BootManager=Grub<br />
HaltCmd=/sbin/halt<br />
RebootCmd=/sbin/reboot<br />
<br />
[X-*-Core]<br />
AllowNullPasswd=false<br />
AllowRootLogin=false<br />
AllowShutdown=Root<br />
Authorize=true<br />
AutoReLogin=false<br />
ClientLogFile=.xsession-errors-%s<br />
Reset=/opt/kde/share/config/kdm/Xreset<br />
Resources=/opt/kde/share/config/kdm/Xresources<br />
Session=/opt/kde/share/config/kdm/Xsession<br />
SessionsDirs=/etc/X11/sessions,/usr/share/xsessions,/opt/kde/share/apps/kdm/sessions<br />
Setup=/opt/kde/share/config/kdm/Xsetup<br />
Startup=/opt/kde/share/config/kdm/Xstartup<br />
<br />
[X-*-Greeter]<br />
AllowConsole=true<br />
AntiAliasing=true<br />
AuthComplain=true<br />
BackgroundCfg=/opt/kde/share/config/kdm/backgroundrc<br />
ColorScheme=<br />
DefaultUser=<br />
EchoMode=OneStar<br />
FaceSource=PreferUser<br />
FailFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
FocusPasswd=false<br />
ForgingSeed=1097313140<br />
GUIStyle=<br />
GreetFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
GreetString=Arch Linux %r (%h)<br />
GreeterPos=50,50<br />
HiddenUsers=root<br />
Language=en_US<br />
LogoArea=None<br />
LogoPixmap=<br />
MaxShowUID=65000<br />
MinShowUID=500<br />
PreselectUser=None<br />
SelectedUsers=<br />
ShowUsers=NotHidden<br />
SortUsers=true<br />
StdFont=Tahoma,11,-1,5,50,0,0,0,0,0<br />
UseBackground=false<br />
UserCompletion=false<br />
UserList=true<br />
<br />
[X-:*-Core]<br />
AllowNullPasswd=true<br />
AllowRootLogin=true<br />
AllowShutdown=All<br />
NoPassEnable=false<br />
NoPassUsers=<br />
<br />
[X-:*-Greeter]<br />
AllowClose=true<br />
DefaultUser=glenn<br />
FocusPasswd=true<br />
LoginMode=DefaultLocal<br />
PreselectUser=Previous<br />
<br />
[X-:0-Core]<br />
AutoLoginAgain=false<br />
AutoLoginDelay=0<br />
AutoLoginEnable=false<br />
AutoLoginLocked=false<br />
AutoLoginUser=glenn<br />
ClientLogFile=.xsession-errors<br />
ServerArgsLocal=-nolisten tcp -layout seat0 -sharevts -novtswitch <br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch <br />
<br />
[Xdmcp]<br />
Enable=false<br />
Willing=/opt/kde/share/config/kdm/Xwilling<br />
Xaccess=/opt/kde/share/config/kdm/Xaccess<br />
}}<br />
<br />
==Related problems==<br />
<br />
===PulseAudio===<br />
If two users want to use the sound card simultaneously, it is necessary to use a sound server, [[PulseAudio]] being most prevalent. Usually, the PulseAudio server runs only for active user and does not allow for multiple user instances. Solution to this problem is using the system-wide PulseAudio server. Although this approach is discouraged by its authors, it is probably most applicable setup.<br />
<br />
;Configuring for system-wide PulseAudio<br />
* Create user pulse and put him into group audio (PulseAudio drops root privileges and changes to user pulse. Group membership allows for device access.)<br />
* Create group pulse-access and put users, who will play sound locally into it (Group membership is used for access control for local access to PA daemon.)<br />
* In /etc/pulse/default.pa state explicitly the access rights<br />
{{bc|1=<br />
load-module module-native-protocol-unix auth-group=pulse-access auth-group-enable=1<br />
}}<br />
<br />
Start PA as system-wide, under root: {{bc|pulseaudio --system}}<br />
<br />
In {{ic|/var/run/pulse}} should appear files for communication with daemon, namely pid and native. <br />
<br />
;User access<br />
You can check communication with system daemon as non-root by e.g. {{ic|pactl -s "unix:/var/run/pulse/native" list}}.<br />
<br />
It is possible to enable automatic connection to local daemon in /etc/pulse/client.conf<br />
{{bc|1=<br />
auto-connect-localhost = yes<br />
}}<br />
<br />
The users should be able to connect to PA server. All the cons for system-wide daemon become essentially pros, e.g. ability to control volume of other users streams in pavucontrol.<br />
<br />
;Troubleshooting<br />
It is possible to enable the http interface to PA for debugging in /etc/pulse/default.pa<br />
{{ic|load-module module-http-protocol-tcp}} and then connect to it at http://localhost:4714/<br />
<br />
==See also==<br />
*[https://bbs.archlinux.org/viewtopic.php?id=105450 The original Arch Forums thread].<br />
<br />
*The arckwiki page [[Multi-pointer X]] explains how to setup two separate pair of devices on the same session.</div>Shillshockedhttps://wiki.archlinux.org/index.php?title=Xorg_multiseat&diff=297076Xorg multiseat2014-02-13T01:34:00Z<p>Shillshocked: </p>
<hr />
<div>{{Expansion|Show how PulseAudio can be configured for multiple users without running PulseAudio system-wide. Explain how Multiseat be done using only one video card and/or X Server, and without Xephyr.}}<br />
<br />
[[Category:X Server]]<br />
Multiseat is a certain setup where multiple users work simultaneously on one computer. This is achieved by having two monitors, two keyboards and two mice. The advantages are quite obvious:<br />
* Less power consumption (only one computer)<br />
* Less hardware to purchase<br />
* All the cool kids do it<br />
<br />
==Requirements==<br />
<br />
===Keyboards and mice===<br />
<br />
Any standard PS/2 or USB keyboards will suffice. Same thing for mice.<br />
<br />
===Graphics hardware===<br />
<br />
For the best possible result you'll need two graphics cards. I used an nVidia FX5500 AGP and an nVidia 6200 PCI. If you look around a bit you can certainly find new and decent PCI graphics card for a soft price.<br />
<br />
It is possible to use only one videocard which has dual heads (like most nvidia cards will have), but this has some limitations: you have to use Xephyr on the second monitor which seems quite a messy solution from what I've read, and for optimal usage both screens need the same resolution.<br />
<br />
If you have two pci-express slots, take advantage of them! That way you'll even be able to play two games at the same time. (PCI is too slow to play comfortably)<br />
<br />
===Processors and memory===<br />
<br />
If you really are working with two users on the same computer, I'd at least recommend a dual-core processor and plenty of RAM. A fast hard drive (10.000 RPM or higher) is also recommended for comfortable use.<br />
<br />
===Software===<br />
<br />
You'll need Xorg with the drivers for your graphics card (according to some sources, the closed source nvidia driver works better than the open source nv driver for this, I have t tested this myself) and the evdev (xf86-input-evdev) driver. That's all. All this can be found in the Arch Linux core and extra repositories.<br />
<br />
===Some X knowledge===<br />
<br />
If you know how X works this will be a lot easier. Before you start, I recommend generating a clean configuration with xorgconfig that works with a single screen. Read through this xorg configuration and make yourself familiar. And as usual the manpages will provide you with most of the answers. You may reference some man pages: xorg, xserver, startx, xdm, xinit.<br />
'''sudo X -configure''', '''X -showopts''' may give you some hint.<br />
<br />
==Definitions==<br />
<br />
For this article to be clear, I'll be using the following definitions:<br />
* screen: A screen is something Xorg can display its stuff on. A screen has a monitor and a graphics card assigned to it.<br />
* monitor: A physical monitor like the one you're now sitting in front of.<br />
* server layout: a definition of which screen, keyboard and mouse to use.<br />
* seat: A workplace with a physical monitor, physical keyboard and physical mouse.<br />
<br />
==Tips and tricks==<br />
<br />
* Set up ssh on your computer, so you can ssh to the machine from another computer (such as a laptop). This is very useful because you'll probably run into X not responding anymore or not giving you picture at all.<br />
* Finding out which keyboard and mouse is which: open a terminal and use cat to find out. For example, {{ic|cat /dev/input/mouse1}}. If you then move your mouse and you see all weird things happening than that is the mouse you're moving. Same goes for keyboards, which are called eventN.<br />
* Try a basic configuration first. Don't start with the fancy stuff yet, get a very basic Xorg working first.<br />
* Leave your {{ic|xorg.conf}} alone and create a new file, called {{ic|xorg.conf.multiseat}} in {{ic|/etc/X11}} to store your new multiseat configuration. After this configuration is working you can overwrite the {{ic|xorg.conf}} file with your new {{ic|xorg.conf.multiseat}}.<br />
* Create a backup of all relevant configuration files. What do you mean you'll skip this one?<br />
* Take a look at the full configuration I used at the end of this article before you start.<br />
<br />
==About evdev==<br />
<br />
evdev is an Xorg driver which can make use of the kernel event devices, which you can find in {{ic|/dev/input}}.<br />
<br />
==Setting up Xorg==<br />
<br />
The logic behind this is that you have two server layouts, each assigned with their own keyboard, mouse, video card and monitor. <br />
<br />
===The basics===<br />
<br />
First of all we'll set up the basics for xorg.<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "AllowMouseOpenFail" "on"<br />
Option "AllowEmptyInput" "on"<br />
Option "ZapWarning" "on"<br />
Option "HandleSpecialKeys" "off" # Zapping on<br />
Option "DRI2" "on"<br />
Option "Xinerama" "off"<br />
EndSection<br />
}}<br />
<br />
===Defining available input devices===<br />
<br />
This part of the configuration tells Xorg which input devices it has available. Input devices are keyboards and mice, but can also be, for example, touchscreens and pens.<br />
<br />
This section defines my first keyboard, called keyboard0. As you can seen it uses the evdev driver. {{ic|/dev/input/event1}} corresponds with the keyboard connected to the PS/2 port of my computer. Create a section like this for each keyboard you have. Don't forget to modify the identifier of course. Keep the identifier simple and match it with the other names. This keyboard0 will be used for screen0 together with mouse0.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
# Option "Device" "/dev/input/by-path/platform-i8042-serio-0-event-kbd" <br />
# Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-kbd"<br />
Option "xkb_rules" "evdev"<br />
Option "xkb_model" "evdev"<br />
Option "xkb_layout" "us"<br />
Option "GrabDevice" "on" # prevent send event to other X-servers<br />
# If you are using a non en_US keyboard, set the layout here.<br />
# Option "XkbLayout" "be"<br />
EndSection<br />
}}<br />
<br />
<br />
This section defines my first mouse, called mouse0. This uses the regular mouse driver. /dev/input/mouse2 corresponds with the mouse connected to the PS/2 port of my computer. Create a section like this for each mouse you have.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse2"<br />
EndSection<br />
# or use evdev, that could assign by id<br />
Section "InputDevice"<br />
Identifier "Mouse0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
}}<br />
<br />
===Graphics card===<br />
<br />
Now we'll set up the graphics card for each screen.<br />
<br />
{{bc|<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "NoLogo" "1" # Remove nvidia branding at startup<br />
BusId "PCI:1:0:0"<br />
Option "ProbeAllGpus" "false" # Only required for nvidia<br />
EndSection<br />
}}<br />
<br />
This section defines my first graphics card, called nvidia0. This uses the closed source nvidia driver. Take a close look at the BusID. This option specifies which hardware card to use. You can find out the BusId's with lspci. However, you'll soon find out this doesn't always match. That's because lspci displays the device address in hexadecimal form. Xorg however uses decimal form. So you'll need to convert your address from hexadecimal form to decimal. Thus a device address of 0:0a:0 in lspci would become 0:10:0 in {{ic|xorg.conf}}.<br />
<br />
Create a section like this for every graphics card you have.<br />
<br />
===Screens===<br />
<br />
This section defines my first screen, called screen0. Pay close attention to the "monitor" option. For easy recognition I called it the model of my monitor.<br />
<br />
{{bc|<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
}}<br />
<br />
Create a section like this for every screen you have.<br />
<br />
===Monitors===<br />
<br />
This section defines my first monitor, l1730s. Pay close attention to the identifier.<br />
<br />
{{bc|<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
}}<br />
<br />
Create section like this for every monitor you have.<br />
<br />
===Serverlayout===<br />
<br />
Here's the fun stuff. This is how everything is added up. This is my first seat, called seat0. Here I tell Xorg for the server layout called "seat0" to use my screen0, which is attached to nvidia0, using keyboard0 and mouse0.<br />
<br />
The AutoAddDevices option is now needed to keep HAL from automatically adding all your input devices to all the X servers.<br />
<br />
{{bc|<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "Clone" "off"<br />
Option "AutoAddDevices" "off"<br />
Option "DisableModInDev" "true"<br />
Option "SingleCard" "on" # use this to simplfied isolatedevice option <br />
EndSection<br />
}}<br />
<br />
Create a section like this for every seat you have with their respective keyboards, mice and screens.<br />
<br />
==Testing==<br />
Before we start modifying our login manager, we'll first start with testing out the individual seats. If these are working, then we're good to go.<br />
<br />
I've used twm (tiny window manager) to test out if my seats work, but there's no reason you can't use KDE, gnome, or any other desktop environment or window manager. I've used this in my {{ic|~/.xinitrc}}:<br />
exec twm<br />
<br />
Use the following command to test out an individual seat:<br />
startx -- -layout seat0 -config xorg.conf.multiseat<br />
<br />
Do this for every seat you have. If they are all working correctly and the keyboard/mouse combination matches, then congratulations! You are almost finished! In case you are wondering why I didn't you use the full path to my new configuration file, that's because X doesn't allow that when running as non-root. It will search for xorg.conf.multiseat relative to {{ic|/etc/X11}}.<br />
<br />
==Setting up the loginmanager==<br />
<br />
===For KDM (KDE's Display Manager)===<br />
<br />
Open {{ic|/usr/share/config/kdm/kdmrc}} and set the following variables:<br />
<br />
{{bc|1=<br />
StaticServers=:0,:1 #In the case of two seats. If you have three this would become :0,:1,:2 and so forth.<br />
ReserveServers=:2,:3 #You can define here as many as you want, but these should always start at the highest seat + 1.<br />
}}<br />
Next you'll need to add an [X-:n-Core] for each seat (where n = the seat)<br />
{{bc|1=<br />
[X-:0-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat0<br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch<br />
}}<br />
<br />
Add section like this for every seat you have, and do not forget to change the :0 and the -layout seat0. Note that the "-sharevts" and "-novtswitch" options should be added for all seats ''except'' the first one. Otherwise, you can end with rectangles of virtual terminals "showing through" on your primary screen.<br />
<br />
===For GDM (Gnome's Display Manager)===<br />
{{note|The following will work with GDM 2.20 but not with newer versions of GDM. GDM 2.20 is in AUR.}}<br />
<br />
Open {{ic|/etc/gdm/custom.conf}} and set the following variables (This sample demos two seats):<br />
{{bc|1=<br />
[servers]<br />
0=Standard0<br />
1=Standard1<br />
<br />
[server-Standard0]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat0<br />
flexible=true<br />
<br />
[server-Standard1]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat1<br />
flexible=true<br />
}}<br />
<br />
===For XDM (X Display Manager)===<br />
<br />
Open {{ic|/etc/X11/xdm/Xservers}} and set the following variables (This sample demos two seats):<br />
<br />
{{bc|<br />
# NOTE: don't add -sharevts on seat0, otherwise it may reset in about 10~20 minutes automatically.<br />
:0 local /usr/bin/X :0 vt07 -nolisten tcp -novtswitch -layout seat0 -config xorg.conf.multiseat<br />
:1 local /usr/bin/X :1 vt08 -nolisten tcp -sharevts -novtswitch -layout seat1 -config xorg.conf.multiseat<br />
}}<br />
<br />
Also if you use the Archlinux theme edit {{ic|/etc/X11/xdm/xdm-config}} for every screen:<br />
<br />
{{bc|<br />
DisplayManager._0.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._0.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._0.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
DisplayManager._1.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._1.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._1.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
}}<br />
<br />
===For LightDM (Light Display Manager)===<br />
<br />
LightDM works well with ALSA only and PulseAudio removed if you wish to have shared audio, an alsamixer equalizer and software mixing.<br />
<br />
In the example below LightDM and MATE with ALSA was installed with PulseAudio removed. PulseAudio could also be used but it requires a more complicated configuration to maintain high audio quality. The relevant hardware used is an ATI Radeon HD 5850 and an Intel Sandy Bridge (onboard) HD 3000. You configuration may vary.<br />
<br />
Open {{ic|/etc/lightdm/lightdm.conf}} and follow the sample. Autologin is optional. This works both as multi-user multiseat and single user multi-seat. In the former case only the last user to login will have audio control and access. Specific hardware could be addressed in {{ic|/etc/asound.conf}} to allocate audio to both users simultaneously if required. In the latter case the sound card will be shared equally among the seats using ALSA with PulseAudio removed - libpulse itself should be kept for various software dependencies however:<br />
<br />
{{bc|1=<br />
[LightDM]<br />
greeter-user=lightdm<br />
log-directory=/var/log/lightdm<br />
run-directory=/run/lightdm<br />
<br />
[SeatDefaults]<br />
xserver-command=/usr/bin/X<br />
greeter-session=lightdm-gtk-greeter<br />
greeter-show-manual-login=true<br />
user-session=mate<br />
session-wrapper=/etc/lightdm/Xsession<br />
pam-service=lightdm-autologin<br />
exit-on-failure=true<br />
<br />
[Seat:0]<br />
xserver-command=/usr/bin/X :0 -sharevts<br />
xserver-layout=Layout0<br />
#autologin-user=joeblow<br />
#autologin-user-timeout=-1<br />
#session-setup-script=/etc/lightdm/scripts/sound_start<br />
#session-cleanup-script=/etc/lightdm/scripts/sound_stop<br />
<br />
[Seat:1]<br />
xserver-command=/usr/bin/X :1 -sharevts<br />
xserver-layout=Layout1<br />
#autologin-user=jillschmill<br />
#autologin-user-timeout=-1<br />
}}<br />
<br />
Next, remove respective {{ic|~/.asoundrc}} files (as well as related PulseAudio config files if you removed that) and follow this template with {{ic|/etc/asound.conf}} for sound:<br />
<br />
{{bc|<br />
defaults.pcm.rate_converter "samplerate_best"<br />
<br />
ctl.equal {<br />
type equal;<br />
}<br />
<br />
pcm.plugequal {<br />
type equal;<br />
# Modify the line below if you do not<br />
# want to use sound card 0.<br />
#slave.pcm "plughw:0,0";<br />
#by default we want to play from more sources at time:<br />
slave.pcm "plug:dmix";<br />
}<br />
#pcm.equal {<br />
# If you do not want the equalizer to be your<br />
# default soundcard comment the following<br />
# line and uncomment the above line. (You can<br />
# choose it as the output device by addressing<br />
# it with specific apps,eg mpg123 -a equal 06.Back_In_Black.mp3)<br />
pcm.!default {<br />
type plug;<br />
slave.pcm plugequal;<br />
}<br />
}}<br />
<br />
Finally you must set the {{ic|/etc/X11/xorg.conf}} file. You'll notice some options have been commented out which could be set according to your needs. Here is a sample, adjust to your own system configuration after determing hardware information:<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "DefaultServerLayout" "Layout1"<br />
# Option "AllowMouseOpenFail" "true"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "DontZap" "false"<br />
Option "Xinerama" "0"<br />
Option "AutoAddGPU" "FALSE"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "kbd_0" "CoreKeyboard"<br />
InputDevice "mouse_0" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true" <br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout1"<br />
Screen 0 "Screen1" 0 0<br />
InputDevice "kbd_1" "CoreKeyboard"<br />
InputDevice "mouse_1" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true"<br />
EndSection<br />
<br />
Section "Module"<br />
# Load "dri2"<br />
# Load "glamoregl"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.6:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:04:00.0-usb-0:1:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.5:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.3:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
# Option "DPMS" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "radeon"<br />
# Option "AccelMethod" "glamor"<br />
Option "AccelMethod" "EXA"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:1:0:0"<br />
Screen 0<br />
# Option "EXAVSync"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device1"<br />
Driver "intel"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:0:2:0"<br />
Screen 0<br />
# Option "AccelMethod" "UXA"<br />
# Option "TearFree" "1"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Device0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen1"<br />
Device "Device1"<br />
Monitor "Monitor1"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
Make sure to delete the {{ic|~/.Xauthority}} file in respective user directories before the initial reboot.<br />
<br />
===For Auto Login multiseat (without Display Manager)===<br />
<br />
edit a script /boot/twin.sh<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
cmd1="/bin/bash --login -c \"/usr/bin/xinit --"<br />
cmd2="-nolisten tcp -keeptty -novtswitch -config xorg.multiseat.conf"<br />
usr=(user1 user2) # FIXME: assume user1, user2 is valid user id<br />
declare -a pid<br />
while true ; do<br />
for ((i=0; i<${#usr[*]}; i++)) ; do<br />
echo "usr[$i]=${usr[$i]} pid=${pid[$i]}"<br />
if [ -z "${pid[$i]}" ] || [ ! -d "/proc/${pid[$i]}" ] ; then<br />
# echo "pid ${pid[$i]} killed, execute again" <br />
cmd3="-layout seat$i vt0"$((7+i))"\""<br />
if [ $i -gt 0 ] ; then<br />
cmd3="-sharevts $cmd3"<br />
fi<br />
#echo "cmd3=$cmd3"<br />
/bin/su ${usr[$i]} -l -c "$cmd1 :$i $cmd2 $cmd3" &<br />
pid[$i]=$!<br />
#echo "new pid=${pid[$i]}"<br />
fi<br />
done<br />
sleep 5 # check process exist per 5 second<br />
done<br />
</nowiki>}}<br />
<br />
Open {{ic|/etc/inittab}} and setup as follows:<br />
<br />
{{bc|<br />
#id:3:initdefault:<br />
id:5:initdefault:<br />
...<br />
x2:5:once:/root/twin.sh > /root/twin.log 2>&1<br />
}}<br />
<br />
==Troubleshooting==<br />
<br />
===My Windows key doesn't work anymore===<br />
<br />
Put this in [[Execute commands after X start|a startup file]]:<br />
xmodmap -e "add Mod4 = Super_L Super_R"<br />
<br />
===Unreliable behaviour (black picture without cursor)===<br />
<br />
If everything seems to be set up correctly, but for some reason you always get a black picture without a cursor, try setting the first initialized card in the BIOS to be the PCI card one.<br />
<br />
===Little black boxes/dots on the desktop===<br />
<br />
This is actually portions of the virtual terminals being painted on top of X. It seems to be caused by the Linux kernel framebuffer. This can be fixed by disabling the framebuffer, or by removing the "-sharevts" option from the primary seat's X args.<br />
<br />
===Multimedia keys not working===<br />
<br />
If your keyboard(s) has extra "multimedia" keys, you may find that they stopped working in your multiseat setup. This is because such keyboards are often represented as more then one "event" device. As you did above, cat each /dev/input/event* device, this time pressing multimedia keys. Once you've found the right event device, add a separate keyboard InputDevice section for it, then add that InputDevice section to the corresponding ServerLayout section with the "SendCoreEvents" option, which indicates that input from this device should be handled, despite not being the core keyboard. In the end you should have sections something like the following:<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "Keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event6"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "Keyboard0Multimedia"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event7"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "Keyboard0" "CoreKeyboard"<br />
InputDevice "Keyboard0Multimedia" "SendCoreEvents"<br />
InputDevice "Mouse0" "CorePointer"<br />
Option "AutoAddDevices" "no"<br />
EndSection<br />
}}<br />
<br />
===The Ctrl-Alt-Fx, Alt-Fx keys mess up with virtual terminals===<br />
<br />
(Oct 2010) I follows this guide and everything works, except for Atl-F1, Atl-F2,... mess things up. Then I follow this guide https://help.ubuntu.com/community/MultiseatX (read the part for Ubuntu 10.04):<br />
<br />
{{bc|<br />
# cd /usr/bin<br />
# ln -s X X0<br />
# ln -s X X1<br />
}}<br />
<br />
Then fix in the '''/usr/share/config/kdm/kdmrc''' as follow<br />
<br />
{{bc|1=<br />
[General]<br />
ConsoleTTYs=tty1,tty2,tty3,tty4,tty5,tty6<br />
ServerVTs=7,8<br />
StaticServers=:0,:1<br />
ReserveServers=:2,:3<br />
...<br />
<br />
[X-:0-Core]<br />
ServerVT=8<br />
ServerCmd=/usr/bin/X1<br />
ServerArgsLocal=-nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0<br />
<br />
[X-:1-Core]<br />
ServerVT=7<br />
ServerCmd=/usr/bin/X0<br />
ServerArgsLocal=-nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0<br />
...<br />
}}<br />
<br />
It works for my computer: one on-board Intel card (xf86-video-intel driver), and one Nvidia card (xf86-video-nouveau driver). You can check if the parameters are passed correctly by:<br />
<br />
{{bc|<nowiki><br />
$ ps aux | grep 'PCI' | grep -Ev 'grep'<br />
root 16993 1.6 1.3 32900 26772 ? S 08:09 0:19 /usr/bin/X0 :1 vt7 -nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0 -auth /var/run/xauth/A:1-ES6CCb<br />
root 17124 5.9 0.5 18996 11980 ? S 08:09 1:09 /usr/bin/X1 :0 vt8 -nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0 -auth /var/run/xauth/A:0-Wgiyza<br />
<br />
</nowiki>}}<br />
<br />
The '''ServerVT=7''', '''ServerVT=8''' would be pass to as '''vt7''', '''vt8'''<br />
<br />
==Final configuration==<br />
<br />
===/etc/X11/xorg.conf===<br />
<br />
This is my full xorg.conf with multiseat that works:<br />
{{bc|<br />
Section "Module"<br />
Load "dbe"<br />
<br />
SubSection "extmod"<br />
Option "omit xfree86-dga"<br />
EndSubSection<br />
<br />
Load "type1"<br />
Load "speedo"<br />
Load "freetype"<br />
Load "glx"<br />
EndSection<br />
<br />
<br />
Section "Files"<br />
RgbPath "/usr/share/X11/rgb"<br />
<br />
FontPath "/usr/share/fonts/misc"<br />
FontPath "/usr/share/fonts/75dpi"<br />
FontPath "/usr/share/fonts/100dpi"<br />
FontPath "/usr/share/fonts/TTF"<br />
FontPath "/usr/share/fonts/Type1"<br />
FontPath "/usr/share/fonts/msfonts"<br />
FontPath "/usr/share/fonts/misc2"<br />
FontPath "/usr/share/fonts/local"<br />
FontPath "/usr/local/share/fonts"<br />
EndSection<br />
<br />
<br />
Section "ServerFlags"<br />
# Option "DontZap"<br />
Option "AllowMouseOpenFail" "true"<br />
# Option "DefaultServerLayout" "alltogether"<br />
Option "Xinerama" "0"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event5"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2" # Auto detect<br />
Option "Device" "/dev/input/mouse2"<br />
Option "ZAxisMapping" "4 5"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse1"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse1"<br />
EndSection<br />
<br />
<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:1:0:0"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "nvidia1"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:0:10:0"<br />
EndSection<br />
<br />
<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "screen1"<br />
Device "nvidia1"<br />
Monitor "cpdm151"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1024x768" "800x600"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat1"<br />
Screen "screen1" 0 0<br />
InputDevice "mouse1" "CorePointer"<br />
InputDevice "keyboard1" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "Extensions"<br />
Option "Composite" "Disable"<br />
Option "RENDER" "Enable"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "cpdm151"<br />
Option "dpms"<br />
HorizSync 30-61<br />
VertRefresh 60<br />
EndSection<br />
}}<br />
<br />
===/opt/kde/share/config/kdm/kdmrc===<br />
<br />
This is my kdmrc:<br />
<br />
{{bc|1=<br />
[General]<br />
ConfigVersion=2.3<br />
ConsoleTTYs=vc/1,vc/2,vc/3,vc/4,vc/5,vc/6<br />
PidFile=/var/run/kdm.pid<br />
ReserveServers=:2,:3<br />
ServerVTs=-7<br />
StaticServers=:0,:1<br />
<br />
[Shutdown]<br />
BootManager=Grub<br />
HaltCmd=/sbin/halt<br />
RebootCmd=/sbin/reboot<br />
<br />
[X-*-Core]<br />
AllowNullPasswd=false<br />
AllowRootLogin=false<br />
AllowShutdown=Root<br />
Authorize=true<br />
AutoReLogin=false<br />
ClientLogFile=.xsession-errors-%s<br />
Reset=/opt/kde/share/config/kdm/Xreset<br />
Resources=/opt/kde/share/config/kdm/Xresources<br />
Session=/opt/kde/share/config/kdm/Xsession<br />
SessionsDirs=/etc/X11/sessions,/usr/share/xsessions,/opt/kde/share/apps/kdm/sessions<br />
Setup=/opt/kde/share/config/kdm/Xsetup<br />
Startup=/opt/kde/share/config/kdm/Xstartup<br />
<br />
[X-*-Greeter]<br />
AllowConsole=true<br />
AntiAliasing=true<br />
AuthComplain=true<br />
BackgroundCfg=/opt/kde/share/config/kdm/backgroundrc<br />
ColorScheme=<br />
DefaultUser=<br />
EchoMode=OneStar<br />
FaceSource=PreferUser<br />
FailFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
FocusPasswd=false<br />
ForgingSeed=1097313140<br />
GUIStyle=<br />
GreetFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
GreetString=Arch Linux %r (%h)<br />
GreeterPos=50,50<br />
HiddenUsers=root<br />
Language=en_US<br />
LogoArea=None<br />
LogoPixmap=<br />
MaxShowUID=65000<br />
MinShowUID=500<br />
PreselectUser=None<br />
SelectedUsers=<br />
ShowUsers=NotHidden<br />
SortUsers=true<br />
StdFont=Tahoma,11,-1,5,50,0,0,0,0,0<br />
UseBackground=false<br />
UserCompletion=false<br />
UserList=true<br />
<br />
[X-:*-Core]<br />
AllowNullPasswd=true<br />
AllowRootLogin=true<br />
AllowShutdown=All<br />
NoPassEnable=false<br />
NoPassUsers=<br />
<br />
[X-:*-Greeter]<br />
AllowClose=true<br />
DefaultUser=glenn<br />
FocusPasswd=true<br />
LoginMode=DefaultLocal<br />
PreselectUser=Previous<br />
<br />
[X-:0-Core]<br />
AutoLoginAgain=false<br />
AutoLoginDelay=0<br />
AutoLoginEnable=false<br />
AutoLoginLocked=false<br />
AutoLoginUser=glenn<br />
ClientLogFile=.xsession-errors<br />
ServerArgsLocal=-nolisten tcp -layout seat0 -sharevts -novtswitch <br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch <br />
<br />
[Xdmcp]<br />
Enable=false<br />
Willing=/opt/kde/share/config/kdm/Xwilling<br />
Xaccess=/opt/kde/share/config/kdm/Xaccess<br />
}}<br />
<br />
==Related problems==<br />
<br />
===PulseAudio===<br />
If two users want to use the sound card simultaneously, it is necessary to use a sound server, [[PulseAudio]] being most prevalent. Usually, the PulseAudio server runs only for active user and does not allow for multiple user instances. Solution to this problem is using the system-wide PulseAudio server. Although this approach is discouraged by its authors, it is probably most applicable setup.<br />
<br />
;Configuring for system-wide PulseAudio<br />
* Create user pulse and put him into group audio (PulseAudio drops root privileges and changes to user pulse. Group membership allows for device access.)<br />
* Create group pulse-access and put users, who will play sound locally into it (Group membership is used for access control for local access to PA daemon.)<br />
* In /etc/pulse/default.pa state explicitly the access rights<br />
{{bc|1=<br />
load-module module-native-protocol-unix auth-group=pulse-access auth-group-enable=1<br />
}}<br />
<br />
Start PA as system-wide, under root: {{bc|pulseaudio --system}}<br />
<br />
In {{ic|/var/run/pulse}} should appear files for communication with daemon, namely pid and native. <br />
<br />
;User access<br />
You can check communication with system daemon as non-root by e.g. {{ic|pactl -s "unix:/var/run/pulse/native" list}}.<br />
<br />
It is possible to enable automatic connection to local daemon in /etc/pulse/client.conf<br />
{{bc|1=<br />
auto-connect-localhost = yes<br />
}}<br />
<br />
The users should be able to connect to PA server. All the cons for system-wide daemon become essentially pros, e.g. ability to control volume of other users streams in pavucontrol.<br />
<br />
;Troubleshooting<br />
It is possible to enable the http interface to PA for debugging in /etc/pulse/default.pa<br />
{{ic|load-module module-http-protocol-tcp}} and then connect to it at http://localhost:4714/<br />
<br />
==See also==<br />
*[https://bbs.archlinux.org/viewtopic.php?id=105450 The original Arch Forums thread].<br />
<br />
*The arckwiki page [[Multi-pointer X]] explains how to setup two separate pair of devices on the same session.</div>Shillshockedhttps://wiki.archlinux.org/index.php?title=Talk:Xorg_multiseat&diff=297075Talk:Xorg multiseat2014-02-13T01:32:26Z<p>Shillshocked: </p>
<hr />
<div>Hello. Thank you for this page.<br />
* Could you explain the differences if one uses one video card? Some computers have just one PCI-e slot.<br />
* We (''Fiable.biz'') use Mandriva Linux 2009 Spring, and there is no ~/.xinitrc .<br />
* What is the equivalent of "twm" to launch kde?<br />
* Where do you launch startx? <br/><br />
--[[User:Fiable.biz|Fiable.biz]] 11:02, 3 October 2009 (EDT)<br />
<br />
* We can use one video card, but it's a more complicated setup. Xephyr is not necessary but I haven't successfully done this in Linux yet. I do know somebody who sells computers configured this way. I think he uses multiple X-servers but they are separate so they can run graphics acceleration and GL extensions, etc. I'd like to investigate this more and if anybody could contribute it would help.<br />
--[[User:Shillshocked|Shillshocked]] 20:31, 13 February 2014 (EDT)</div>Shillshockedhttps://wiki.archlinux.org/index.php?title=Xorg_multiseat&diff=297074Xorg multiseat2014-02-13T01:25:42Z<p>Shillshocked: Request for expansion</p>
<hr />
<div>{{Expansion|Show how PulseAudio can be configured for multiple users without running PulseAudio system-wide. Explain how Multiseat be done using only one video card/X Server and without Xephyr.}}<br />
<br />
[[Category:X Server]]<br />
Multiseat is a certain setup where multiple users work simultaneously on one computer. This is achieved by having two monitors, two keyboards and two mice. The advantages are quite obvious:<br />
* Less power consumption (only one computer)<br />
* Less hardware to purchase<br />
* All the cool kids do it<br />
<br />
==Requirements==<br />
<br />
===Keyboards and mice===<br />
<br />
Any standard PS/2 or USB keyboards will suffice. Same thing for mice.<br />
<br />
===Graphics hardware===<br />
<br />
For the best possible result you'll need two graphics cards. I used an nVidia FX5500 AGP and an nVidia 6200 PCI. If you look around a bit you can certainly find new and decent PCI graphics card for a soft price.<br />
<br />
It is possible to use only one videocard which has dual heads (like most nvidia cards will have), but this has some limitations: you have to use Xephyr on the second monitor which seems quite a messy solution from what I've read, and for optimal usage both screens need the same resolution.<br />
<br />
If you have two pci-express slots, take advantage of them! That way you'll even be able to play two games at the same time. (PCI is too slow to play comfortably)<br />
<br />
===Processors and memory===<br />
<br />
If you really are working with two users on the same computer, I'd at least recommend a dual-core processor and plenty of RAM. A fast hard drive (10.000 RPM or higher) is also recommended for comfortable use.<br />
<br />
===Software===<br />
<br />
You'll need Xorg with the drivers for your graphics card (according to some sources, the closed source nvidia driver works better than the open source nv driver for this, I have t tested this myself) and the evdev (xf86-input-evdev) driver. That's all. All this can be found in the Arch Linux core and extra repositories.<br />
<br />
===Some X knowledge===<br />
<br />
If you know how X works this will be a lot easier. Before you start, I recommend generating a clean configuration with xorgconfig that works with a single screen. Read through this xorg configuration and make yourself familiar. And as usual the manpages will provide you with most of the answers. You may reference some man pages: xorg, xserver, startx, xdm, xinit.<br />
'''sudo X -configure''', '''X -showopts''' may give you some hint.<br />
<br />
==Definitions==<br />
<br />
For this article to be clear, I'll be using the following definitions:<br />
* screen: A screen is something Xorg can display its stuff on. A screen has a monitor and a graphics card assigned to it.<br />
* monitor: A physical monitor like the one you're now sitting in front of.<br />
* server layout: a definition of which screen, keyboard and mouse to use.<br />
* seat: A workplace with a physical monitor, physical keyboard and physical mouse.<br />
<br />
==Tips and tricks==<br />
<br />
* Set up ssh on your computer, so you can ssh to the machine from another computer (such as a laptop). This is very useful because you'll probably run into X not responding anymore or not giving you picture at all.<br />
* Finding out which keyboard and mouse is which: open a terminal and use cat to find out. For example, {{ic|cat /dev/input/mouse1}}. If you then move your mouse and you see all weird things happening than that is the mouse you're moving. Same goes for keyboards, which are called eventN.<br />
* Try a basic configuration first. Don't start with the fancy stuff yet, get a very basic Xorg working first.<br />
* Leave your {{ic|xorg.conf}} alone and create a new file, called {{ic|xorg.conf.multiseat}} in {{ic|/etc/X11}} to store your new multiseat configuration. After this configuration is working you can overwrite the {{ic|xorg.conf}} file with your new {{ic|xorg.conf.multiseat}}.<br />
* Create a backup of all relevant configuration files. What do you mean you'll skip this one?<br />
* Take a look at the full configuration I used at the end of this article before you start.<br />
<br />
==About evdev==<br />
<br />
evdev is an Xorg driver which can make use of the kernel event devices, which you can find in {{ic|/dev/input}}.<br />
<br />
==Setting up Xorg==<br />
<br />
The logic behind this is that you have two server layouts, each assigned with their own keyboard, mouse, video card and monitor. <br />
<br />
===The basics===<br />
<br />
First of all we'll set up the basics for xorg.<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "AllowMouseOpenFail" "on"<br />
Option "AllowEmptyInput" "on"<br />
Option "ZapWarning" "on"<br />
Option "HandleSpecialKeys" "off" # Zapping on<br />
Option "DRI2" "on"<br />
Option "Xinerama" "off"<br />
EndSection<br />
}}<br />
<br />
===Defining available input devices===<br />
<br />
This part of the configuration tells Xorg which input devices it has available. Input devices are keyboards and mice, but can also be, for example, touchscreens and pens.<br />
<br />
This section defines my first keyboard, called keyboard0. As you can seen it uses the evdev driver. {{ic|/dev/input/event1}} corresponds with the keyboard connected to the PS/2 port of my computer. Create a section like this for each keyboard you have. Don't forget to modify the identifier of course. Keep the identifier simple and match it with the other names. This keyboard0 will be used for screen0 together with mouse0.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
# Option "Device" "/dev/input/by-path/platform-i8042-serio-0-event-kbd" <br />
# Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-kbd"<br />
Option "xkb_rules" "evdev"<br />
Option "xkb_model" "evdev"<br />
Option "xkb_layout" "us"<br />
Option "GrabDevice" "on" # prevent send event to other X-servers<br />
# If you are using a non en_US keyboard, set the layout here.<br />
# Option "XkbLayout" "be"<br />
EndSection<br />
}}<br />
<br />
<br />
This section defines my first mouse, called mouse0. This uses the regular mouse driver. /dev/input/mouse2 corresponds with the mouse connected to the PS/2 port of my computer. Create a section like this for each mouse you have.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse2"<br />
EndSection<br />
# or use evdev, that could assign by id<br />
Section "InputDevice"<br />
Identifier "Mouse0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
}}<br />
<br />
===Graphics card===<br />
<br />
Now we'll set up the graphics card for each screen.<br />
<br />
{{bc|<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "NoLogo" "1" # Remove nvidia branding at startup<br />
BusId "PCI:1:0:0"<br />
Option "ProbeAllGpus" "false" # Only required for nvidia<br />
EndSection<br />
}}<br />
<br />
This section defines my first graphics card, called nvidia0. This uses the closed source nvidia driver. Take a close look at the BusID. This option specifies which hardware card to use. You can find out the BusId's with lspci. However, you'll soon find out this doesn't always match. That's because lspci displays the device address in hexadecimal form. Xorg however uses decimal form. So you'll need to convert your address from hexadecimal form to decimal. Thus a device address of 0:0a:0 in lspci would become 0:10:0 in {{ic|xorg.conf}}.<br />
<br />
Create a section like this for every graphics card you have.<br />
<br />
===Screens===<br />
<br />
This section defines my first screen, called screen0. Pay close attention to the "monitor" option. For easy recognition I called it the model of my monitor.<br />
<br />
{{bc|<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
}}<br />
<br />
Create a section like this for every screen you have.<br />
<br />
===Monitors===<br />
<br />
This section defines my first monitor, l1730s. Pay close attention to the identifier.<br />
<br />
{{bc|<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
}}<br />
<br />
Create section like this for every monitor you have.<br />
<br />
===Serverlayout===<br />
<br />
Here's the fun stuff. This is how everything is added up. This is my first seat, called seat0. Here I tell Xorg for the server layout called "seat0" to use my screen0, which is attached to nvidia0, using keyboard0 and mouse0.<br />
<br />
The AutoAddDevices option is now needed to keep HAL from automatically adding all your input devices to all the X servers.<br />
<br />
{{bc|<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "Clone" "off"<br />
Option "AutoAddDevices" "off"<br />
Option "DisableModInDev" "true"<br />
Option "SingleCard" "on" # use this to simplfied isolatedevice option <br />
EndSection<br />
}}<br />
<br />
Create a section like this for every seat you have with their respective keyboards, mice and screens.<br />
<br />
==Testing==<br />
Before we start modifying our login manager, we'll first start with testing out the individual seats. If these are working, then we're good to go.<br />
<br />
I've used twm (tiny window manager) to test out if my seats work, but there's no reason you can't use KDE, gnome, or any other desktop environment or window manager. I've used this in my {{ic|~/.xinitrc}}:<br />
exec twm<br />
<br />
Use the following command to test out an individual seat:<br />
startx -- -layout seat0 -config xorg.conf.multiseat<br />
<br />
Do this for every seat you have. If they are all working correctly and the keyboard/mouse combination matches, then congratulations! You are almost finished! In case you are wondering why I didn't you use the full path to my new configuration file, that's because X doesn't allow that when running as non-root. It will search for xorg.conf.multiseat relative to {{ic|/etc/X11}}.<br />
<br />
==Setting up the loginmanager==<br />
<br />
===For KDM (KDE's Display Manager)===<br />
<br />
Open {{ic|/usr/share/config/kdm/kdmrc}} and set the following variables:<br />
<br />
{{bc|1=<br />
StaticServers=:0,:1 #In the case of two seats. If you have three this would become :0,:1,:2 and so forth.<br />
ReserveServers=:2,:3 #You can define here as many as you want, but these should always start at the highest seat + 1.<br />
}}<br />
Next you'll need to add an [X-:n-Core] for each seat (where n = the seat)<br />
{{bc|1=<br />
[X-:0-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat0<br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch<br />
}}<br />
<br />
Add section like this for every seat you have, and do not forget to change the :0 and the -layout seat0. Note that the "-sharevts" and "-novtswitch" options should be added for all seats ''except'' the first one. Otherwise, you can end with rectangles of virtual terminals "showing through" on your primary screen.<br />
<br />
===For GDM (Gnome's Display Manager)===<br />
{{note|The following will work with GDM 2.20 but not with newer versions of GDM. GDM 2.20 is in AUR.}}<br />
<br />
Open {{ic|/etc/gdm/custom.conf}} and set the following variables (This sample demos two seats):<br />
{{bc|1=<br />
[servers]<br />
0=Standard0<br />
1=Standard1<br />
<br />
[server-Standard0]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat0<br />
flexible=true<br />
<br />
[server-Standard1]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat1<br />
flexible=true<br />
}}<br />
<br />
===For XDM (X Display Manager)===<br />
<br />
Open {{ic|/etc/X11/xdm/Xservers}} and set the following variables (This sample demos two seats):<br />
<br />
{{bc|<br />
# NOTE: don't add -sharevts on seat0, otherwise it may reset in about 10~20 minutes automatically.<br />
:0 local /usr/bin/X :0 vt07 -nolisten tcp -novtswitch -layout seat0 -config xorg.conf.multiseat<br />
:1 local /usr/bin/X :1 vt08 -nolisten tcp -sharevts -novtswitch -layout seat1 -config xorg.conf.multiseat<br />
}}<br />
<br />
Also if you use the Archlinux theme edit {{ic|/etc/X11/xdm/xdm-config}} for every screen:<br />
<br />
{{bc|<br />
DisplayManager._0.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._0.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._0.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
DisplayManager._1.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._1.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._1.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
}}<br />
<br />
===For LightDM (Light Display Manager)===<br />
<br />
LightDM works well with ALSA only and PulseAudio removed if you wish to have shared audio, an alsamixer equalizer and software mixing.<br />
<br />
In the example below LightDM and MATE with ALSA was installed with PulseAudio removed. PulseAudio could also be used but it requires a more complicated configuration to maintain high audio quality. The relevant hardware used is an ATI Radeon HD 5850 and an Intel Sandy Bridge (onboard) HD 3000. You configuration may vary.<br />
<br />
Open {{ic|/etc/lightdm/lightdm.conf}} and follow the sample. Autologin is optional. This works both as multi-user multiseat and single user multi-seat. In the former case only the last user to login will have audio control and access. Specific hardware could be addressed in {{ic|/etc/asound.conf}} to allocate audio to both users simultaneously if required. In the latter case the sound card will be shared equally among the seats using ALSA with PulseAudio removed - libpulse itself should be kept for various software dependencies however:<br />
<br />
{{bc|1=<br />
[LightDM]<br />
greeter-user=lightdm<br />
log-directory=/var/log/lightdm<br />
run-directory=/run/lightdm<br />
<br />
[SeatDefaults]<br />
xserver-command=/usr/bin/X<br />
greeter-session=lightdm-gtk-greeter<br />
greeter-show-manual-login=true<br />
user-session=mate<br />
session-wrapper=/etc/lightdm/Xsession<br />
pam-service=lightdm-autologin<br />
exit-on-failure=true<br />
<br />
[Seat:0]<br />
xserver-command=/usr/bin/X :0 -sharevts<br />
xserver-layout=Layout0<br />
#autologin-user=joeblow<br />
#autologin-user-timeout=-1<br />
#session-setup-script=/etc/lightdm/scripts/sound_start<br />
#session-cleanup-script=/etc/lightdm/scripts/sound_stop<br />
<br />
[Seat:1]<br />
xserver-command=/usr/bin/X :1 -sharevts<br />
xserver-layout=Layout1<br />
#autologin-user=jillschmill<br />
#autologin-user-timeout=-1<br />
}}<br />
<br />
Next, remove respective {{ic|~/.asoundrc}} files (as well as related PulseAudio config files if you removed that) and follow this template with {{ic|/etc/asound.conf}} for sound:<br />
<br />
{{bc|<br />
defaults.pcm.rate_converter "samplerate_best"<br />
<br />
ctl.equal {<br />
type equal;<br />
}<br />
<br />
pcm.plugequal {<br />
type equal;<br />
# Modify the line below if you do not<br />
# want to use sound card 0.<br />
#slave.pcm "plughw:0,0";<br />
#by default we want to play from more sources at time:<br />
slave.pcm "plug:dmix";<br />
}<br />
#pcm.equal {<br />
# If you do not want the equalizer to be your<br />
# default soundcard comment the following<br />
# line and uncomment the above line. (You can<br />
# choose it as the output device by addressing<br />
# it with specific apps,eg mpg123 -a equal 06.Back_In_Black.mp3)<br />
pcm.!default {<br />
type plug;<br />
slave.pcm plugequal;<br />
}<br />
}}<br />
<br />
Finally you must set the {{ic|/etc/X11/xorg.conf}} file. You'll notice some options have been commented out which could be set according to your needs. Here is a sample, adjust to your own system configuration after determing hardware information:<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "DefaultServerLayout" "Layout1"<br />
# Option "AllowMouseOpenFail" "true"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "DontZap" "false"<br />
Option "Xinerama" "0"<br />
Option "AutoAddGPU" "FALSE"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "kbd_0" "CoreKeyboard"<br />
InputDevice "mouse_0" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true" <br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout1"<br />
Screen 0 "Screen1" 0 0<br />
InputDevice "kbd_1" "CoreKeyboard"<br />
InputDevice "mouse_1" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true"<br />
EndSection<br />
<br />
Section "Module"<br />
# Load "dri2"<br />
# Load "glamoregl"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.6:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:04:00.0-usb-0:1:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.5:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.3:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
# Option "DPMS" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "radeon"<br />
# Option "AccelMethod" "glamor"<br />
Option "AccelMethod" "EXA"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:1:0:0"<br />
Screen 0<br />
# Option "EXAVSync"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device1"<br />
Driver "intel"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:0:2:0"<br />
Screen 0<br />
# Option "AccelMethod" "UXA"<br />
# Option "TearFree" "1"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Device0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen1"<br />
Device "Device1"<br />
Monitor "Monitor1"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
Make sure to delete the {{ic|~/.Xauthority}} file in respective user directories before the initial reboot.<br />
<br />
===For Auto Login multiseat (without Display Manager)===<br />
<br />
edit a script /boot/twin.sh<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
cmd1="/bin/bash --login -c \"/usr/bin/xinit --"<br />
cmd2="-nolisten tcp -keeptty -novtswitch -config xorg.multiseat.conf"<br />
usr=(user1 user2) # FIXME: assume user1, user2 is valid user id<br />
declare -a pid<br />
while true ; do<br />
for ((i=0; i<${#usr[*]}; i++)) ; do<br />
echo "usr[$i]=${usr[$i]} pid=${pid[$i]}"<br />
if [ -z "${pid[$i]}" ] || [ ! -d "/proc/${pid[$i]}" ] ; then<br />
# echo "pid ${pid[$i]} killed, execute again" <br />
cmd3="-layout seat$i vt0"$((7+i))"\""<br />
if [ $i -gt 0 ] ; then<br />
cmd3="-sharevts $cmd3"<br />
fi<br />
#echo "cmd3=$cmd3"<br />
/bin/su ${usr[$i]} -l -c "$cmd1 :$i $cmd2 $cmd3" &<br />
pid[$i]=$!<br />
#echo "new pid=${pid[$i]}"<br />
fi<br />
done<br />
sleep 5 # check process exist per 5 second<br />
done<br />
</nowiki>}}<br />
<br />
Open {{ic|/etc/inittab}} and setup as follows:<br />
<br />
{{bc|<br />
#id:3:initdefault:<br />
id:5:initdefault:<br />
...<br />
x2:5:once:/root/twin.sh > /root/twin.log 2>&1<br />
}}<br />
<br />
==Troubleshooting==<br />
<br />
===My Windows key doesn't work anymore===<br />
<br />
Put this in [[Execute commands after X start|a startup file]]:<br />
xmodmap -e "add Mod4 = Super_L Super_R"<br />
<br />
===Unreliable behaviour (black picture without cursor)===<br />
<br />
If everything seems to be set up correctly, but for some reason you always get a black picture without a cursor, try setting the first initialized card in the BIOS to be the PCI card one.<br />
<br />
===Little black boxes/dots on the desktop===<br />
<br />
This is actually portions of the virtual terminals being painted on top of X. It seems to be caused by the Linux kernel framebuffer. This can be fixed by disabling the framebuffer, or by removing the "-sharevts" option from the primary seat's X args.<br />
<br />
===Multimedia keys not working===<br />
<br />
If your keyboard(s) has extra "multimedia" keys, you may find that they stopped working in your multiseat setup. This is because such keyboards are often represented as more then one "event" device. As you did above, cat each /dev/input/event* device, this time pressing multimedia keys. Once you've found the right event device, add a separate keyboard InputDevice section for it, then add that InputDevice section to the corresponding ServerLayout section with the "SendCoreEvents" option, which indicates that input from this device should be handled, despite not being the core keyboard. In the end you should have sections something like the following:<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "Keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event6"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "Keyboard0Multimedia"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event7"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "Keyboard0" "CoreKeyboard"<br />
InputDevice "Keyboard0Multimedia" "SendCoreEvents"<br />
InputDevice "Mouse0" "CorePointer"<br />
Option "AutoAddDevices" "no"<br />
EndSection<br />
}}<br />
<br />
===The Ctrl-Alt-Fx, Alt-Fx keys mess up with virtual terminals===<br />
<br />
(Oct 2010) I follows this guide and everything works, except for Atl-F1, Atl-F2,... mess things up. Then I follow this guide https://help.ubuntu.com/community/MultiseatX (read the part for Ubuntu 10.04):<br />
<br />
{{bc|<br />
# cd /usr/bin<br />
# ln -s X X0<br />
# ln -s X X1<br />
}}<br />
<br />
Then fix in the '''/usr/share/config/kdm/kdmrc''' as follow<br />
<br />
{{bc|1=<br />
[General]<br />
ConsoleTTYs=tty1,tty2,tty3,tty4,tty5,tty6<br />
ServerVTs=7,8<br />
StaticServers=:0,:1<br />
ReserveServers=:2,:3<br />
...<br />
<br />
[X-:0-Core]<br />
ServerVT=8<br />
ServerCmd=/usr/bin/X1<br />
ServerArgsLocal=-nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0<br />
<br />
[X-:1-Core]<br />
ServerVT=7<br />
ServerCmd=/usr/bin/X0<br />
ServerArgsLocal=-nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0<br />
...<br />
}}<br />
<br />
It works for my computer: one on-board Intel card (xf86-video-intel driver), and one Nvidia card (xf86-video-nouveau driver). You can check if the parameters are passed correctly by:<br />
<br />
{{bc|<nowiki><br />
$ ps aux | grep 'PCI' | grep -Ev 'grep'<br />
root 16993 1.6 1.3 32900 26772 ? S 08:09 0:19 /usr/bin/X0 :1 vt7 -nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0 -auth /var/run/xauth/A:1-ES6CCb<br />
root 17124 5.9 0.5 18996 11980 ? S 08:09 1:09 /usr/bin/X1 :0 vt8 -nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0 -auth /var/run/xauth/A:0-Wgiyza<br />
<br />
</nowiki>}}<br />
<br />
The '''ServerVT=7''', '''ServerVT=8''' would be pass to as '''vt7''', '''vt8'''<br />
<br />
==Final configuration==<br />
<br />
===/etc/X11/xorg.conf===<br />
<br />
This is my full xorg.conf with multiseat that works:<br />
{{bc|<br />
Section "Module"<br />
Load "dbe"<br />
<br />
SubSection "extmod"<br />
Option "omit xfree86-dga"<br />
EndSubSection<br />
<br />
Load "type1"<br />
Load "speedo"<br />
Load "freetype"<br />
Load "glx"<br />
EndSection<br />
<br />
<br />
Section "Files"<br />
RgbPath "/usr/share/X11/rgb"<br />
<br />
FontPath "/usr/share/fonts/misc"<br />
FontPath "/usr/share/fonts/75dpi"<br />
FontPath "/usr/share/fonts/100dpi"<br />
FontPath "/usr/share/fonts/TTF"<br />
FontPath "/usr/share/fonts/Type1"<br />
FontPath "/usr/share/fonts/msfonts"<br />
FontPath "/usr/share/fonts/misc2"<br />
FontPath "/usr/share/fonts/local"<br />
FontPath "/usr/local/share/fonts"<br />
EndSection<br />
<br />
<br />
Section "ServerFlags"<br />
# Option "DontZap"<br />
Option "AllowMouseOpenFail" "true"<br />
# Option "DefaultServerLayout" "alltogether"<br />
Option "Xinerama" "0"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event5"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2" # Auto detect<br />
Option "Device" "/dev/input/mouse2"<br />
Option "ZAxisMapping" "4 5"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse1"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse1"<br />
EndSection<br />
<br />
<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:1:0:0"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "nvidia1"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:0:10:0"<br />
EndSection<br />
<br />
<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "screen1"<br />
Device "nvidia1"<br />
Monitor "cpdm151"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1024x768" "800x600"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat1"<br />
Screen "screen1" 0 0<br />
InputDevice "mouse1" "CorePointer"<br />
InputDevice "keyboard1" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "Extensions"<br />
Option "Composite" "Disable"<br />
Option "RENDER" "Enable"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "cpdm151"<br />
Option "dpms"<br />
HorizSync 30-61<br />
VertRefresh 60<br />
EndSection<br />
}}<br />
<br />
===/opt/kde/share/config/kdm/kdmrc===<br />
<br />
This is my kdmrc:<br />
<br />
{{bc|1=<br />
[General]<br />
ConfigVersion=2.3<br />
ConsoleTTYs=vc/1,vc/2,vc/3,vc/4,vc/5,vc/6<br />
PidFile=/var/run/kdm.pid<br />
ReserveServers=:2,:3<br />
ServerVTs=-7<br />
StaticServers=:0,:1<br />
<br />
[Shutdown]<br />
BootManager=Grub<br />
HaltCmd=/sbin/halt<br />
RebootCmd=/sbin/reboot<br />
<br />
[X-*-Core]<br />
AllowNullPasswd=false<br />
AllowRootLogin=false<br />
AllowShutdown=Root<br />
Authorize=true<br />
AutoReLogin=false<br />
ClientLogFile=.xsession-errors-%s<br />
Reset=/opt/kde/share/config/kdm/Xreset<br />
Resources=/opt/kde/share/config/kdm/Xresources<br />
Session=/opt/kde/share/config/kdm/Xsession<br />
SessionsDirs=/etc/X11/sessions,/usr/share/xsessions,/opt/kde/share/apps/kdm/sessions<br />
Setup=/opt/kde/share/config/kdm/Xsetup<br />
Startup=/opt/kde/share/config/kdm/Xstartup<br />
<br />
[X-*-Greeter]<br />
AllowConsole=true<br />
AntiAliasing=true<br />
AuthComplain=true<br />
BackgroundCfg=/opt/kde/share/config/kdm/backgroundrc<br />
ColorScheme=<br />
DefaultUser=<br />
EchoMode=OneStar<br />
FaceSource=PreferUser<br />
FailFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
FocusPasswd=false<br />
ForgingSeed=1097313140<br />
GUIStyle=<br />
GreetFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
GreetString=Arch Linux %r (%h)<br />
GreeterPos=50,50<br />
HiddenUsers=root<br />
Language=en_US<br />
LogoArea=None<br />
LogoPixmap=<br />
MaxShowUID=65000<br />
MinShowUID=500<br />
PreselectUser=None<br />
SelectedUsers=<br />
ShowUsers=NotHidden<br />
SortUsers=true<br />
StdFont=Tahoma,11,-1,5,50,0,0,0,0,0<br />
UseBackground=false<br />
UserCompletion=false<br />
UserList=true<br />
<br />
[X-:*-Core]<br />
AllowNullPasswd=true<br />
AllowRootLogin=true<br />
AllowShutdown=All<br />
NoPassEnable=false<br />
NoPassUsers=<br />
<br />
[X-:*-Greeter]<br />
AllowClose=true<br />
DefaultUser=glenn<br />
FocusPasswd=true<br />
LoginMode=DefaultLocal<br />
PreselectUser=Previous<br />
<br />
[X-:0-Core]<br />
AutoLoginAgain=false<br />
AutoLoginDelay=0<br />
AutoLoginEnable=false<br />
AutoLoginLocked=false<br />
AutoLoginUser=glenn<br />
ClientLogFile=.xsession-errors<br />
ServerArgsLocal=-nolisten tcp -layout seat0 -sharevts -novtswitch <br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch <br />
<br />
[Xdmcp]<br />
Enable=false<br />
Willing=/opt/kde/share/config/kdm/Xwilling<br />
Xaccess=/opt/kde/share/config/kdm/Xaccess<br />
}}<br />
<br />
==Related problems==<br />
<br />
===PulseAudio===<br />
If two users want to use the sound card simultaneously, it is necessary to use a sound server, [[PulseAudio]] being most prevalent. Usually, the PulseAudio server runs only for active user and does not allow for multiple user instances. Solution to this problem is using the system-wide PulseAudio server. Although this approach is discouraged by its authors, it is probably most applicable setup.<br />
<br />
;Configuring for system-wide PulseAudio<br />
* Create user pulse and put him into group audio (PulseAudio drops root privileges and changes to user pulse. Group membership allows for device access.)<br />
* Create group pulse-access and put users, who will play sound locally into it (Group membership is used for access control for local access to PA daemon.)<br />
* In /etc/pulse/default.pa state explicitly the access rights<br />
{{bc|1=<br />
load-module module-native-protocol-unix auth-group=pulse-access auth-group-enable=1<br />
}}<br />
<br />
Start PA as system-wide, under root: {{bc|pulseaudio --system}}<br />
<br />
In {{ic|/var/run/pulse}} should appear files for communication with daemon, namely pid and native. <br />
<br />
;User access<br />
You can check communication with system daemon as non-root by e.g. {{ic|pactl -s "unix:/var/run/pulse/native" list}}.<br />
<br />
It is possible to enable automatic connection to local daemon in /etc/pulse/client.conf<br />
{{bc|1=<br />
auto-connect-localhost = yes<br />
}}<br />
<br />
The users should be able to connect to PA server. All the cons for system-wide daemon become essentially pros, e.g. ability to control volume of other users streams in pavucontrol.<br />
<br />
;Troubleshooting<br />
It is possible to enable the http interface to PA for debugging in /etc/pulse/default.pa<br />
{{ic|load-module module-http-protocol-tcp}} and then connect to it at http://localhost:4714/<br />
<br />
==See also==<br />
*[https://bbs.archlinux.org/viewtopic.php?id=105450 The original Arch Forums thread].<br />
<br />
*The arckwiki page [[Multi-pointer X]] explains how to setup two separate pair of devices on the same session.</div>Shillshockedhttps://wiki.archlinux.org/index.php?title=Xorg_multiseat&diff=297073Xorg multiseat2014-02-13T01:15:35Z<p>Shillshocked: /* For LightDM (Light Display Manager) */</p>
<hr />
<div>[[Category:X Server]]<br />
Multiseat is a certain setup where multiple users work simultaneously on one computer. This is achieved by having two monitors, two keyboards and two mice. The advantages are quite obvious:<br />
* Less power consumption (only one computer)<br />
* Less hardware to purchase<br />
* All the cool kids do it<br />
<br />
==Requirements==<br />
<br />
===Keyboards and mice===<br />
<br />
Any standard PS/2 or USB keyboards will suffice. Same thing for mice.<br />
<br />
===Graphics hardware===<br />
<br />
For the best possible result you'll need two graphics cards. I used an nVidia FX5500 AGP and an nVidia 6200 PCI. If you look around a bit you can certainly find new and decent PCI graphics card for a soft price.<br />
<br />
It is possible to use only one videocard which has dual heads (like most nvidia cards will have), but this has some limitations: you have to use Xephyr on the second monitor which seems quite a messy solution from what I've read, and for optimal usage both screens need the same resolution.<br />
<br />
If you have two pci-express slots, take advantage of them! That way you'll even be able to play two games at the same time. (PCI is too slow to play comfortably)<br />
<br />
===Processors and memory===<br />
<br />
If you really are working with two users on the same computer, I'd at least recommend a dual-core processor and plenty of RAM. A fast hard drive (10.000 RPM or higher) is also recommended for comfortable use.<br />
<br />
===Software===<br />
<br />
You'll need Xorg with the drivers for your graphics card (according to some sources, the closed source nvidia driver works better than the open source nv driver for this, I have t tested this myself) and the evdev (xf86-input-evdev) driver. That's all. All this can be found in the Arch Linux core and extra repositories.<br />
<br />
===Some X knowledge===<br />
<br />
If you know how X works this will be a lot easier. Before you start, I recommend generating a clean configuration with xorgconfig that works with a single screen. Read through this xorg configuration and make yourself familiar. And as usual the manpages will provide you with most of the answers. You may reference some man pages: xorg, xserver, startx, xdm, xinit.<br />
'''sudo X -configure''', '''X -showopts''' may give you some hint.<br />
<br />
==Definitions==<br />
<br />
For this article to be clear, I'll be using the following definitions:<br />
* screen: A screen is something Xorg can display its stuff on. A screen has a monitor and a graphics card assigned to it.<br />
* monitor: A physical monitor like the one you're now sitting in front of.<br />
* server layout: a definition of which screen, keyboard and mouse to use.<br />
* seat: A workplace with a physical monitor, physical keyboard and physical mouse.<br />
<br />
==Tips and tricks==<br />
<br />
* Set up ssh on your computer, so you can ssh to the machine from another computer (such as a laptop). This is very useful because you'll probably run into X not responding anymore or not giving you picture at all.<br />
* Finding out which keyboard and mouse is which: open a terminal and use cat to find out. For example, {{ic|cat /dev/input/mouse1}}. If you then move your mouse and you see all weird things happening than that is the mouse you're moving. Same goes for keyboards, which are called eventN.<br />
* Try a basic configuration first. Don't start with the fancy stuff yet, get a very basic Xorg working first.<br />
* Leave your {{ic|xorg.conf}} alone and create a new file, called {{ic|xorg.conf.multiseat}} in {{ic|/etc/X11}} to store your new multiseat configuration. After this configuration is working you can overwrite the {{ic|xorg.conf}} file with your new {{ic|xorg.conf.multiseat}}.<br />
* Create a backup of all relevant configuration files. What do you mean you'll skip this one?<br />
* Take a look at the full configuration I used at the end of this article before you start.<br />
<br />
==About evdev==<br />
<br />
evdev is an Xorg driver which can make use of the kernel event devices, which you can find in {{ic|/dev/input}}.<br />
<br />
==Setting up Xorg==<br />
<br />
The logic behind this is that you have two server layouts, each assigned with their own keyboard, mouse, video card and monitor. <br />
<br />
===The basics===<br />
<br />
First of all we'll set up the basics for xorg.<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "AllowMouseOpenFail" "on"<br />
Option "AllowEmptyInput" "on"<br />
Option "ZapWarning" "on"<br />
Option "HandleSpecialKeys" "off" # Zapping on<br />
Option "DRI2" "on"<br />
Option "Xinerama" "off"<br />
EndSection<br />
}}<br />
<br />
===Defining available input devices===<br />
<br />
This part of the configuration tells Xorg which input devices it has available. Input devices are keyboards and mice, but can also be, for example, touchscreens and pens.<br />
<br />
This section defines my first keyboard, called keyboard0. As you can seen it uses the evdev driver. {{ic|/dev/input/event1}} corresponds with the keyboard connected to the PS/2 port of my computer. Create a section like this for each keyboard you have. Don't forget to modify the identifier of course. Keep the identifier simple and match it with the other names. This keyboard0 will be used for screen0 together with mouse0.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
# Option "Device" "/dev/input/by-path/platform-i8042-serio-0-event-kbd" <br />
# Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-kbd"<br />
Option "xkb_rules" "evdev"<br />
Option "xkb_model" "evdev"<br />
Option "xkb_layout" "us"<br />
Option "GrabDevice" "on" # prevent send event to other X-servers<br />
# If you are using a non en_US keyboard, set the layout here.<br />
# Option "XkbLayout" "be"<br />
EndSection<br />
}}<br />
<br />
<br />
This section defines my first mouse, called mouse0. This uses the regular mouse driver. /dev/input/mouse2 corresponds with the mouse connected to the PS/2 port of my computer. Create a section like this for each mouse you have.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse2"<br />
EndSection<br />
# or use evdev, that could assign by id<br />
Section "InputDevice"<br />
Identifier "Mouse0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
}}<br />
<br />
===Graphics card===<br />
<br />
Now we'll set up the graphics card for each screen.<br />
<br />
{{bc|<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "NoLogo" "1" # Remove nvidia branding at startup<br />
BusId "PCI:1:0:0"<br />
Option "ProbeAllGpus" "false" # Only required for nvidia<br />
EndSection<br />
}}<br />
<br />
This section defines my first graphics card, called nvidia0. This uses the closed source nvidia driver. Take a close look at the BusID. This option specifies which hardware card to use. You can find out the BusId's with lspci. However, you'll soon find out this doesn't always match. That's because lspci displays the device address in hexadecimal form. Xorg however uses decimal form. So you'll need to convert your address from hexadecimal form to decimal. Thus a device address of 0:0a:0 in lspci would become 0:10:0 in {{ic|xorg.conf}}.<br />
<br />
Create a section like this for every graphics card you have.<br />
<br />
===Screens===<br />
<br />
This section defines my first screen, called screen0. Pay close attention to the "monitor" option. For easy recognition I called it the model of my monitor.<br />
<br />
{{bc|<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
}}<br />
<br />
Create a section like this for every screen you have.<br />
<br />
===Monitors===<br />
<br />
This section defines my first monitor, l1730s. Pay close attention to the identifier.<br />
<br />
{{bc|<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
}}<br />
<br />
Create section like this for every monitor you have.<br />
<br />
===Serverlayout===<br />
<br />
Here's the fun stuff. This is how everything is added up. This is my first seat, called seat0. Here I tell Xorg for the server layout called "seat0" to use my screen0, which is attached to nvidia0, using keyboard0 and mouse0.<br />
<br />
The AutoAddDevices option is now needed to keep HAL from automatically adding all your input devices to all the X servers.<br />
<br />
{{bc|<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "Clone" "off"<br />
Option "AutoAddDevices" "off"<br />
Option "DisableModInDev" "true"<br />
Option "SingleCard" "on" # use this to simplfied isolatedevice option <br />
EndSection<br />
}}<br />
<br />
Create a section like this for every seat you have with their respective keyboards, mice and screens.<br />
<br />
==Testing==<br />
Before we start modifying our login manager, we'll first start with testing out the individual seats. If these are working, then we're good to go.<br />
<br />
I've used twm (tiny window manager) to test out if my seats work, but there's no reason you can't use KDE, gnome, or any other desktop environment or window manager. I've used this in my {{ic|~/.xinitrc}}:<br />
exec twm<br />
<br />
Use the following command to test out an individual seat:<br />
startx -- -layout seat0 -config xorg.conf.multiseat<br />
<br />
Do this for every seat you have. If they are all working correctly and the keyboard/mouse combination matches, then congratulations! You are almost finished! In case you are wondering why I didn't you use the full path to my new configuration file, that's because X doesn't allow that when running as non-root. It will search for xorg.conf.multiseat relative to {{ic|/etc/X11}}.<br />
<br />
==Setting up the loginmanager==<br />
<br />
===For KDM (KDE's Display Manager)===<br />
<br />
Open {{ic|/usr/share/config/kdm/kdmrc}} and set the following variables:<br />
<br />
{{bc|1=<br />
StaticServers=:0,:1 #In the case of two seats. If you have three this would become :0,:1,:2 and so forth.<br />
ReserveServers=:2,:3 #You can define here as many as you want, but these should always start at the highest seat + 1.<br />
}}<br />
Next you'll need to add an [X-:n-Core] for each seat (where n = the seat)<br />
{{bc|1=<br />
[X-:0-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat0<br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch<br />
}}<br />
<br />
Add section like this for every seat you have, and do not forget to change the :0 and the -layout seat0. Note that the "-sharevts" and "-novtswitch" options should be added for all seats ''except'' the first one. Otherwise, you can end with rectangles of virtual terminals "showing through" on your primary screen.<br />
<br />
===For GDM (Gnome's Display Manager)===<br />
{{note|The following will work with GDM 2.20 but not with newer versions of GDM. GDM 2.20 is in AUR.}}<br />
<br />
Open {{ic|/etc/gdm/custom.conf}} and set the following variables (This sample demos two seats):<br />
{{bc|1=<br />
[servers]<br />
0=Standard0<br />
1=Standard1<br />
<br />
[server-Standard0]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat0<br />
flexible=true<br />
<br />
[server-Standard1]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat1<br />
flexible=true<br />
}}<br />
<br />
===For XDM (X Display Manager)===<br />
<br />
Open {{ic|/etc/X11/xdm/Xservers}} and set the following variables (This sample demos two seats):<br />
<br />
{{bc|<br />
# NOTE: don't add -sharevts on seat0, otherwise it may reset in about 10~20 minutes automatically.<br />
:0 local /usr/bin/X :0 vt07 -nolisten tcp -novtswitch -layout seat0 -config xorg.conf.multiseat<br />
:1 local /usr/bin/X :1 vt08 -nolisten tcp -sharevts -novtswitch -layout seat1 -config xorg.conf.multiseat<br />
}}<br />
<br />
Also if you use the Archlinux theme edit {{ic|/etc/X11/xdm/xdm-config}} for every screen:<br />
<br />
{{bc|<br />
DisplayManager._0.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._0.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._0.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
DisplayManager._1.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._1.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._1.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
}}<br />
<br />
===For LightDM (Light Display Manager)===<br />
<br />
LightDM works well with ALSA only and PulseAudio removed if you wish to have shared audio, an alsamixer equalizer and software mixing.<br />
<br />
In the example below LightDM and MATE with ALSA was installed with PulseAudio removed. PulseAudio could also be used but it requires a more complicated configuration to maintain high audio quality. The relevant hardware used is an ATI Radeon HD 5850 and an Intel Sandy Bridge (onboard) HD 3000. You configuration may vary.<br />
<br />
Open {{ic|/etc/lightdm/lightdm.conf}} and follow the sample. Autologin is optional. This works both as multi-user multiseat and single user multi-seat. In the former case only the last user to login will have audio control and access. Specific hardware could be addressed in {{ic|/etc/asound.conf}} to allocate audio to both users simultaneously if required. In the latter case the sound card will be shared equally among the seats using ALSA with PulseAudio removed - libpulse itself should be kept for various software dependencies however:<br />
<br />
{{bc|1=<br />
[LightDM]<br />
greeter-user=lightdm<br />
log-directory=/var/log/lightdm<br />
run-directory=/run/lightdm<br />
<br />
[SeatDefaults]<br />
xserver-command=/usr/bin/X<br />
greeter-session=lightdm-gtk-greeter<br />
greeter-show-manual-login=true<br />
user-session=mate<br />
session-wrapper=/etc/lightdm/Xsession<br />
pam-service=lightdm-autologin<br />
exit-on-failure=true<br />
<br />
[Seat:0]<br />
xserver-command=/usr/bin/X :0 -sharevts<br />
xserver-layout=Layout0<br />
#autologin-user=joeblow<br />
#autologin-user-timeout=-1<br />
#session-setup-script=/etc/lightdm/scripts/sound_start<br />
#session-cleanup-script=/etc/lightdm/scripts/sound_stop<br />
<br />
[Seat:1]<br />
xserver-command=/usr/bin/X :1 -sharevts<br />
xserver-layout=Layout1<br />
#autologin-user=jillschmill<br />
#autologin-user-timeout=-1<br />
}}<br />
<br />
Next, remove respective {{ic|~/.asoundrc}} files (as well as related PulseAudio config files if you removed that) and follow this template with {{ic|/etc/asound.conf}} for sound:<br />
<br />
{{bc|<br />
defaults.pcm.rate_converter "samplerate_best"<br />
<br />
ctl.equal {<br />
type equal;<br />
}<br />
<br />
pcm.plugequal {<br />
type equal;<br />
# Modify the line below if you do not<br />
# want to use sound card 0.<br />
#slave.pcm "plughw:0,0";<br />
#by default we want to play from more sources at time:<br />
slave.pcm "plug:dmix";<br />
}<br />
#pcm.equal {<br />
# If you do not want the equalizer to be your<br />
# default soundcard comment the following<br />
# line and uncomment the above line. (You can<br />
# choose it as the output device by addressing<br />
# it with specific apps,eg mpg123 -a equal 06.Back_In_Black.mp3)<br />
pcm.!default {<br />
type plug;<br />
slave.pcm plugequal;<br />
}<br />
}}<br />
<br />
Finally you must set the {{ic|/etc/X11/xorg.conf}} file. You'll notice some options have been commented out which could be set according to your needs. Here is a sample, adjust to your own system configuration after determing hardware information:<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "DefaultServerLayout" "Layout1"<br />
# Option "AllowMouseOpenFail" "true"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "DontZap" "false"<br />
Option "Xinerama" "0"<br />
Option "AutoAddGPU" "FALSE"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "kbd_0" "CoreKeyboard"<br />
InputDevice "mouse_0" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true" <br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout1"<br />
Screen 0 "Screen1" 0 0<br />
InputDevice "kbd_1" "CoreKeyboard"<br />
InputDevice "mouse_1" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true"<br />
EndSection<br />
<br />
Section "Module"<br />
# Load "dri2"<br />
# Load "glamoregl"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.6:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:04:00.0-usb-0:1:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.5:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.3:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
# Option "DPMS" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "radeon"<br />
# Option "AccelMethod" "glamor"<br />
Option "AccelMethod" "EXA"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:1:0:0"<br />
Screen 0<br />
# Option "EXAVSync"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device1"<br />
Driver "intel"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:0:2:0"<br />
Screen 0<br />
# Option "AccelMethod" "UXA"<br />
# Option "TearFree" "1"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Device0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen1"<br />
Device "Device1"<br />
Monitor "Monitor1"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
Make sure to delete the {{ic|~/.Xauthority}} file in respective user directories before the initial reboot.<br />
<br />
===For Auto Login multiseat (without Display Manager)===<br />
<br />
edit a script /boot/twin.sh<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
cmd1="/bin/bash --login -c \"/usr/bin/xinit --"<br />
cmd2="-nolisten tcp -keeptty -novtswitch -config xorg.multiseat.conf"<br />
usr=(user1 user2) # FIXME: assume user1, user2 is valid user id<br />
declare -a pid<br />
while true ; do<br />
for ((i=0; i<${#usr[*]}; i++)) ; do<br />
echo "usr[$i]=${usr[$i]} pid=${pid[$i]}"<br />
if [ -z "${pid[$i]}" ] || [ ! -d "/proc/${pid[$i]}" ] ; then<br />
# echo "pid ${pid[$i]} killed, execute again" <br />
cmd3="-layout seat$i vt0"$((7+i))"\""<br />
if [ $i -gt 0 ] ; then<br />
cmd3="-sharevts $cmd3"<br />
fi<br />
#echo "cmd3=$cmd3"<br />
/bin/su ${usr[$i]} -l -c "$cmd1 :$i $cmd2 $cmd3" &<br />
pid[$i]=$!<br />
#echo "new pid=${pid[$i]}"<br />
fi<br />
done<br />
sleep 5 # check process exist per 5 second<br />
done<br />
</nowiki>}}<br />
<br />
Open {{ic|/etc/inittab}} and setup as follows:<br />
<br />
{{bc|<br />
#id:3:initdefault:<br />
id:5:initdefault:<br />
...<br />
x2:5:once:/root/twin.sh > /root/twin.log 2>&1<br />
}}<br />
<br />
==Troubleshooting==<br />
<br />
===My Windows key doesn't work anymore===<br />
<br />
Put this in [[Execute commands after X start|a startup file]]:<br />
xmodmap -e "add Mod4 = Super_L Super_R"<br />
<br />
===Unreliable behaviour (black picture without cursor)===<br />
<br />
If everything seems to be set up correctly, but for some reason you always get a black picture without a cursor, try setting the first initialized card in the BIOS to be the PCI card one.<br />
<br />
===Little black boxes/dots on the desktop===<br />
<br />
This is actually portions of the virtual terminals being painted on top of X. It seems to be caused by the Linux kernel framebuffer. This can be fixed by disabling the framebuffer, or by removing the "-sharevts" option from the primary seat's X args.<br />
<br />
===Multimedia keys not working===<br />
<br />
If your keyboard(s) has extra "multimedia" keys, you may find that they stopped working in your multiseat setup. This is because such keyboards are often represented as more then one "event" device. As you did above, cat each /dev/input/event* device, this time pressing multimedia keys. Once you've found the right event device, add a separate keyboard InputDevice section for it, then add that InputDevice section to the corresponding ServerLayout section with the "SendCoreEvents" option, which indicates that input from this device should be handled, despite not being the core keyboard. In the end you should have sections something like the following:<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "Keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event6"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "Keyboard0Multimedia"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event7"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "Keyboard0" "CoreKeyboard"<br />
InputDevice "Keyboard0Multimedia" "SendCoreEvents"<br />
InputDevice "Mouse0" "CorePointer"<br />
Option "AutoAddDevices" "no"<br />
EndSection<br />
}}<br />
<br />
===The Ctrl-Alt-Fx, Alt-Fx keys mess up with virtual terminals===<br />
<br />
(Oct 2010) I follows this guide and everything works, except for Atl-F1, Atl-F2,... mess things up. Then I follow this guide https://help.ubuntu.com/community/MultiseatX (read the part for Ubuntu 10.04):<br />
<br />
{{bc|<br />
# cd /usr/bin<br />
# ln -s X X0<br />
# ln -s X X1<br />
}}<br />
<br />
Then fix in the '''/usr/share/config/kdm/kdmrc''' as follow<br />
<br />
{{bc|1=<br />
[General]<br />
ConsoleTTYs=tty1,tty2,tty3,tty4,tty5,tty6<br />
ServerVTs=7,8<br />
StaticServers=:0,:1<br />
ReserveServers=:2,:3<br />
...<br />
<br />
[X-:0-Core]<br />
ServerVT=8<br />
ServerCmd=/usr/bin/X1<br />
ServerArgsLocal=-nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0<br />
<br />
[X-:1-Core]<br />
ServerVT=7<br />
ServerCmd=/usr/bin/X0<br />
ServerArgsLocal=-nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0<br />
...<br />
}}<br />
<br />
It works for my computer: one on-board Intel card (xf86-video-intel driver), and one Nvidia card (xf86-video-nouveau driver). You can check if the parameters are passed correctly by:<br />
<br />
{{bc|<nowiki><br />
$ ps aux | grep 'PCI' | grep -Ev 'grep'<br />
root 16993 1.6 1.3 32900 26772 ? S 08:09 0:19 /usr/bin/X0 :1 vt7 -nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0 -auth /var/run/xauth/A:1-ES6CCb<br />
root 17124 5.9 0.5 18996 11980 ? S 08:09 1:09 /usr/bin/X1 :0 vt8 -nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0 -auth /var/run/xauth/A:0-Wgiyza<br />
<br />
</nowiki>}}<br />
<br />
The '''ServerVT=7''', '''ServerVT=8''' would be pass to as '''vt7''', '''vt8'''<br />
<br />
==Final configuration==<br />
<br />
===/etc/X11/xorg.conf===<br />
<br />
This is my full xorg.conf with multiseat that works:<br />
{{bc|<br />
Section "Module"<br />
Load "dbe"<br />
<br />
SubSection "extmod"<br />
Option "omit xfree86-dga"<br />
EndSubSection<br />
<br />
Load "type1"<br />
Load "speedo"<br />
Load "freetype"<br />
Load "glx"<br />
EndSection<br />
<br />
<br />
Section "Files"<br />
RgbPath "/usr/share/X11/rgb"<br />
<br />
FontPath "/usr/share/fonts/misc"<br />
FontPath "/usr/share/fonts/75dpi"<br />
FontPath "/usr/share/fonts/100dpi"<br />
FontPath "/usr/share/fonts/TTF"<br />
FontPath "/usr/share/fonts/Type1"<br />
FontPath "/usr/share/fonts/msfonts"<br />
FontPath "/usr/share/fonts/misc2"<br />
FontPath "/usr/share/fonts/local"<br />
FontPath "/usr/local/share/fonts"<br />
EndSection<br />
<br />
<br />
Section "ServerFlags"<br />
# Option "DontZap"<br />
Option "AllowMouseOpenFail" "true"<br />
# Option "DefaultServerLayout" "alltogether"<br />
Option "Xinerama" "0"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event5"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2" # Auto detect<br />
Option "Device" "/dev/input/mouse2"<br />
Option "ZAxisMapping" "4 5"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse1"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse1"<br />
EndSection<br />
<br />
<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:1:0:0"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "nvidia1"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:0:10:0"<br />
EndSection<br />
<br />
<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "screen1"<br />
Device "nvidia1"<br />
Monitor "cpdm151"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1024x768" "800x600"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat1"<br />
Screen "screen1" 0 0<br />
InputDevice "mouse1" "CorePointer"<br />
InputDevice "keyboard1" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "Extensions"<br />
Option "Composite" "Disable"<br />
Option "RENDER" "Enable"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "cpdm151"<br />
Option "dpms"<br />
HorizSync 30-61<br />
VertRefresh 60<br />
EndSection<br />
}}<br />
<br />
===/opt/kde/share/config/kdm/kdmrc===<br />
<br />
This is my kdmrc:<br />
<br />
{{bc|1=<br />
[General]<br />
ConfigVersion=2.3<br />
ConsoleTTYs=vc/1,vc/2,vc/3,vc/4,vc/5,vc/6<br />
PidFile=/var/run/kdm.pid<br />
ReserveServers=:2,:3<br />
ServerVTs=-7<br />
StaticServers=:0,:1<br />
<br />
[Shutdown]<br />
BootManager=Grub<br />
HaltCmd=/sbin/halt<br />
RebootCmd=/sbin/reboot<br />
<br />
[X-*-Core]<br />
AllowNullPasswd=false<br />
AllowRootLogin=false<br />
AllowShutdown=Root<br />
Authorize=true<br />
AutoReLogin=false<br />
ClientLogFile=.xsession-errors-%s<br />
Reset=/opt/kde/share/config/kdm/Xreset<br />
Resources=/opt/kde/share/config/kdm/Xresources<br />
Session=/opt/kde/share/config/kdm/Xsession<br />
SessionsDirs=/etc/X11/sessions,/usr/share/xsessions,/opt/kde/share/apps/kdm/sessions<br />
Setup=/opt/kde/share/config/kdm/Xsetup<br />
Startup=/opt/kde/share/config/kdm/Xstartup<br />
<br />
[X-*-Greeter]<br />
AllowConsole=true<br />
AntiAliasing=true<br />
AuthComplain=true<br />
BackgroundCfg=/opt/kde/share/config/kdm/backgroundrc<br />
ColorScheme=<br />
DefaultUser=<br />
EchoMode=OneStar<br />
FaceSource=PreferUser<br />
FailFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
FocusPasswd=false<br />
ForgingSeed=1097313140<br />
GUIStyle=<br />
GreetFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
GreetString=Arch Linux %r (%h)<br />
GreeterPos=50,50<br />
HiddenUsers=root<br />
Language=en_US<br />
LogoArea=None<br />
LogoPixmap=<br />
MaxShowUID=65000<br />
MinShowUID=500<br />
PreselectUser=None<br />
SelectedUsers=<br />
ShowUsers=NotHidden<br />
SortUsers=true<br />
StdFont=Tahoma,11,-1,5,50,0,0,0,0,0<br />
UseBackground=false<br />
UserCompletion=false<br />
UserList=true<br />
<br />
[X-:*-Core]<br />
AllowNullPasswd=true<br />
AllowRootLogin=true<br />
AllowShutdown=All<br />
NoPassEnable=false<br />
NoPassUsers=<br />
<br />
[X-:*-Greeter]<br />
AllowClose=true<br />
DefaultUser=glenn<br />
FocusPasswd=true<br />
LoginMode=DefaultLocal<br />
PreselectUser=Previous<br />
<br />
[X-:0-Core]<br />
AutoLoginAgain=false<br />
AutoLoginDelay=0<br />
AutoLoginEnable=false<br />
AutoLoginLocked=false<br />
AutoLoginUser=glenn<br />
ClientLogFile=.xsession-errors<br />
ServerArgsLocal=-nolisten tcp -layout seat0 -sharevts -novtswitch <br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch <br />
<br />
[Xdmcp]<br />
Enable=false<br />
Willing=/opt/kde/share/config/kdm/Xwilling<br />
Xaccess=/opt/kde/share/config/kdm/Xaccess<br />
}}<br />
<br />
==Related problems==<br />
<br />
===PulseAudio===<br />
If two users want to use the sound card simultaneously, it is necessary to use a sound server, [[PulseAudio]] being most prevalent. Usually, the PulseAudio server runs only for active user and does not allow for multiple user instances. Solution to this problem is using the system-wide PulseAudio server. Although this approach is discouraged by its authors, it is probably most applicable setup.<br />
<br />
;Configuring for system-wide PulseAudio<br />
* Create user pulse and put him into group audio (PulseAudio drops root privileges and changes to user pulse. Group membership allows for device access.)<br />
* Create group pulse-access and put users, who will play sound locally into it (Group membership is used for access control for local access to PA daemon.)<br />
* In /etc/pulse/default.pa state explicitly the access rights<br />
{{bc|1=<br />
load-module module-native-protocol-unix auth-group=pulse-access auth-group-enable=1<br />
}}<br />
<br />
Start PA as system-wide, under root: {{bc|pulseaudio --system}}<br />
<br />
In {{ic|/var/run/pulse}} should appear files for communication with daemon, namely pid and native. <br />
<br />
;User access<br />
You can check communication with system daemon as non-root by e.g. {{ic|pactl -s "unix:/var/run/pulse/native" list}}.<br />
<br />
It is possible to enable automatic connection to local daemon in /etc/pulse/client.conf<br />
{{bc|1=<br />
auto-connect-localhost = yes<br />
}}<br />
<br />
The users should be able to connect to PA server. All the cons for system-wide daemon become essentially pros, e.g. ability to control volume of other users streams in pavucontrol.<br />
<br />
;Troubleshooting<br />
It is possible to enable the http interface to PA for debugging in /etc/pulse/default.pa<br />
{{ic|load-module module-http-protocol-tcp}} and then connect to it at http://localhost:4714/<br />
<br />
==See also==<br />
*[https://bbs.archlinux.org/viewtopic.php?id=105450 The original Arch Forums thread].<br />
<br />
*The arckwiki page [[Multi-pointer X]] explains how to setup two separate pair of devices on the same session.</div>Shillshockedhttps://wiki.archlinux.org/index.php?title=Xorg_multiseat&diff=297072Xorg multiseat2014-02-13T01:14:47Z<p>Shillshocked: /* For LightDM (Light Display Manager) */</p>
<hr />
<div>[[Category:X Server]]<br />
Multiseat is a certain setup where multiple users work simultaneously on one computer. This is achieved by having two monitors, two keyboards and two mice. The advantages are quite obvious:<br />
* Less power consumption (only one computer)<br />
* Less hardware to purchase<br />
* All the cool kids do it<br />
<br />
==Requirements==<br />
<br />
===Keyboards and mice===<br />
<br />
Any standard PS/2 or USB keyboards will suffice. Same thing for mice.<br />
<br />
===Graphics hardware===<br />
<br />
For the best possible result you'll need two graphics cards. I used an nVidia FX5500 AGP and an nVidia 6200 PCI. If you look around a bit you can certainly find new and decent PCI graphics card for a soft price.<br />
<br />
It is possible to use only one videocard which has dual heads (like most nvidia cards will have), but this has some limitations: you have to use Xephyr on the second monitor which seems quite a messy solution from what I've read, and for optimal usage both screens need the same resolution.<br />
<br />
If you have two pci-express slots, take advantage of them! That way you'll even be able to play two games at the same time. (PCI is too slow to play comfortably)<br />
<br />
===Processors and memory===<br />
<br />
If you really are working with two users on the same computer, I'd at least recommend a dual-core processor and plenty of RAM. A fast hard drive (10.000 RPM or higher) is also recommended for comfortable use.<br />
<br />
===Software===<br />
<br />
You'll need Xorg with the drivers for your graphics card (according to some sources, the closed source nvidia driver works better than the open source nv driver for this, I have t tested this myself) and the evdev (xf86-input-evdev) driver. That's all. All this can be found in the Arch Linux core and extra repositories.<br />
<br />
===Some X knowledge===<br />
<br />
If you know how X works this will be a lot easier. Before you start, I recommend generating a clean configuration with xorgconfig that works with a single screen. Read through this xorg configuration and make yourself familiar. And as usual the manpages will provide you with most of the answers. You may reference some man pages: xorg, xserver, startx, xdm, xinit.<br />
'''sudo X -configure''', '''X -showopts''' may give you some hint.<br />
<br />
==Definitions==<br />
<br />
For this article to be clear, I'll be using the following definitions:<br />
* screen: A screen is something Xorg can display its stuff on. A screen has a monitor and a graphics card assigned to it.<br />
* monitor: A physical monitor like the one you're now sitting in front of.<br />
* server layout: a definition of which screen, keyboard and mouse to use.<br />
* seat: A workplace with a physical monitor, physical keyboard and physical mouse.<br />
<br />
==Tips and tricks==<br />
<br />
* Set up ssh on your computer, so you can ssh to the machine from another computer (such as a laptop). This is very useful because you'll probably run into X not responding anymore or not giving you picture at all.<br />
* Finding out which keyboard and mouse is which: open a terminal and use cat to find out. For example, {{ic|cat /dev/input/mouse1}}. If you then move your mouse and you see all weird things happening than that is the mouse you're moving. Same goes for keyboards, which are called eventN.<br />
* Try a basic configuration first. Don't start with the fancy stuff yet, get a very basic Xorg working first.<br />
* Leave your {{ic|xorg.conf}} alone and create a new file, called {{ic|xorg.conf.multiseat}} in {{ic|/etc/X11}} to store your new multiseat configuration. After this configuration is working you can overwrite the {{ic|xorg.conf}} file with your new {{ic|xorg.conf.multiseat}}.<br />
* Create a backup of all relevant configuration files. What do you mean you'll skip this one?<br />
* Take a look at the full configuration I used at the end of this article before you start.<br />
<br />
==About evdev==<br />
<br />
evdev is an Xorg driver which can make use of the kernel event devices, which you can find in {{ic|/dev/input}}.<br />
<br />
==Setting up Xorg==<br />
<br />
The logic behind this is that you have two server layouts, each assigned with their own keyboard, mouse, video card and monitor. <br />
<br />
===The basics===<br />
<br />
First of all we'll set up the basics for xorg.<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "AllowMouseOpenFail" "on"<br />
Option "AllowEmptyInput" "on"<br />
Option "ZapWarning" "on"<br />
Option "HandleSpecialKeys" "off" # Zapping on<br />
Option "DRI2" "on"<br />
Option "Xinerama" "off"<br />
EndSection<br />
}}<br />
<br />
===Defining available input devices===<br />
<br />
This part of the configuration tells Xorg which input devices it has available. Input devices are keyboards and mice, but can also be, for example, touchscreens and pens.<br />
<br />
This section defines my first keyboard, called keyboard0. As you can seen it uses the evdev driver. {{ic|/dev/input/event1}} corresponds with the keyboard connected to the PS/2 port of my computer. Create a section like this for each keyboard you have. Don't forget to modify the identifier of course. Keep the identifier simple and match it with the other names. This keyboard0 will be used for screen0 together with mouse0.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
# Option "Device" "/dev/input/by-path/platform-i8042-serio-0-event-kbd" <br />
# Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-kbd"<br />
Option "xkb_rules" "evdev"<br />
Option "xkb_model" "evdev"<br />
Option "xkb_layout" "us"<br />
Option "GrabDevice" "on" # prevent send event to other X-servers<br />
# If you are using a non en_US keyboard, set the layout here.<br />
# Option "XkbLayout" "be"<br />
EndSection<br />
}}<br />
<br />
<br />
This section defines my first mouse, called mouse0. This uses the regular mouse driver. /dev/input/mouse2 corresponds with the mouse connected to the PS/2 port of my computer. Create a section like this for each mouse you have.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse2"<br />
EndSection<br />
# or use evdev, that could assign by id<br />
Section "InputDevice"<br />
Identifier "Mouse0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
}}<br />
<br />
===Graphics card===<br />
<br />
Now we'll set up the graphics card for each screen.<br />
<br />
{{bc|<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "NoLogo" "1" # Remove nvidia branding at startup<br />
BusId "PCI:1:0:0"<br />
Option "ProbeAllGpus" "false" # Only required for nvidia<br />
EndSection<br />
}}<br />
<br />
This section defines my first graphics card, called nvidia0. This uses the closed source nvidia driver. Take a close look at the BusID. This option specifies which hardware card to use. You can find out the BusId's with lspci. However, you'll soon find out this doesn't always match. That's because lspci displays the device address in hexadecimal form. Xorg however uses decimal form. So you'll need to convert your address from hexadecimal form to decimal. Thus a device address of 0:0a:0 in lspci would become 0:10:0 in {{ic|xorg.conf}}.<br />
<br />
Create a section like this for every graphics card you have.<br />
<br />
===Screens===<br />
<br />
This section defines my first screen, called screen0. Pay close attention to the "monitor" option. For easy recognition I called it the model of my monitor.<br />
<br />
{{bc|<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
}}<br />
<br />
Create a section like this for every screen you have.<br />
<br />
===Monitors===<br />
<br />
This section defines my first monitor, l1730s. Pay close attention to the identifier.<br />
<br />
{{bc|<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
}}<br />
<br />
Create section like this for every monitor you have.<br />
<br />
===Serverlayout===<br />
<br />
Here's the fun stuff. This is how everything is added up. This is my first seat, called seat0. Here I tell Xorg for the server layout called "seat0" to use my screen0, which is attached to nvidia0, using keyboard0 and mouse0.<br />
<br />
The AutoAddDevices option is now needed to keep HAL from automatically adding all your input devices to all the X servers.<br />
<br />
{{bc|<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "Clone" "off"<br />
Option "AutoAddDevices" "off"<br />
Option "DisableModInDev" "true"<br />
Option "SingleCard" "on" # use this to simplfied isolatedevice option <br />
EndSection<br />
}}<br />
<br />
Create a section like this for every seat you have with their respective keyboards, mice and screens.<br />
<br />
==Testing==<br />
Before we start modifying our login manager, we'll first start with testing out the individual seats. If these are working, then we're good to go.<br />
<br />
I've used twm (tiny window manager) to test out if my seats work, but there's no reason you can't use KDE, gnome, or any other desktop environment or window manager. I've used this in my {{ic|~/.xinitrc}}:<br />
exec twm<br />
<br />
Use the following command to test out an individual seat:<br />
startx -- -layout seat0 -config xorg.conf.multiseat<br />
<br />
Do this for every seat you have. If they are all working correctly and the keyboard/mouse combination matches, then congratulations! You are almost finished! In case you are wondering why I didn't you use the full path to my new configuration file, that's because X doesn't allow that when running as non-root. It will search for xorg.conf.multiseat relative to {{ic|/etc/X11}}.<br />
<br />
==Setting up the loginmanager==<br />
<br />
===For KDM (KDE's Display Manager)===<br />
<br />
Open {{ic|/usr/share/config/kdm/kdmrc}} and set the following variables:<br />
<br />
{{bc|1=<br />
StaticServers=:0,:1 #In the case of two seats. If you have three this would become :0,:1,:2 and so forth.<br />
ReserveServers=:2,:3 #You can define here as many as you want, but these should always start at the highest seat + 1.<br />
}}<br />
Next you'll need to add an [X-:n-Core] for each seat (where n = the seat)<br />
{{bc|1=<br />
[X-:0-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat0<br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch<br />
}}<br />
<br />
Add section like this for every seat you have, and do not forget to change the :0 and the -layout seat0. Note that the "-sharevts" and "-novtswitch" options should be added for all seats ''except'' the first one. Otherwise, you can end with rectangles of virtual terminals "showing through" on your primary screen.<br />
<br />
===For GDM (Gnome's Display Manager)===<br />
{{note|The following will work with GDM 2.20 but not with newer versions of GDM. GDM 2.20 is in AUR.}}<br />
<br />
Open {{ic|/etc/gdm/custom.conf}} and set the following variables (This sample demos two seats):<br />
{{bc|1=<br />
[servers]<br />
0=Standard0<br />
1=Standard1<br />
<br />
[server-Standard0]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat0<br />
flexible=true<br />
<br />
[server-Standard1]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat1<br />
flexible=true<br />
}}<br />
<br />
===For XDM (X Display Manager)===<br />
<br />
Open {{ic|/etc/X11/xdm/Xservers}} and set the following variables (This sample demos two seats):<br />
<br />
{{bc|<br />
# NOTE: don't add -sharevts on seat0, otherwise it may reset in about 10~20 minutes automatically.<br />
:0 local /usr/bin/X :0 vt07 -nolisten tcp -novtswitch -layout seat0 -config xorg.conf.multiseat<br />
:1 local /usr/bin/X :1 vt08 -nolisten tcp -sharevts -novtswitch -layout seat1 -config xorg.conf.multiseat<br />
}}<br />
<br />
Also if you use the Archlinux theme edit {{ic|/etc/X11/xdm/xdm-config}} for every screen:<br />
<br />
{{bc|<br />
DisplayManager._0.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._0.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._0.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
DisplayManager._1.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._1.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._1.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
}}<br />
<br />
===For LightDM (Light Display Manager)===<br />
<br />
LightDM works well with ALSA only and PulseAudio removed if you wish to have shared audio, an alsamixer equalizer and software mixing.<br />
<br />
In the example below LightDM and MATE with ALSA was installed with PulseAudio removed. PulseAudio could also be used but it requires a more complicated configuration to maintain high audio quality. The relevant hardware used is an ATI Radeon HD 5850 and an Intel Sandy Bridge (onboard) HD 3000. You configuration may vary.<br />
<br />
Open {{ic|/etc/lightdm/lightdm.conf}} and follow the sample. Autologin is optional. This works both as multi-user multiseat and single user multi-seat. In the former case only the last user to login will have audio control and access. Specific hardware could be addressed in {{ic|/etc/asound.conf}} to allocate audio to both users simultaneously if required. In the latter case the sound card will be shared equally among the seats using ALSA with PulseAudio removed - libpulse itself should be kept for various software dependencies however:<br />
<br />
{{bc|1=<br />
[LightDM]<br />
greeter-user=lightdm<br />
log-directory=/var/log/lightdm<br />
run-directory=/run/lightdm<br />
<br />
[SeatDefaults]<br />
xserver-command=/usr/bin/X<br />
greeter-session=lightdm-gtk-greeter<br />
greeter-show-manual-login=true<br />
user-session=mate<br />
session-wrapper=/etc/lightdm/Xsession<br />
pam-service=lightdm-autologin<br />
exit-on-failure=true<br />
<br />
[Seat:0]<br />
xserver-command=/usr/bin/X :0 -sharevts<br />
xserver-layout=Layout0<br />
#autologin-user=joeblow<br />
#autologin-user-timeout=-1<br />
#session-setup-script=/etc/lightdm/scripts/sound_start<br />
#session-cleanup-script=/etc/lightdm/scripts/sound_stop<br />
<br />
[Seat:1]<br />
xserver-command=/usr/bin/X :1 -sharevts<br />
xserver-layout=Layout1<br />
#autologin-user=jillschmill<br />
#autologin-user-timeout=-1<br />
}}<br />
<br />
Next, remove respective {{ic|~/.asoundrc}} files (as well as related PulseAudio config files if you removed that) and follow this template with {{ic|/etc/asound.conf}} for sound:<br />
<br />
defaults.pcm.rate_converter "samplerate_best"<br />
<br />
{{bc|<br />
ctl.equal {<br />
type equal;<br />
}<br />
<br />
pcm.plugequal {<br />
type equal;<br />
# Modify the line below if you do not<br />
# want to use sound card 0.<br />
#slave.pcm "plughw:0,0";<br />
#by default we want to play from more sources at time:<br />
slave.pcm "plug:dmix";<br />
}<br />
#pcm.equal {<br />
# If you do not want the equalizer to be your<br />
# default soundcard comment the following<br />
# line and uncomment the above line. (You can<br />
# choose it as the output device by addressing<br />
# it with specific apps,eg mpg123 -a equal 06.Back_In_Black.mp3)<br />
pcm.!default {<br />
type plug;<br />
slave.pcm plugequal;<br />
}<br />
}}<br />
<br />
Finally you must set the {{ic|/etc/X11/xorg.conf}} file. You'll notice some options have been commented out which could be set according to your needs. Here is a sample, adjust to your own system configuration after determing hardware information:<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "DefaultServerLayout" "Layout1"<br />
# Option "AllowMouseOpenFail" "true"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "DontZap" "false"<br />
Option "Xinerama" "0"<br />
Option "AutoAddGPU" "FALSE"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "kbd_0" "CoreKeyboard"<br />
InputDevice "mouse_0" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true" <br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout1"<br />
Screen 0 "Screen1" 0 0<br />
InputDevice "kbd_1" "CoreKeyboard"<br />
InputDevice "mouse_1" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true"<br />
EndSection<br />
<br />
Section "Module"<br />
# Load "dri2"<br />
# Load "glamoregl"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.6:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:04:00.0-usb-0:1:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.5:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.3:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
# Option "DPMS" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "radeon"<br />
# Option "AccelMethod" "glamor"<br />
Option "AccelMethod" "EXA"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:1:0:0"<br />
Screen 0<br />
# Option "EXAVSync"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device1"<br />
Driver "intel"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:0:2:0"<br />
Screen 0<br />
# Option "AccelMethod" "UXA"<br />
# Option "TearFree" "1"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Device0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen1"<br />
Device "Device1"<br />
Monitor "Monitor1"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
Make sure to delete the {{ic|~/.Xauthority}} file in respective user directories before the initial reboot.<br />
<br />
===For Auto Login multiseat (without Display Manager)===<br />
<br />
edit a script /boot/twin.sh<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
cmd1="/bin/bash --login -c \"/usr/bin/xinit --"<br />
cmd2="-nolisten tcp -keeptty -novtswitch -config xorg.multiseat.conf"<br />
usr=(user1 user2) # FIXME: assume user1, user2 is valid user id<br />
declare -a pid<br />
while true ; do<br />
for ((i=0; i<${#usr[*]}; i++)) ; do<br />
echo "usr[$i]=${usr[$i]} pid=${pid[$i]}"<br />
if [ -z "${pid[$i]}" ] || [ ! -d "/proc/${pid[$i]}" ] ; then<br />
# echo "pid ${pid[$i]} killed, execute again" <br />
cmd3="-layout seat$i vt0"$((7+i))"\""<br />
if [ $i -gt 0 ] ; then<br />
cmd3="-sharevts $cmd3"<br />
fi<br />
#echo "cmd3=$cmd3"<br />
/bin/su ${usr[$i]} -l -c "$cmd1 :$i $cmd2 $cmd3" &<br />
pid[$i]=$!<br />
#echo "new pid=${pid[$i]}"<br />
fi<br />
done<br />
sleep 5 # check process exist per 5 second<br />
done<br />
</nowiki>}}<br />
<br />
Open {{ic|/etc/inittab}} and setup as follows:<br />
<br />
{{bc|<br />
#id:3:initdefault:<br />
id:5:initdefault:<br />
...<br />
x2:5:once:/root/twin.sh > /root/twin.log 2>&1<br />
}}<br />
<br />
==Troubleshooting==<br />
<br />
===My Windows key doesn't work anymore===<br />
<br />
Put this in [[Execute commands after X start|a startup file]]:<br />
xmodmap -e "add Mod4 = Super_L Super_R"<br />
<br />
===Unreliable behaviour (black picture without cursor)===<br />
<br />
If everything seems to be set up correctly, but for some reason you always get a black picture without a cursor, try setting the first initialized card in the BIOS to be the PCI card one.<br />
<br />
===Little black boxes/dots on the desktop===<br />
<br />
This is actually portions of the virtual terminals being painted on top of X. It seems to be caused by the Linux kernel framebuffer. This can be fixed by disabling the framebuffer, or by removing the "-sharevts" option from the primary seat's X args.<br />
<br />
===Multimedia keys not working===<br />
<br />
If your keyboard(s) has extra "multimedia" keys, you may find that they stopped working in your multiseat setup. This is because such keyboards are often represented as more then one "event" device. As you did above, cat each /dev/input/event* device, this time pressing multimedia keys. Once you've found the right event device, add a separate keyboard InputDevice section for it, then add that InputDevice section to the corresponding ServerLayout section with the "SendCoreEvents" option, which indicates that input from this device should be handled, despite not being the core keyboard. In the end you should have sections something like the following:<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "Keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event6"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "Keyboard0Multimedia"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event7"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "Keyboard0" "CoreKeyboard"<br />
InputDevice "Keyboard0Multimedia" "SendCoreEvents"<br />
InputDevice "Mouse0" "CorePointer"<br />
Option "AutoAddDevices" "no"<br />
EndSection<br />
}}<br />
<br />
===The Ctrl-Alt-Fx, Alt-Fx keys mess up with virtual terminals===<br />
<br />
(Oct 2010) I follows this guide and everything works, except for Atl-F1, Atl-F2,... mess things up. Then I follow this guide https://help.ubuntu.com/community/MultiseatX (read the part for Ubuntu 10.04):<br />
<br />
{{bc|<br />
# cd /usr/bin<br />
# ln -s X X0<br />
# ln -s X X1<br />
}}<br />
<br />
Then fix in the '''/usr/share/config/kdm/kdmrc''' as follow<br />
<br />
{{bc|1=<br />
[General]<br />
ConsoleTTYs=tty1,tty2,tty3,tty4,tty5,tty6<br />
ServerVTs=7,8<br />
StaticServers=:0,:1<br />
ReserveServers=:2,:3<br />
...<br />
<br />
[X-:0-Core]<br />
ServerVT=8<br />
ServerCmd=/usr/bin/X1<br />
ServerArgsLocal=-nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0<br />
<br />
[X-:1-Core]<br />
ServerVT=7<br />
ServerCmd=/usr/bin/X0<br />
ServerArgsLocal=-nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0<br />
...<br />
}}<br />
<br />
It works for my computer: one on-board Intel card (xf86-video-intel driver), and one Nvidia card (xf86-video-nouveau driver). You can check if the parameters are passed correctly by:<br />
<br />
{{bc|<nowiki><br />
$ ps aux | grep 'PCI' | grep -Ev 'grep'<br />
root 16993 1.6 1.3 32900 26772 ? S 08:09 0:19 /usr/bin/X0 :1 vt7 -nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0 -auth /var/run/xauth/A:1-ES6CCb<br />
root 17124 5.9 0.5 18996 11980 ? S 08:09 1:09 /usr/bin/X1 :0 vt8 -nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0 -auth /var/run/xauth/A:0-Wgiyza<br />
<br />
</nowiki>}}<br />
<br />
The '''ServerVT=7''', '''ServerVT=8''' would be pass to as '''vt7''', '''vt8'''<br />
<br />
==Final configuration==<br />
<br />
===/etc/X11/xorg.conf===<br />
<br />
This is my full xorg.conf with multiseat that works:<br />
{{bc|<br />
Section "Module"<br />
Load "dbe"<br />
<br />
SubSection "extmod"<br />
Option "omit xfree86-dga"<br />
EndSubSection<br />
<br />
Load "type1"<br />
Load "speedo"<br />
Load "freetype"<br />
Load "glx"<br />
EndSection<br />
<br />
<br />
Section "Files"<br />
RgbPath "/usr/share/X11/rgb"<br />
<br />
FontPath "/usr/share/fonts/misc"<br />
FontPath "/usr/share/fonts/75dpi"<br />
FontPath "/usr/share/fonts/100dpi"<br />
FontPath "/usr/share/fonts/TTF"<br />
FontPath "/usr/share/fonts/Type1"<br />
FontPath "/usr/share/fonts/msfonts"<br />
FontPath "/usr/share/fonts/misc2"<br />
FontPath "/usr/share/fonts/local"<br />
FontPath "/usr/local/share/fonts"<br />
EndSection<br />
<br />
<br />
Section "ServerFlags"<br />
# Option "DontZap"<br />
Option "AllowMouseOpenFail" "true"<br />
# Option "DefaultServerLayout" "alltogether"<br />
Option "Xinerama" "0"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event5"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2" # Auto detect<br />
Option "Device" "/dev/input/mouse2"<br />
Option "ZAxisMapping" "4 5"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse1"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse1"<br />
EndSection<br />
<br />
<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:1:0:0"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "nvidia1"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:0:10:0"<br />
EndSection<br />
<br />
<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "screen1"<br />
Device "nvidia1"<br />
Monitor "cpdm151"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1024x768" "800x600"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat1"<br />
Screen "screen1" 0 0<br />
InputDevice "mouse1" "CorePointer"<br />
InputDevice "keyboard1" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "Extensions"<br />
Option "Composite" "Disable"<br />
Option "RENDER" "Enable"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "cpdm151"<br />
Option "dpms"<br />
HorizSync 30-61<br />
VertRefresh 60<br />
EndSection<br />
}}<br />
<br />
===/opt/kde/share/config/kdm/kdmrc===<br />
<br />
This is my kdmrc:<br />
<br />
{{bc|1=<br />
[General]<br />
ConfigVersion=2.3<br />
ConsoleTTYs=vc/1,vc/2,vc/3,vc/4,vc/5,vc/6<br />
PidFile=/var/run/kdm.pid<br />
ReserveServers=:2,:3<br />
ServerVTs=-7<br />
StaticServers=:0,:1<br />
<br />
[Shutdown]<br />
BootManager=Grub<br />
HaltCmd=/sbin/halt<br />
RebootCmd=/sbin/reboot<br />
<br />
[X-*-Core]<br />
AllowNullPasswd=false<br />
AllowRootLogin=false<br />
AllowShutdown=Root<br />
Authorize=true<br />
AutoReLogin=false<br />
ClientLogFile=.xsession-errors-%s<br />
Reset=/opt/kde/share/config/kdm/Xreset<br />
Resources=/opt/kde/share/config/kdm/Xresources<br />
Session=/opt/kde/share/config/kdm/Xsession<br />
SessionsDirs=/etc/X11/sessions,/usr/share/xsessions,/opt/kde/share/apps/kdm/sessions<br />
Setup=/opt/kde/share/config/kdm/Xsetup<br />
Startup=/opt/kde/share/config/kdm/Xstartup<br />
<br />
[X-*-Greeter]<br />
AllowConsole=true<br />
AntiAliasing=true<br />
AuthComplain=true<br />
BackgroundCfg=/opt/kde/share/config/kdm/backgroundrc<br />
ColorScheme=<br />
DefaultUser=<br />
EchoMode=OneStar<br />
FaceSource=PreferUser<br />
FailFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
FocusPasswd=false<br />
ForgingSeed=1097313140<br />
GUIStyle=<br />
GreetFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
GreetString=Arch Linux %r (%h)<br />
GreeterPos=50,50<br />
HiddenUsers=root<br />
Language=en_US<br />
LogoArea=None<br />
LogoPixmap=<br />
MaxShowUID=65000<br />
MinShowUID=500<br />
PreselectUser=None<br />
SelectedUsers=<br />
ShowUsers=NotHidden<br />
SortUsers=true<br />
StdFont=Tahoma,11,-1,5,50,0,0,0,0,0<br />
UseBackground=false<br />
UserCompletion=false<br />
UserList=true<br />
<br />
[X-:*-Core]<br />
AllowNullPasswd=true<br />
AllowRootLogin=true<br />
AllowShutdown=All<br />
NoPassEnable=false<br />
NoPassUsers=<br />
<br />
[X-:*-Greeter]<br />
AllowClose=true<br />
DefaultUser=glenn<br />
FocusPasswd=true<br />
LoginMode=DefaultLocal<br />
PreselectUser=Previous<br />
<br />
[X-:0-Core]<br />
AutoLoginAgain=false<br />
AutoLoginDelay=0<br />
AutoLoginEnable=false<br />
AutoLoginLocked=false<br />
AutoLoginUser=glenn<br />
ClientLogFile=.xsession-errors<br />
ServerArgsLocal=-nolisten tcp -layout seat0 -sharevts -novtswitch <br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch <br />
<br />
[Xdmcp]<br />
Enable=false<br />
Willing=/opt/kde/share/config/kdm/Xwilling<br />
Xaccess=/opt/kde/share/config/kdm/Xaccess<br />
}}<br />
<br />
==Related problems==<br />
<br />
===PulseAudio===<br />
If two users want to use the sound card simultaneously, it is necessary to use a sound server, [[PulseAudio]] being most prevalent. Usually, the PulseAudio server runs only for active user and does not allow for multiple user instances. Solution to this problem is using the system-wide PulseAudio server. Although this approach is discouraged by its authors, it is probably most applicable setup.<br />
<br />
;Configuring for system-wide PulseAudio<br />
* Create user pulse and put him into group audio (PulseAudio drops root privileges and changes to user pulse. Group membership allows for device access.)<br />
* Create group pulse-access and put users, who will play sound locally into it (Group membership is used for access control for local access to PA daemon.)<br />
* In /etc/pulse/default.pa state explicitly the access rights<br />
{{bc|1=<br />
load-module module-native-protocol-unix auth-group=pulse-access auth-group-enable=1<br />
}}<br />
<br />
Start PA as system-wide, under root: {{bc|pulseaudio --system}}<br />
<br />
In {{ic|/var/run/pulse}} should appear files for communication with daemon, namely pid and native. <br />
<br />
;User access<br />
You can check communication with system daemon as non-root by e.g. {{ic|pactl -s "unix:/var/run/pulse/native" list}}.<br />
<br />
It is possible to enable automatic connection to local daemon in /etc/pulse/client.conf<br />
{{bc|1=<br />
auto-connect-localhost = yes<br />
}}<br />
<br />
The users should be able to connect to PA server. All the cons for system-wide daemon become essentially pros, e.g. ability to control volume of other users streams in pavucontrol.<br />
<br />
;Troubleshooting<br />
It is possible to enable the http interface to PA for debugging in /etc/pulse/default.pa<br />
{{ic|load-module module-http-protocol-tcp}} and then connect to it at http://localhost:4714/<br />
<br />
==See also==<br />
*[https://bbs.archlinux.org/viewtopic.php?id=105450 The original Arch Forums thread].<br />
<br />
*The arckwiki page [[Multi-pointer X]] explains how to setup two separate pair of devices on the same session.</div>Shillshockedhttps://wiki.archlinux.org/index.php?title=Xorg_multiseat&diff=296951Xorg multiseat2014-02-12T06:11:50Z<p>Shillshocked: autologin now explained in LightDM section</p>
<hr />
<div>[[Category:X Server]]<br />
Multiseat is a certain setup where multiple users work simultaneously on one computer. This is achieved by having two monitors, two keyboards and two mice. The advantages are quite obvious:<br />
* Less power consumption (only one computer)<br />
* Less hardware to purchase<br />
* All the cool kids do it<br />
<br />
==Requirements==<br />
<br />
===Keyboards and mice===<br />
<br />
Any standard PS/2 or USB keyboards will suffice. Same thing for mice.<br />
<br />
===Graphics hardware===<br />
<br />
For the best possible result you'll need two graphics cards. I used an nVidia FX5500 AGP and an nVidia 6200 PCI. If you look around a bit you can certainly find new and decent PCI graphics card for a soft price.<br />
<br />
It is possible to use only one videocard which has dual heads (like most nvidia cards will have), but this has some limitations: you have to use Xephyr on the second monitor which seems quite a messy solution from what I've read, and for optimal usage both screens need the same resolution.<br />
<br />
If you have two pci-express slots, take advantage of them! That way you'll even be able to play two games at the same time. (PCI is too slow to play comfortably)<br />
<br />
===Processors and memory===<br />
<br />
If you really are working with two users on the same computer, I'd at least recommend a dual-core processor and plenty of RAM. A fast hard drive (10.000 RPM or higher) is also recommended for comfortable use.<br />
<br />
===Software===<br />
<br />
You'll need Xorg with the drivers for your graphics card (according to some sources, the closed source nvidia driver works better than the open source nv driver for this, I have t tested this myself) and the evdev (xf86-input-evdev) driver. That's all. All this can be found in the Arch Linux core and extra repositories.<br />
<br />
===Some X knowledge===<br />
<br />
If you know how X works this will be a lot easier. Before you start, I recommend generating a clean configuration with xorgconfig that works with a single screen. Read through this xorg configuration and make yourself familiar. And as usual the manpages will provide you with most of the answers. You may reference some man pages: xorg, xserver, startx, xdm, xinit.<br />
'''sudo X -configure''', '''X -showopts''' may give you some hint.<br />
<br />
==Definitions==<br />
<br />
For this article to be clear, I'll be using the following definitions:<br />
* screen: A screen is something Xorg can display its stuff on. A screen has a monitor and a graphics card assigned to it.<br />
* monitor: A physical monitor like the one you're now sitting in front of.<br />
* server layout: a definition of which screen, keyboard and mouse to use.<br />
* seat: A workplace with a physical monitor, physical keyboard and physical mouse.<br />
<br />
==Tips and tricks==<br />
<br />
* Set up ssh on your computer, so you can ssh to the machine from another computer (such as a laptop). This is very useful because you'll probably run into X not responding anymore or not giving you picture at all.<br />
* Finding out which keyboard and mouse is which: open a terminal and use cat to find out. For example, {{ic|cat /dev/input/mouse1}}. If you then move your mouse and you see all weird things happening than that is the mouse you're moving. Same goes for keyboards, which are called eventN.<br />
* Try a basic configuration first. Don't start with the fancy stuff yet, get a very basic Xorg working first.<br />
* Leave your {{ic|xorg.conf}} alone and create a new file, called {{ic|xorg.conf.multiseat}} in {{ic|/etc/X11}} to store your new multiseat configuration. After this configuration is working you can overwrite the {{ic|xorg.conf}} file with your new {{ic|xorg.conf.multiseat}}.<br />
* Create a backup of all relevant configuration files. What do you mean you'll skip this one?<br />
* Take a look at the full configuration I used at the end of this article before you start.<br />
<br />
==About evdev==<br />
<br />
evdev is an Xorg driver which can make use of the kernel event devices, which you can find in {{ic|/dev/input}}.<br />
<br />
==Setting up Xorg==<br />
<br />
The logic behind this is that you have two server layouts, each assigned with their own keyboard, mouse, video card and monitor. <br />
<br />
===The basics===<br />
<br />
First of all we'll set up the basics for xorg.<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "AllowMouseOpenFail" "on"<br />
Option "AllowEmptyInput" "on"<br />
Option "ZapWarning" "on"<br />
Option "HandleSpecialKeys" "off" # Zapping on<br />
Option "DRI2" "on"<br />
Option "Xinerama" "off"<br />
EndSection<br />
}}<br />
<br />
===Defining available input devices===<br />
<br />
This part of the configuration tells Xorg which input devices it has available. Input devices are keyboards and mice, but can also be, for example, touchscreens and pens.<br />
<br />
This section defines my first keyboard, called keyboard0. As you can seen it uses the evdev driver. {{ic|/dev/input/event1}} corresponds with the keyboard connected to the PS/2 port of my computer. Create a section like this for each keyboard you have. Don't forget to modify the identifier of course. Keep the identifier simple and match it with the other names. This keyboard0 will be used for screen0 together with mouse0.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
# Option "Device" "/dev/input/by-path/platform-i8042-serio-0-event-kbd" <br />
# Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-kbd"<br />
Option "xkb_rules" "evdev"<br />
Option "xkb_model" "evdev"<br />
Option "xkb_layout" "us"<br />
Option "GrabDevice" "on" # prevent send event to other X-servers<br />
# If you are using a non en_US keyboard, set the layout here.<br />
# Option "XkbLayout" "be"<br />
EndSection<br />
}}<br />
<br />
<br />
This section defines my first mouse, called mouse0. This uses the regular mouse driver. /dev/input/mouse2 corresponds with the mouse connected to the PS/2 port of my computer. Create a section like this for each mouse you have.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse2"<br />
EndSection<br />
# or use evdev, that could assign by id<br />
Section "InputDevice"<br />
Identifier "Mouse0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
}}<br />
<br />
===Graphics card===<br />
<br />
Now we'll set up the graphics card for each screen.<br />
<br />
{{bc|<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "NoLogo" "1" # Remove nvidia branding at startup<br />
BusId "PCI:1:0:0"<br />
Option "ProbeAllGpus" "false" # Only required for nvidia<br />
EndSection<br />
}}<br />
<br />
This section defines my first graphics card, called nvidia0. This uses the closed source nvidia driver. Take a close look at the BusID. This option specifies which hardware card to use. You can find out the BusId's with lspci. However, you'll soon find out this doesn't always match. That's because lspci displays the device address in hexadecimal form. Xorg however uses decimal form. So you'll need to convert your address from hexadecimal form to decimal. Thus a device address of 0:0a:0 in lspci would become 0:10:0 in {{ic|xorg.conf}}.<br />
<br />
Create a section like this for every graphics card you have.<br />
<br />
===Screens===<br />
<br />
This section defines my first screen, called screen0. Pay close attention to the "monitor" option. For easy recognition I called it the model of my monitor.<br />
<br />
{{bc|<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
}}<br />
<br />
Create a section like this for every screen you have.<br />
<br />
===Monitors===<br />
<br />
This section defines my first monitor, l1730s. Pay close attention to the identifier.<br />
<br />
{{bc|<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
}}<br />
<br />
Create section like this for every monitor you have.<br />
<br />
===Serverlayout===<br />
<br />
Here's the fun stuff. This is how everything is added up. This is my first seat, called seat0. Here I tell Xorg for the server layout called "seat0" to use my screen0, which is attached to nvidia0, using keyboard0 and mouse0.<br />
<br />
The AutoAddDevices option is now needed to keep HAL from automatically adding all your input devices to all the X servers.<br />
<br />
{{bc|<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "Clone" "off"<br />
Option "AutoAddDevices" "off"<br />
Option "DisableModInDev" "true"<br />
Option "SingleCard" "on" # use this to simplfied isolatedevice option <br />
EndSection<br />
}}<br />
<br />
Create a section like this for every seat you have with their respective keyboards, mice and screens.<br />
<br />
==Testing==<br />
Before we start modifying our login manager, we'll first start with testing out the individual seats. If these are working, then we're good to go.<br />
<br />
I've used twm (tiny window manager) to test out if my seats work, but there's no reason you can't use KDE, gnome, or any other desktop environment or window manager. I've used this in my {{ic|~/.xinitrc}}:<br />
exec twm<br />
<br />
Use the following command to test out an individual seat:<br />
startx -- -layout seat0 -config xorg.conf.multiseat<br />
<br />
Do this for every seat you have. If they are all working correctly and the keyboard/mouse combination matches, then congratulations! You are almost finished! In case you are wondering why I didn't you use the full path to my new configuration file, that's because X doesn't allow that when running as non-root. It will search for xorg.conf.multiseat relative to {{ic|/etc/X11}}.<br />
<br />
==Setting up the loginmanager==<br />
<br />
===For KDM (KDE's Display Manager)===<br />
<br />
Open {{ic|/usr/share/config/kdm/kdmrc}} and set the following variables:<br />
<br />
{{bc|1=<br />
StaticServers=:0,:1 #In the case of two seats. If you have three this would become :0,:1,:2 and so forth.<br />
ReserveServers=:2,:3 #You can define here as many as you want, but these should always start at the highest seat + 1.<br />
}}<br />
Next you'll need to add an [X-:n-Core] for each seat (where n = the seat)<br />
{{bc|1=<br />
[X-:0-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat0<br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch<br />
}}<br />
<br />
Add section like this for every seat you have, and do not forget to change the :0 and the -layout seat0. Note that the "-sharevts" and "-novtswitch" options should be added for all seats ''except'' the first one. Otherwise, you can end with rectangles of virtual terminals "showing through" on your primary screen.<br />
<br />
===For GDM (Gnome's Display Manager)===<br />
{{note|The following will work with GDM 2.20 but not with newer versions of GDM. GDM 2.20 is in AUR.}}<br />
<br />
Open {{ic|/etc/gdm/custom.conf}} and set the following variables (This sample demos two seats):<br />
{{bc|1=<br />
[servers]<br />
0=Standard0<br />
1=Standard1<br />
<br />
[server-Standard0]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat0<br />
flexible=true<br />
<br />
[server-Standard1]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat1<br />
flexible=true<br />
}}<br />
<br />
===For XDM (X Display Manager)===<br />
<br />
Open {{ic|/etc/X11/xdm/Xservers}} and set the following variables (This sample demos two seats):<br />
<br />
{{bc|<br />
# NOTE: don't add -sharevts on seat0, otherwise it may reset in about 10~20 minutes automatically.<br />
:0 local /usr/bin/X :0 vt07 -nolisten tcp -novtswitch -layout seat0 -config xorg.conf.multiseat<br />
:1 local /usr/bin/X :1 vt08 -nolisten tcp -sharevts -novtswitch -layout seat1 -config xorg.conf.multiseat<br />
}}<br />
<br />
Also if you use the Archlinux theme edit {{ic|/etc/X11/xdm/xdm-config}} for every screen:<br />
<br />
{{bc|<br />
DisplayManager._0.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._0.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._0.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
DisplayManager._1.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._1.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._1.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
}}<br />
<br />
===For LightDM (Light Display Manager)===<br />
<br />
LightDM works well with ALSA only and PulseAudio removed if you wish to have shared audio, an alsamixer equalizer and software mixing.<br />
<br />
In the example below LightDM and MATE with ALSA was installed with PulseAudio removed. PulseAudio could also be used but it requires a more complicated configuration to maintain high audio quality. The relevant hardware used is an ATI Radeon HD 5850 and an Intel Sandy Bridge (onboard) HD 3000. You configuration may vary.<br />
<br />
Open {{ic|/etc/lightdm/lightdm.conf}} and follow the sample. Autologin is optional. This works both as multi-user multiseat and single user multi-seat. In the former case only the last user to login will have audio control and access. Specific hardware could be addressed in {{ic|/etc/asound.conf}} to allocate audio to both users simultaneously if required. In the latter case the sound card will be shared equally among the seats using ALSA with PulseAudio removed - libpulse itself should be kept for various software dependencies however:<br />
<br />
{{bc|1=<br />
[LightDM]<br />
greeter-user=lightdm<br />
log-directory=/var/log/lightdm<br />
run-directory=/run/lightdm<br />
<br />
[SeatDefaults]<br />
xserver-command=/usr/bin/X<br />
greeter-session=lightdm-gtk-greeter<br />
greeter-show-manual-login=true<br />
user-session=mate<br />
session-wrapper=/etc/lightdm/Xsession<br />
pam-service=lightdm-autologin<br />
exit-on-failure=true<br />
<br />
[Seat:0]<br />
xserver-command=/usr/bin/X :0 -sharevts<br />
xserver-layout=Layout0<br />
#autologin-user=joeblow<br />
#autologin-user-timeout=-1<br />
#session-setup-script=/etc/lightdm/scripts/sound_start<br />
#session-cleanup-script=/etc/lightdm/scripts/sound_stop<br />
<br />
[Seat:1]<br />
xserver-command=/usr/bin/X :1 -sharevts<br />
xserver-layout=Layout1<br />
#autologin-user=jillschmill<br />
#autologin-user-timeout=-1<br />
}}<br />
<br />
Next, remove respective {{ic|~/.asoundrc}} files (as well as related PulseAudio config files if you removed that) and follow this template with {{ic|/etc/asound.conf}} for the sound:<br />
<br />
{{bc|<br />
ctl.equal {<br />
type equal;<br />
}<br />
<br />
pcm.plugequal {<br />
type equal;<br />
# Modify the line below if you do not<br />
# want to use sound card 0.<br />
#slave.pcm "plughw:0,0";<br />
#by default we want to play from more sources at time:<br />
slave.pcm "plug:dmix";<br />
}<br />
#pcm.equal {<br />
# If you do not want the equalizer to be your<br />
# default soundcard comment the following<br />
# line and uncomment the above line. (You can<br />
# choose it as the output device by addressing<br />
# it with specific apps,eg mpg123 -a equal 06.Back_In_Black.mp3)<br />
pcm.!default {<br />
type plug;<br />
slave.pcm plugequal;<br />
}<br />
}}<br />
<br />
Finally you must set the {{ic|/etc/X11/xorg.conf}} file. You'll notice some options have been commented out which could be set according to your needs. Here is a sample, adjust to your own system configuration after determing hardware information:<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "DefaultServerLayout" "Layout1"<br />
# Option "AllowMouseOpenFail" "true"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "DontZap" "false"<br />
Option "Xinerama" "0"<br />
Option "AutoAddGPU" "FALSE"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "kbd_0" "CoreKeyboard"<br />
InputDevice "mouse_0" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true" <br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout1"<br />
Screen 0 "Screen1" 0 0<br />
InputDevice "kbd_1" "CoreKeyboard"<br />
InputDevice "mouse_1" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true"<br />
EndSection<br />
<br />
Section "Module"<br />
# Load "dri2"<br />
# Load "glamoregl"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.6:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:04:00.0-usb-0:1:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.5:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.3:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
# Option "DPMS" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "radeon"<br />
# Option "AccelMethod" "glamor"<br />
Option "AccelMethod" "EXA"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:1:0:0"<br />
Screen 0<br />
# Option "EXAVSync"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device1"<br />
Driver "intel"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:0:2:0"<br />
Screen 0<br />
# Option "AccelMethod" "UXA"<br />
# Option "TearFree" "1"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Device0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen1"<br />
Device "Device1"<br />
Monitor "Monitor1"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
Make sure to delete the {{ic|~/.Xauthority}} file in respective user directories before the initial reboot.<br />
<br />
===For Auto Login multiseat (without Display Manager)===<br />
<br />
edit a script /boot/twin.sh<br />
{{bc|<br />
#!/bin/bash<br />
cmd1="/bin/bash --login -c \"/usr/bin/xinit --"<br />
cmd2="-nolisten tcp -keeptty -novtswitch -config xorg.multiseat.conf"<br />
usr=(user1 user2) # FIXME: assume user1, user2 is valid user id<br />
declare -a pid<br />
while true ; do<br />
for ((i=0; i<${#usr[*]}; i++)) ; do<br />
echo "usr[$i]=${usr[$i]} pid=${pid[$i]}"<br />
if [ -z "${pid[$i]}" ] || [ ! -d "/proc/${pid[$i]}" ] ; then<br />
# echo "pid ${pid[$i]} killed, execute again" <br />
cmd3="-layout seat$i vt0"$((7+i))"\""<br />
if [ $i -gt 0 ] ; then<br />
cmd3="-sharevts $cmd3"<br />
fi<br />
#echo "cmd3=$cmd3"<br />
/bin/su ${usr[$i]} -l -c "$cmd1 :$i $cmd2 $cmd3" &<br />
pid[$i]=$!<br />
#echo "new pid=${pid[$i]}"<br />
fi<br />
done<br />
sleep 5 # check process exist per 5 second<br />
done<br />
}}<br />
<br />
Open {{ic|/etc/inittab}} and setup as follows:<br />
<br />
{{bc|<br />
#id:3:initdefault:<br />
id:5:initdefault:<br />
...<br />
x2:5:once:/root/twin.sh > /root/twin.log 2>&1<br />
}}<br />
<br />
==Troubleshooting==<br />
<br />
===My Windows key doesn't work anymore===<br />
<br />
Put this in [[Execute commands after X start|a startup file]]:<br />
xmodmap -e "add Mod4 = Super_L Super_R"<br />
<br />
===Unreliable behaviour (black picture without cursor)===<br />
<br />
If everything seems to be set up correctly, but for some reason you always get a black picture without a cursor, try setting the first initialized card in the BIOS to be the PCI card one.<br />
<br />
===Little black boxes/dots on the desktop===<br />
<br />
This is actually portions of the virtual terminals being painted on top of X. It seems to be caused by the Linux kernel framebuffer. This can be fixed by disabling the framebuffer, or by removing the "-sharevts" option from the primary seat's X args.<br />
<br />
===Multimedia keys not working===<br />
<br />
If your keyboard(s) has extra "multimedia" keys, you may find that they stopped working in your multiseat setup. This is because such keyboards are often represented as more then one "event" device. As you did above, cat each /dev/input/event* device, this time pressing multimedia keys. Once you've found the right event device, add a separate keyboard InputDevice section for it, then add that InputDevice section to the corresponding ServerLayout section with the "SendCoreEvents" option, which indicates that input from this device should be handled, despite not being the core keyboard. In the end you should have sections something like the following:<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "Keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event6"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "Keyboard0Multimedia"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event7"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "Keyboard0" "CoreKeyboard"<br />
InputDevice "Keyboard0Multimedia" "SendCoreEvents"<br />
InputDevice "Mouse0" "CorePointer"<br />
Option "AutoAddDevices" "no"<br />
EndSection<br />
}}<br />
<br />
===The Ctrl-Alt-Fx, Alt-Fx keys mess up with virtual terminals===<br />
<br />
(Oct 2010) I follows this guide and everything works, except for Atl-F1, Atl-F2,... mess things up. Then I follow this guide https://help.ubuntu.com/community/MultiseatX (read the part for Ubuntu 10.04):<br />
<br />
{{bc|<br />
# cd /usr/bin<br />
# ln -s X X0<br />
# ln -s X X1<br />
}}<br />
<br />
Then fix in the '''/usr/share/config/kdm/kdmrc''' as follow<br />
<br />
{{bc|1=<br />
[General]<br />
ConsoleTTYs=tty1,tty2,tty3,tty4,tty5,tty6<br />
ServerVTs=7,8<br />
StaticServers=:0,:1<br />
ReserveServers=:2,:3<br />
...<br />
<br />
[X-:0-Core]<br />
ServerVT=8<br />
ServerCmd=/usr/bin/X1<br />
ServerArgsLocal=-nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0<br />
<br />
[X-:1-Core]<br />
ServerVT=7<br />
ServerCmd=/usr/bin/X0<br />
ServerArgsLocal=-nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0<br />
...<br />
}}<br />
<br />
It works for my computer: one on-board Intel card (xf86-video-intel driver), and one Nvidia card (xf86-video-nouveau driver). You can check if the parameters are passed correctly by:<br />
<br />
{{bc|<nowiki><br />
$ ps aux | grep 'PCI' | grep -Ev 'grep'<br />
root 16993 1.6 1.3 32900 26772 ? S 08:09 0:19 /usr/bin/X0 :1 vt7 -nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0 -auth /var/run/xauth/A:1-ES6CCb<br />
root 17124 5.9 0.5 18996 11980 ? S 08:09 1:09 /usr/bin/X1 :0 vt8 -nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0 -auth /var/run/xauth/A:0-Wgiyza<br />
<br />
</nowiki>}}<br />
<br />
The '''ServerVT=7''', '''ServerVT=8''' would be pass to as '''vt7''', '''vt8'''<br />
<br />
==Final configuration==<br />
<br />
===/etc/X11/xorg.conf===<br />
<br />
This is my full xorg.conf with multiseat that works:<br />
{{bc|<br />
Section "Module"<br />
Load "dbe"<br />
<br />
SubSection "extmod"<br />
Option "omit xfree86-dga"<br />
EndSubSection<br />
<br />
Load "type1"<br />
Load "speedo"<br />
Load "freetype"<br />
Load "glx"<br />
EndSection<br />
<br />
<br />
Section "Files"<br />
RgbPath "/usr/share/X11/rgb"<br />
<br />
FontPath "/usr/share/fonts/misc"<br />
FontPath "/usr/share/fonts/75dpi"<br />
FontPath "/usr/share/fonts/100dpi"<br />
FontPath "/usr/share/fonts/TTF"<br />
FontPath "/usr/share/fonts/Type1"<br />
FontPath "/usr/share/fonts/msfonts"<br />
FontPath "/usr/share/fonts/misc2"<br />
FontPath "/usr/share/fonts/local"<br />
FontPath "/usr/local/share/fonts"<br />
EndSection<br />
<br />
<br />
Section "ServerFlags"<br />
# Option "DontZap"<br />
Option "AllowMouseOpenFail" "true"<br />
# Option "DefaultServerLayout" "alltogether"<br />
Option "Xinerama" "0"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event5"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2" # Auto detect<br />
Option "Device" "/dev/input/mouse2"<br />
Option "ZAxisMapping" "4 5"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse1"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse1"<br />
EndSection<br />
<br />
<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:1:0:0"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "nvidia1"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:0:10:0"<br />
EndSection<br />
<br />
<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "screen1"<br />
Device "nvidia1"<br />
Monitor "cpdm151"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1024x768" "800x600"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat1"<br />
Screen "screen1" 0 0<br />
InputDevice "mouse1" "CorePointer"<br />
InputDevice "keyboard1" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "Extensions"<br />
Option "Composite" "Disable"<br />
Option "RENDER" "Enable"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "cpdm151"<br />
Option "dpms"<br />
HorizSync 30-61<br />
VertRefresh 60<br />
EndSection<br />
}}<br />
<br />
===/opt/kde/share/config/kdm/kdmrc===<br />
<br />
This is my kdmrc:<br />
<br />
{{bc|1=<br />
[General]<br />
ConfigVersion=2.3<br />
ConsoleTTYs=vc/1,vc/2,vc/3,vc/4,vc/5,vc/6<br />
PidFile=/var/run/kdm.pid<br />
ReserveServers=:2,:3<br />
ServerVTs=-7<br />
StaticServers=:0,:1<br />
<br />
[Shutdown]<br />
BootManager=Grub<br />
HaltCmd=/sbin/halt<br />
RebootCmd=/sbin/reboot<br />
<br />
[X-*-Core]<br />
AllowNullPasswd=false<br />
AllowRootLogin=false<br />
AllowShutdown=Root<br />
Authorize=true<br />
AutoReLogin=false<br />
ClientLogFile=.xsession-errors-%s<br />
Reset=/opt/kde/share/config/kdm/Xreset<br />
Resources=/opt/kde/share/config/kdm/Xresources<br />
Session=/opt/kde/share/config/kdm/Xsession<br />
SessionsDirs=/etc/X11/sessions,/usr/share/xsessions,/opt/kde/share/apps/kdm/sessions<br />
Setup=/opt/kde/share/config/kdm/Xsetup<br />
Startup=/opt/kde/share/config/kdm/Xstartup<br />
<br />
[X-*-Greeter]<br />
AllowConsole=true<br />
AntiAliasing=true<br />
AuthComplain=true<br />
BackgroundCfg=/opt/kde/share/config/kdm/backgroundrc<br />
ColorScheme=<br />
DefaultUser=<br />
EchoMode=OneStar<br />
FaceSource=PreferUser<br />
FailFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
FocusPasswd=false<br />
ForgingSeed=1097313140<br />
GUIStyle=<br />
GreetFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
GreetString=Arch Linux %r (%h)<br />
GreeterPos=50,50<br />
HiddenUsers=root<br />
Language=en_US<br />
LogoArea=None<br />
LogoPixmap=<br />
MaxShowUID=65000<br />
MinShowUID=500<br />
PreselectUser=None<br />
SelectedUsers=<br />
ShowUsers=NotHidden<br />
SortUsers=true<br />
StdFont=Tahoma,11,-1,5,50,0,0,0,0,0<br />
UseBackground=false<br />
UserCompletion=false<br />
UserList=true<br />
<br />
[X-:*-Core]<br />
AllowNullPasswd=true<br />
AllowRootLogin=true<br />
AllowShutdown=All<br />
NoPassEnable=false<br />
NoPassUsers=<br />
<br />
[X-:*-Greeter]<br />
AllowClose=true<br />
DefaultUser=glenn<br />
FocusPasswd=true<br />
LoginMode=DefaultLocal<br />
PreselectUser=Previous<br />
<br />
[X-:0-Core]<br />
AutoLoginAgain=false<br />
AutoLoginDelay=0<br />
AutoLoginEnable=false<br />
AutoLoginLocked=false<br />
AutoLoginUser=glenn<br />
ClientLogFile=.xsession-errors<br />
ServerArgsLocal=-nolisten tcp -layout seat0 -sharevts -novtswitch <br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch <br />
<br />
[Xdmcp]<br />
Enable=false<br />
Willing=/opt/kde/share/config/kdm/Xwilling<br />
Xaccess=/opt/kde/share/config/kdm/Xaccess<br />
}}<br />
<br />
==Related problems==<br />
<br />
===PulseAudio===<br />
If two users want to use the sound card simultaneously, it is necessary to use a sound server, [[PulseAudio]] being most prevalent. Usually, the PulseAudio server runs only for active user and does not allow for multiple user instances. Solution to this problem is using the system-wide PulseAudio server. Although this approach is discouraged by its authors, it is probably most applicable setup.<br />
<br />
;Configuring for system-wide PulseAudio<br />
* Create user pulse and put him into group audio (PulseAudio drops root privileges and changes to user pulse. Group membership allows for device access.)<br />
* Create group pulse-access and put users, who will play sound locally into it (Group membership is used for access control for local access to PA daemon.)<br />
* In /etc/pulse/default.pa state explicitly the access rights<br />
{{bc|1=<br />
load-module module-native-protocol-unix auth-group=pulse-access auth-group-enable=1<br />
}}<br />
<br />
Start PA as system-wide, under root: {{bc|pulseaudio --system}}<br />
<br />
In {{ic|/var/run/pulse}} should appear files for communication with daemon, namely pid and native. <br />
<br />
;User access<br />
You can check communication with system daemon as non-root by e.g. {{ic|pactl -s "unix:/var/run/pulse/native" list}}.<br />
<br />
It is possible to enable automatic connection to local daemon in /etc/pulse/client.conf<br />
{{bc|1=<br />
auto-connect-localhost = yes<br />
}}<br />
<br />
The users should be able to connect to PA server. All the cons for system-wide daemon become essentially pros, e.g. ability to control volume of other users streams in pavucontrol.<br />
<br />
;Troubleshooting<br />
It is possible to enable the http interface to PA for debugging in /etc/pulse/default.pa<br />
{{ic|load-module module-http-protocol-tcp}} and then connect to it at http://localhost:4714/<br />
<br />
==See also==<br />
*[https://bbs.archlinux.org/viewtopic.php?id=105450 The original Arch Forums thread].<br />
<br />
*The arckwiki page [[Multi-pointer X]] explains how to setup two separate pair of devices on the same session.</div>Shillshockedhttps://wiki.archlinux.org/index.php?title=Xorg_multiseat&diff=296946Xorg multiseat2014-02-12T05:44:26Z<p>Shillshocked: /* For LightDM (Light Display Manager) */</p>
<hr />
<div>[[Category:X Server]]<br />
{{Expansion|Is it possible login two users without keyin user name and password?<br\>systemd makes this easier, cover systemd ways}}<br />
Multiseat is a certain setup where multiple users work simultaneously on one computer. This is achieved by having two monitors, two keyboards and two mice. The advantages are quite obvious:<br />
* Less power consumption (only one computer)<br />
* Less hardware to purchase<br />
* All the cool kids do it<br />
<br />
==Requirements==<br />
<br />
===Keyboards and mice===<br />
<br />
Any standard PS/2 or USB keyboards will suffice. Same thing for mice.<br />
<br />
===Graphics hardware===<br />
<br />
For the best possible result you'll need two graphics cards. I used an nVidia FX5500 AGP and an nVidia 6200 PCI. If you look around a bit you can certainly find new and decent PCI graphics card for a soft price.<br />
<br />
It is possible to use only one videocard which has dual heads (like most nvidia cards will have), but this has some limitations: you have to use Xephyr on the second monitor which seems quite a messy solution from what I've read, and for optimal usage both screens need the same resolution.<br />
<br />
If you have two pci-express slots, take advantage of them! That way you'll even be able to play two games at the same time. (PCI is too slow to play comfortably)<br />
<br />
===Processors and memory===<br />
<br />
If you really are working with two users on the same computer, I'd at least recommend a dual-core processor and plenty of RAM. A fast hard drive (10.000 RPM or higher) is also recommended for comfortable use.<br />
<br />
===Software===<br />
<br />
You'll need Xorg with the drivers for your graphics card (according to some sources, the closed source nvidia driver works better than the open source nv driver for this, I have t tested this myself) and the evdev (xf86-input-evdev) driver. That's all. All this can be found in the Arch Linux core and extra repositories.<br />
<br />
===Some X knowledge===<br />
<br />
If you know how X works this will be a lot easier. Before you start, I recommend generating a clean configuration with xorgconfig that works with a single screen. Read through this xorg configuration and make yourself familiar. And as usual the manpages will provide you with most of the answers. You may reference some man pages: xorg, xserver, startx, xdm, xinit.<br />
'''sudo X -configure''', '''X -showopts''' may give you some hint.<br />
<br />
==Definitions==<br />
<br />
For this article to be clear, I'll be using the following definitions:<br />
* screen: A screen is something Xorg can display its stuff on. A screen has a monitor and a graphics card assigned to it.<br />
* monitor: A physical monitor like the one you're now sitting in front of.<br />
* server layout: a definition of which screen, keyboard and mouse to use.<br />
* seat: A workplace with a physical monitor, physical keyboard and physical mouse.<br />
<br />
==Tips and tricks==<br />
<br />
* Set up ssh on your computer, so you can ssh to the machine from another computer (such as a laptop). This is very useful because you'll probably run into X not responding anymore or not giving you picture at all.<br />
* Finding out which keyboard and mouse is which: open a terminal and use cat to find out. For example, {{ic|cat /dev/input/mouse1}}. If you then move your mouse and you see all weird things happening than that is the mouse you're moving. Same goes for keyboards, which are called eventN.<br />
* Try a basic configuration first. Don't start with the fancy stuff yet, get a very basic Xorg working first.<br />
* Leave your {{ic|xorg.conf}} alone and create a new file, called {{ic|xorg.conf.multiseat}} in {{ic|/etc/X11}} to store your new multiseat configuration. After this configuration is working you can overwrite the {{ic|xorg.conf}} file with your new {{ic|xorg.conf.multiseat}}.<br />
* Create a backup of all relevant configuration files. What do you mean you'll skip this one?<br />
* Take a look at the full configuration I used at the end of this article before you start.<br />
<br />
==About evdev==<br />
<br />
evdev is an Xorg driver which can make use of the kernel event devices, which you can find in {{ic|/dev/input}}.<br />
<br />
==Setting up Xorg==<br />
<br />
The logic behind this is that you have two server layouts, each assigned with their own keyboard, mouse, video card and monitor. <br />
<br />
===The basics===<br />
<br />
First of all we'll set up the basics for xorg.<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "AllowMouseOpenFail" "on"<br />
Option "AllowEmptyInput" "on"<br />
Option "ZapWarning" "on"<br />
Option "HandleSpecialKeys" "off" # Zapping on<br />
Option "DRI2" "on"<br />
Option "Xinerama" "off"<br />
EndSection<br />
}}<br />
<br />
===Defining available input devices===<br />
<br />
This part of the configuration tells Xorg which input devices it has available. Input devices are keyboards and mice, but can also be, for example, touchscreens and pens.<br />
<br />
This section defines my first keyboard, called keyboard0. As you can seen it uses the evdev driver. {{ic|/dev/input/event1}} corresponds with the keyboard connected to the PS/2 port of my computer. Create a section like this for each keyboard you have. Don't forget to modify the identifier of course. Keep the identifier simple and match it with the other names. This keyboard0 will be used for screen0 together with mouse0.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
# Option "Device" "/dev/input/by-path/platform-i8042-serio-0-event-kbd" <br />
# Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-kbd"<br />
Option "xkb_rules" "evdev"<br />
Option "xkb_model" "evdev"<br />
Option "xkb_layout" "us"<br />
Option "GrabDevice" "on" # prevent send event to other X-servers<br />
# If you are using a non en_US keyboard, set the layout here.<br />
# Option "XkbLayout" "be"<br />
EndSection<br />
}}<br />
<br />
<br />
This section defines my first mouse, called mouse0. This uses the regular mouse driver. /dev/input/mouse2 corresponds with the mouse connected to the PS/2 port of my computer. Create a section like this for each mouse you have.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse2"<br />
EndSection<br />
# or use evdev, that could assign by id<br />
Section "InputDevice"<br />
Identifier "Mouse0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
}}<br />
<br />
===Graphics card===<br />
<br />
Now we'll set up the graphics card for each screen.<br />
<br />
{{bc|<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "NoLogo" "1" # Remove nvidia branding at startup<br />
BusId "PCI:1:0:0"<br />
Option "ProbeAllGpus" "false" # Only required for nvidia<br />
EndSection<br />
}}<br />
<br />
This section defines my first graphics card, called nvidia0. This uses the closed source nvidia driver. Take a close look at the BusID. This option specifies which hardware card to use. You can find out the BusId's with lspci. However, you'll soon find out this doesn't always match. That's because lspci displays the device address in hexadecimal form. Xorg however uses decimal form. So you'll need to convert your address from hexadecimal form to decimal. Thus a device address of 0:0a:0 in lspci would become 0:10:0 in {{ic|xorg.conf}}.<br />
<br />
Create a section like this for every graphics card you have.<br />
<br />
===Screens===<br />
<br />
This section defines my first screen, called screen0. Pay close attention to the "monitor" option. For easy recognition I called it the model of my monitor.<br />
<br />
{{bc|<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
}}<br />
<br />
Create a section like this for every screen you have.<br />
<br />
===Monitors===<br />
<br />
This section defines my first monitor, l1730s. Pay close attention to the identifier.<br />
<br />
{{bc|<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
}}<br />
<br />
Create section like this for every monitor you have.<br />
<br />
===Serverlayout===<br />
<br />
Here's the fun stuff. This is how everything is added up. This is my first seat, called seat0. Here I tell Xorg for the server layout called "seat0" to use my screen0, which is attached to nvidia0, using keyboard0 and mouse0.<br />
<br />
The AutoAddDevices option is now needed to keep HAL from automatically adding all your input devices to all the X servers.<br />
<br />
{{bc|<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "Clone" "off"<br />
Option "AutoAddDevices" "off"<br />
Option "DisableModInDev" "true"<br />
Option "SingleCard" "on" # use this to simplfied isolatedevice option <br />
EndSection<br />
}}<br />
<br />
Create a section like this for every seat you have with their respective keyboards, mice and screens.<br />
<br />
==Testing==<br />
Before we start modifying our login manager, we'll first start with testing out the individual seats. If these are working, then we're good to go.<br />
<br />
I've used twm (tiny window manager) to test out if my seats work, but there's no reason you can't use KDE, gnome, or any other desktop environment or window manager. I've used this in my {{ic|~/.xinitrc}}:<br />
exec twm<br />
<br />
Use the following command to test out an individual seat:<br />
startx -- -layout seat0 -config xorg.conf.multiseat<br />
<br />
Do this for every seat you have. If they are all working correctly and the keyboard/mouse combination matches, then congratulations! You are almost finished! In case you are wondering why I didn't you use the full path to my new configuration file, that's because X doesn't allow that when running as non-root. It will search for xorg.conf.multiseat relative to {{ic|/etc/X11}}.<br />
<br />
==Setting up the loginmanager==<br />
<br />
===For KDM (KDE's Display Manager)===<br />
<br />
Open {{ic|/usr/share/config/kdm/kdmrc}} and set the following variables:<br />
<br />
{{bc|1=<br />
StaticServers=:0,:1 #In the case of two seats. If you have three this would become :0,:1,:2 and so forth.<br />
ReserveServers=:2,:3 #You can define here as many as you want, but these should always start at the highest seat + 1.<br />
}}<br />
Next you'll need to add an [X-:n-Core] for each seat (where n = the seat)<br />
{{bc|1=<br />
[X-:0-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat0<br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch<br />
}}<br />
<br />
Add section like this for every seat you have, and do not forget to change the :0 and the -layout seat0. Note that the "-sharevts" and "-novtswitch" options should be added for all seats ''except'' the first one. Otherwise, you can end with rectangles of virtual terminals "showing through" on your primary screen.<br />
<br />
===For GDM (Gnome's Display Manager)===<br />
{{note|The following will work with GDM 2.20 but not with newer versions of GDM. GDM 2.20 is in AUR.}}<br />
<br />
Open {{ic|/etc/gdm/custom.conf}} and set the following variables (This sample demos two seats):<br />
{{bc|1=<br />
[servers]<br />
0=Standard0<br />
1=Standard1<br />
<br />
[server-Standard0]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat0<br />
flexible=true<br />
<br />
[server-Standard1]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat1<br />
flexible=true<br />
}}<br />
<br />
===For XDM (X Display Manager)===<br />
<br />
Open {{ic|/etc/X11/xdm/Xservers}} and set the following variables (This sample demos two seats):<br />
<br />
{{bc|<br />
# NOTE: don't add -sharevts on seat0, otherwise it may reset in about 10~20 minutes automatically.<br />
:0 local /usr/bin/X :0 vt07 -nolisten tcp -novtswitch -layout seat0 -config xorg.conf.multiseat<br />
:1 local /usr/bin/X :1 vt08 -nolisten tcp -sharevts -novtswitch -layout seat1 -config xorg.conf.multiseat<br />
}}<br />
<br />
Also if you use the Archlinux theme edit {{ic|/etc/X11/xdm/xdm-config}} for every screen:<br />
<br />
{{bc|<br />
DisplayManager._0.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._0.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._0.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
DisplayManager._1.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._1.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._1.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
}}<br />
<br />
===For LightDM (Light Display Manager)===<br />
<br />
LightDM works well with ALSA only and PulseAudio removed if you wish to have shared audio, an alsamixer equalizer and software mixing.<br />
<br />
In the example below LightDM and MATE with ALSA was installed with PulseAudio removed. PulseAudio could also be used but it requires a more complicated configuration to maintain high audio quality. The relevant hardware used is an ATI Radeon HD 5850 and an Intel Sandy Bridge (onboard) HD 3000. You configuration may vary.<br />
<br />
Open {{ic|/etc/lightdm/lightdm.conf}} and follow the sample. Autologin is optional. This works both as multi-user multiseat and single user multi-seat. In the former case only the last user to login will have audio control and access. Specific hardware could be addressed in {{ic|/etc/asound.conf}} to allocate audio to both users simultaneously if required. In the latter case the sound card will be shared equally among the seats using ALSA with PulseAudio removed - libpulse itself should be kept for various software dependencies however:<br />
<br />
{{bc|1=<br />
[LightDM]<br />
greeter-user=lightdm<br />
log-directory=/var/log/lightdm<br />
run-directory=/run/lightdm<br />
<br />
[SeatDefaults]<br />
xserver-command=/usr/bin/X<br />
greeter-session=lightdm-gtk-greeter<br />
greeter-show-manual-login=true<br />
user-session=mate<br />
session-wrapper=/etc/lightdm/Xsession<br />
pam-service=lightdm-autologin<br />
exit-on-failure=true<br />
<br />
[Seat:0]<br />
xserver-command=/usr/bin/X :0 -sharevts<br />
xserver-layout=Layout0<br />
#autologin-user=joeblow<br />
#autologin-user-timeout=-1<br />
#session-setup-script=/etc/lightdm/scripts/sound_start<br />
#session-cleanup-script=/etc/lightdm/scripts/sound_stop<br />
<br />
[Seat:1]<br />
xserver-command=/usr/bin/X :1 -sharevts<br />
xserver-layout=Layout1<br />
#autologin-user=jillschmill<br />
#autologin-user-timeout=-1<br />
}}<br />
<br />
Next, remove respective {{ic|~/.asoundrc}} files (as well as related PulseAudio config files if you removed that) and follow this template with {{ic|/etc/asound.conf}} for the sound:<br />
<br />
{{bc|<br />
ctl.equal {<br />
type equal;<br />
}<br />
<br />
pcm.plugequal {<br />
type equal;<br />
# Modify the line below if you do not<br />
# want to use sound card 0.<br />
#slave.pcm "plughw:0,0";<br />
#by default we want to play from more sources at time:<br />
slave.pcm "plug:dmix";<br />
}<br />
#pcm.equal {<br />
# If you do not want the equalizer to be your<br />
# default soundcard comment the following<br />
# line and uncomment the above line. (You can<br />
# choose it as the output device by addressing<br />
# it with specific apps,eg mpg123 -a equal 06.Back_In_Black.mp3)<br />
pcm.!default {<br />
type plug;<br />
slave.pcm plugequal;<br />
}<br />
}}<br />
<br />
Finally you must set the {{ic|/etc/X11/xorg.conf}} file. You'll notice some options have been commented out which could be set according to your needs. Here is a sample, adjust to your own system configuration after determing hardware information:<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "DefaultServerLayout" "Layout1"<br />
# Option "AllowMouseOpenFail" "true"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "DontZap" "false"<br />
Option "Xinerama" "0"<br />
Option "AutoAddGPU" "FALSE"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "kbd_0" "CoreKeyboard"<br />
InputDevice "mouse_0" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true" <br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout1"<br />
Screen 0 "Screen1" 0 0<br />
InputDevice "kbd_1" "CoreKeyboard"<br />
InputDevice "mouse_1" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true"<br />
EndSection<br />
<br />
Section "Module"<br />
# Load "dri2"<br />
# Load "glamoregl"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.6:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:04:00.0-usb-0:1:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.5:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.3:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
# Option "DPMS" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "radeon"<br />
# Option "AccelMethod" "glamor"<br />
Option "AccelMethod" "EXA"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:1:0:0"<br />
Screen 0<br />
# Option "EXAVSync"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device1"<br />
Driver "intel"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:0:2:0"<br />
Screen 0<br />
# Option "AccelMethod" "UXA"<br />
# Option "TearFree" "1"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Device0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen1"<br />
Device "Device1"<br />
Monitor "Monitor1"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
Make sure to delete the {{ic|~/.Xauthority}} file in respective user directories before the initial reboot.<br />
<br />
===For Auto Login multiseat (without Display Manager)===<br />
<br />
edit a script /boot/twin.sh<br />
{{bc|<br />
#!/bin/bash<br />
cmd1="/bin/bash --login -c \"/usr/bin/xinit --"<br />
cmd2="-nolisten tcp -keeptty -novtswitch -config xorg.multiseat.conf"<br />
usr=(user1 user2) # FIXME: assume user1, user2 is valid user id<br />
declare -a pid<br />
while true ; do<br />
for ((i=0; i<${#usr[*]}; i++)) ; do<br />
echo "usr[$i]=${usr[$i]} pid=${pid[$i]}"<br />
if [ -z "${pid[$i]}" ] || [ ! -d "/proc/${pid[$i]}" ] ; then<br />
# echo "pid ${pid[$i]} killed, execute again" <br />
cmd3="-layout seat$i vt0"$((7+i))"\""<br />
if [ $i -gt 0 ] ; then<br />
cmd3="-sharevts $cmd3"<br />
fi<br />
#echo "cmd3=$cmd3"<br />
/bin/su ${usr[$i]} -l -c "$cmd1 :$i $cmd2 $cmd3" &<br />
pid[$i]=$!<br />
#echo "new pid=${pid[$i]}"<br />
fi<br />
done<br />
sleep 5 # check process exist per 5 second<br />
done<br />
}}<br />
<br />
Open {{ic|/etc/inittab}} and setup as follows:<br />
<br />
{{bc|<br />
#id:3:initdefault:<br />
id:5:initdefault:<br />
...<br />
x2:5:once:/root/twin.sh > /root/twin.log 2>&1<br />
}}<br />
<br />
==Troubleshooting==<br />
<br />
===My Windows key doesn't work anymore===<br />
<br />
Put this in [[Execute commands after X start|a startup file]]:<br />
xmodmap -e "add Mod4 = Super_L Super_R"<br />
<br />
===Unreliable behaviour (black picture without cursor)===<br />
<br />
If everything seems to be set up correctly, but for some reason you always get a black picture without a cursor, try setting the first initialized card in the BIOS to be the PCI card one.<br />
<br />
===Little black boxes/dots on the desktop===<br />
<br />
This is actually portions of the virtual terminals being painted on top of X. It seems to be caused by the Linux kernel framebuffer. This can be fixed by disabling the framebuffer, or by removing the "-sharevts" option from the primary seat's X args.<br />
<br />
===Multimedia keys not working===<br />
<br />
If your keyboard(s) has extra "multimedia" keys, you may find that they stopped working in your multiseat setup. This is because such keyboards are often represented as more then one "event" device. As you did above, cat each /dev/input/event* device, this time pressing multimedia keys. Once you've found the right event device, add a separate keyboard InputDevice section for it, then add that InputDevice section to the corresponding ServerLayout section with the "SendCoreEvents" option, which indicates that input from this device should be handled, despite not being the core keyboard. In the end you should have sections something like the following:<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "Keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event6"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "Keyboard0Multimedia"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event7"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "Keyboard0" "CoreKeyboard"<br />
InputDevice "Keyboard0Multimedia" "SendCoreEvents"<br />
InputDevice "Mouse0" "CorePointer"<br />
Option "AutoAddDevices" "no"<br />
EndSection<br />
}}<br />
<br />
===The Ctrl-Alt-Fx, Alt-Fx keys mess up with virtual terminals===<br />
<br />
(Oct 2010) I follows this guide and everything works, except for Atl-F1, Atl-F2,... mess things up. Then I follow this guide https://help.ubuntu.com/community/MultiseatX (read the part for Ubuntu 10.04):<br />
<br />
{{bc|<br />
# cd /usr/bin<br />
# ln -s X X0<br />
# ln -s X X1<br />
}}<br />
<br />
Then fix in the '''/usr/share/config/kdm/kdmrc''' as follow<br />
<br />
{{bc|1=<br />
[General]<br />
ConsoleTTYs=tty1,tty2,tty3,tty4,tty5,tty6<br />
ServerVTs=7,8<br />
StaticServers=:0,:1<br />
ReserveServers=:2,:3<br />
...<br />
<br />
[X-:0-Core]<br />
ServerVT=8<br />
ServerCmd=/usr/bin/X1<br />
ServerArgsLocal=-nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0<br />
<br />
[X-:1-Core]<br />
ServerVT=7<br />
ServerCmd=/usr/bin/X0<br />
ServerArgsLocal=-nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0<br />
...<br />
}}<br />
<br />
It works for my computer: one on-board Intel card (xf86-video-intel driver), and one Nvidia card (xf86-video-nouveau driver). You can check if the parameters are passed correctly by:<br />
<br />
{{bc|<nowiki><br />
$ ps aux | grep 'PCI' | grep -Ev 'grep'<br />
root 16993 1.6 1.3 32900 26772 ? S 08:09 0:19 /usr/bin/X0 :1 vt7 -nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0 -auth /var/run/xauth/A:1-ES6CCb<br />
root 17124 5.9 0.5 18996 11980 ? S 08:09 1:09 /usr/bin/X1 :0 vt8 -nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0 -auth /var/run/xauth/A:0-Wgiyza<br />
<br />
</nowiki>}}<br />
<br />
The '''ServerVT=7''', '''ServerVT=8''' would be pass to as '''vt7''', '''vt8'''<br />
<br />
==Final configuration==<br />
<br />
===/etc/X11/xorg.conf===<br />
<br />
This is my full xorg.conf with multiseat that works:<br />
{{bc|<br />
Section "Module"<br />
Load "dbe"<br />
<br />
SubSection "extmod"<br />
Option "omit xfree86-dga"<br />
EndSubSection<br />
<br />
Load "type1"<br />
Load "speedo"<br />
Load "freetype"<br />
Load "glx"<br />
EndSection<br />
<br />
<br />
Section "Files"<br />
RgbPath "/usr/share/X11/rgb"<br />
<br />
FontPath "/usr/share/fonts/misc"<br />
FontPath "/usr/share/fonts/75dpi"<br />
FontPath "/usr/share/fonts/100dpi"<br />
FontPath "/usr/share/fonts/TTF"<br />
FontPath "/usr/share/fonts/Type1"<br />
FontPath "/usr/share/fonts/msfonts"<br />
FontPath "/usr/share/fonts/misc2"<br />
FontPath "/usr/share/fonts/local"<br />
FontPath "/usr/local/share/fonts"<br />
EndSection<br />
<br />
<br />
Section "ServerFlags"<br />
# Option "DontZap"<br />
Option "AllowMouseOpenFail" "true"<br />
# Option "DefaultServerLayout" "alltogether"<br />
Option "Xinerama" "0"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event5"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2" # Auto detect<br />
Option "Device" "/dev/input/mouse2"<br />
Option "ZAxisMapping" "4 5"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse1"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse1"<br />
EndSection<br />
<br />
<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:1:0:0"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "nvidia1"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:0:10:0"<br />
EndSection<br />
<br />
<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "screen1"<br />
Device "nvidia1"<br />
Monitor "cpdm151"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1024x768" "800x600"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat1"<br />
Screen "screen1" 0 0<br />
InputDevice "mouse1" "CorePointer"<br />
InputDevice "keyboard1" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "Extensions"<br />
Option "Composite" "Disable"<br />
Option "RENDER" "Enable"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "cpdm151"<br />
Option "dpms"<br />
HorizSync 30-61<br />
VertRefresh 60<br />
EndSection<br />
}}<br />
<br />
===/opt/kde/share/config/kdm/kdmrc===<br />
<br />
This is my kdmrc:<br />
<br />
{{bc|1=<br />
[General]<br />
ConfigVersion=2.3<br />
ConsoleTTYs=vc/1,vc/2,vc/3,vc/4,vc/5,vc/6<br />
PidFile=/var/run/kdm.pid<br />
ReserveServers=:2,:3<br />
ServerVTs=-7<br />
StaticServers=:0,:1<br />
<br />
[Shutdown]<br />
BootManager=Grub<br />
HaltCmd=/sbin/halt<br />
RebootCmd=/sbin/reboot<br />
<br />
[X-*-Core]<br />
AllowNullPasswd=false<br />
AllowRootLogin=false<br />
AllowShutdown=Root<br />
Authorize=true<br />
AutoReLogin=false<br />
ClientLogFile=.xsession-errors-%s<br />
Reset=/opt/kde/share/config/kdm/Xreset<br />
Resources=/opt/kde/share/config/kdm/Xresources<br />
Session=/opt/kde/share/config/kdm/Xsession<br />
SessionsDirs=/etc/X11/sessions,/usr/share/xsessions,/opt/kde/share/apps/kdm/sessions<br />
Setup=/opt/kde/share/config/kdm/Xsetup<br />
Startup=/opt/kde/share/config/kdm/Xstartup<br />
<br />
[X-*-Greeter]<br />
AllowConsole=true<br />
AntiAliasing=true<br />
AuthComplain=true<br />
BackgroundCfg=/opt/kde/share/config/kdm/backgroundrc<br />
ColorScheme=<br />
DefaultUser=<br />
EchoMode=OneStar<br />
FaceSource=PreferUser<br />
FailFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
FocusPasswd=false<br />
ForgingSeed=1097313140<br />
GUIStyle=<br />
GreetFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
GreetString=Arch Linux %r (%h)<br />
GreeterPos=50,50<br />
HiddenUsers=root<br />
Language=en_US<br />
LogoArea=None<br />
LogoPixmap=<br />
MaxShowUID=65000<br />
MinShowUID=500<br />
PreselectUser=None<br />
SelectedUsers=<br />
ShowUsers=NotHidden<br />
SortUsers=true<br />
StdFont=Tahoma,11,-1,5,50,0,0,0,0,0<br />
UseBackground=false<br />
UserCompletion=false<br />
UserList=true<br />
<br />
[X-:*-Core]<br />
AllowNullPasswd=true<br />
AllowRootLogin=true<br />
AllowShutdown=All<br />
NoPassEnable=false<br />
NoPassUsers=<br />
<br />
[X-:*-Greeter]<br />
AllowClose=true<br />
DefaultUser=glenn<br />
FocusPasswd=true<br />
LoginMode=DefaultLocal<br />
PreselectUser=Previous<br />
<br />
[X-:0-Core]<br />
AutoLoginAgain=false<br />
AutoLoginDelay=0<br />
AutoLoginEnable=false<br />
AutoLoginLocked=false<br />
AutoLoginUser=glenn<br />
ClientLogFile=.xsession-errors<br />
ServerArgsLocal=-nolisten tcp -layout seat0 -sharevts -novtswitch <br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch <br />
<br />
[Xdmcp]<br />
Enable=false<br />
Willing=/opt/kde/share/config/kdm/Xwilling<br />
Xaccess=/opt/kde/share/config/kdm/Xaccess<br />
}}<br />
<br />
==Related problems==<br />
<br />
===PulseAudio===<br />
If two users want to use the sound card simultaneously, it is necessary to use a sound server, [[PulseAudio]] being most prevalent. Usually, the PulseAudio server runs only for active user and does not allow for multiple user instances. Solution to this problem is using the system-wide PulseAudio server. Although this approach is discouraged by its authors, it is probably most applicable setup.<br />
<br />
;Configuring for system-wide PulseAudio<br />
* Create user pulse and put him into group audio (PulseAudio drops root privileges and changes to user pulse. Group membership allows for device access.)<br />
* Create group pulse-access and put users, who will play sound locally into it (Group membership is used for access control for local access to PA daemon.)<br />
* In /etc/pulse/default.pa state explicitly the access rights<br />
{{bc|1=<br />
load-module module-native-protocol-unix auth-group=pulse-access auth-group-enable=1<br />
}}<br />
<br />
Start PA as system-wide, under root: {{bc|pulseaudio --system}}<br />
<br />
In {{ic|/var/run/pulse}} should appear files for communication with daemon, namely pid and native. <br />
<br />
;User access<br />
You can check communication with system daemon as non-root by e.g. {{ic|pactl -s "unix:/var/run/pulse/native" list}}.<br />
<br />
It is possible to enable automatic connection to local daemon in /etc/pulse/client.conf<br />
{{bc|1=<br />
auto-connect-localhost = yes<br />
}}<br />
<br />
The users should be able to connect to PA server. All the cons for system-wide daemon become essentially pros, e.g. ability to control volume of other users streams in pavucontrol.<br />
<br />
;Troubleshooting<br />
It is possible to enable the http interface to PA for debugging in /etc/pulse/default.pa<br />
{{ic|load-module module-http-protocol-tcp}} and then connect to it at http://localhost:4714/<br />
<br />
==See also==<br />
*[https://bbs.archlinux.org/viewtopic.php?id=105450 The original Arch Forums thread].<br />
<br />
*The arckwiki page [[Multi-pointer X]] explains how to setup two separate pair of devices on the same session.</div>Shillshockedhttps://wiki.archlinux.org/index.php?title=Xorg_multiseat&diff=296945Xorg multiseat2014-02-12T05:43:07Z<p>Shillshocked: /* For LightDM (Light Display Manager) */</p>
<hr />
<div>[[Category:X Server]]<br />
{{Expansion|Is it possible login two users without keyin user name and password?<br\>systemd makes this easier, cover systemd ways}}<br />
Multiseat is a certain setup where multiple users work simultaneously on one computer. This is achieved by having two monitors, two keyboards and two mice. The advantages are quite obvious:<br />
* Less power consumption (only one computer)<br />
* Less hardware to purchase<br />
* All the cool kids do it<br />
<br />
==Requirements==<br />
<br />
===Keyboards and mice===<br />
<br />
Any standard PS/2 or USB keyboards will suffice. Same thing for mice.<br />
<br />
===Graphics hardware===<br />
<br />
For the best possible result you'll need two graphics cards. I used an nVidia FX5500 AGP and an nVidia 6200 PCI. If you look around a bit you can certainly find new and decent PCI graphics card for a soft price.<br />
<br />
It is possible to use only one videocard which has dual heads (like most nvidia cards will have), but this has some limitations: you have to use Xephyr on the second monitor which seems quite a messy solution from what I've read, and for optimal usage both screens need the same resolution.<br />
<br />
If you have two pci-express slots, take advantage of them! That way you'll even be able to play two games at the same time. (PCI is too slow to play comfortably)<br />
<br />
===Processors and memory===<br />
<br />
If you really are working with two users on the same computer, I'd at least recommend a dual-core processor and plenty of RAM. A fast hard drive (10.000 RPM or higher) is also recommended for comfortable use.<br />
<br />
===Software===<br />
<br />
You'll need Xorg with the drivers for your graphics card (according to some sources, the closed source nvidia driver works better than the open source nv driver for this, I have t tested this myself) and the evdev (xf86-input-evdev) driver. That's all. All this can be found in the Arch Linux core and extra repositories.<br />
<br />
===Some X knowledge===<br />
<br />
If you know how X works this will be a lot easier. Before you start, I recommend generating a clean configuration with xorgconfig that works with a single screen. Read through this xorg configuration and make yourself familiar. And as usual the manpages will provide you with most of the answers. You may reference some man pages: xorg, xserver, startx, xdm, xinit.<br />
'''sudo X -configure''', '''X -showopts''' may give you some hint.<br />
<br />
==Definitions==<br />
<br />
For this article to be clear, I'll be using the following definitions:<br />
* screen: A screen is something Xorg can display its stuff on. A screen has a monitor and a graphics card assigned to it.<br />
* monitor: A physical monitor like the one you're now sitting in front of.<br />
* server layout: a definition of which screen, keyboard and mouse to use.<br />
* seat: A workplace with a physical monitor, physical keyboard and physical mouse.<br />
<br />
==Tips and tricks==<br />
<br />
* Set up ssh on your computer, so you can ssh to the machine from another computer (such as a laptop). This is very useful because you'll probably run into X not responding anymore or not giving you picture at all.<br />
* Finding out which keyboard and mouse is which: open a terminal and use cat to find out. For example, {{ic|cat /dev/input/mouse1}}. If you then move your mouse and you see all weird things happening than that is the mouse you're moving. Same goes for keyboards, which are called eventN.<br />
* Try a basic configuration first. Don't start with the fancy stuff yet, get a very basic Xorg working first.<br />
* Leave your {{ic|xorg.conf}} alone and create a new file, called {{ic|xorg.conf.multiseat}} in {{ic|/etc/X11}} to store your new multiseat configuration. After this configuration is working you can overwrite the {{ic|xorg.conf}} file with your new {{ic|xorg.conf.multiseat}}.<br />
* Create a backup of all relevant configuration files. What do you mean you'll skip this one?<br />
* Take a look at the full configuration I used at the end of this article before you start.<br />
<br />
==About evdev==<br />
<br />
evdev is an Xorg driver which can make use of the kernel event devices, which you can find in {{ic|/dev/input}}.<br />
<br />
==Setting up Xorg==<br />
<br />
The logic behind this is that you have two server layouts, each assigned with their own keyboard, mouse, video card and monitor. <br />
<br />
===The basics===<br />
<br />
First of all we'll set up the basics for xorg.<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "AllowMouseOpenFail" "on"<br />
Option "AllowEmptyInput" "on"<br />
Option "ZapWarning" "on"<br />
Option "HandleSpecialKeys" "off" # Zapping on<br />
Option "DRI2" "on"<br />
Option "Xinerama" "off"<br />
EndSection<br />
}}<br />
<br />
===Defining available input devices===<br />
<br />
This part of the configuration tells Xorg which input devices it has available. Input devices are keyboards and mice, but can also be, for example, touchscreens and pens.<br />
<br />
This section defines my first keyboard, called keyboard0. As you can seen it uses the evdev driver. {{ic|/dev/input/event1}} corresponds with the keyboard connected to the PS/2 port of my computer. Create a section like this for each keyboard you have. Don't forget to modify the identifier of course. Keep the identifier simple and match it with the other names. This keyboard0 will be used for screen0 together with mouse0.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
# Option "Device" "/dev/input/by-path/platform-i8042-serio-0-event-kbd" <br />
# Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-kbd"<br />
Option "xkb_rules" "evdev"<br />
Option "xkb_model" "evdev"<br />
Option "xkb_layout" "us"<br />
Option "GrabDevice" "on" # prevent send event to other X-servers<br />
# If you are using a non en_US keyboard, set the layout here.<br />
# Option "XkbLayout" "be"<br />
EndSection<br />
}}<br />
<br />
<br />
This section defines my first mouse, called mouse0. This uses the regular mouse driver. /dev/input/mouse2 corresponds with the mouse connected to the PS/2 port of my computer. Create a section like this for each mouse you have.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse2"<br />
EndSection<br />
# or use evdev, that could assign by id<br />
Section "InputDevice"<br />
Identifier "Mouse0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
}}<br />
<br />
===Graphics card===<br />
<br />
Now we'll set up the graphics card for each screen.<br />
<br />
{{bc|<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "NoLogo" "1" # Remove nvidia branding at startup<br />
BusId "PCI:1:0:0"<br />
Option "ProbeAllGpus" "false" # Only required for nvidia<br />
EndSection<br />
}}<br />
<br />
This section defines my first graphics card, called nvidia0. This uses the closed source nvidia driver. Take a close look at the BusID. This option specifies which hardware card to use. You can find out the BusId's with lspci. However, you'll soon find out this doesn't always match. That's because lspci displays the device address in hexadecimal form. Xorg however uses decimal form. So you'll need to convert your address from hexadecimal form to decimal. Thus a device address of 0:0a:0 in lspci would become 0:10:0 in {{ic|xorg.conf}}.<br />
<br />
Create a section like this for every graphics card you have.<br />
<br />
===Screens===<br />
<br />
This section defines my first screen, called screen0. Pay close attention to the "monitor" option. For easy recognition I called it the model of my monitor.<br />
<br />
{{bc|<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
}}<br />
<br />
Create a section like this for every screen you have.<br />
<br />
===Monitors===<br />
<br />
This section defines my first monitor, l1730s. Pay close attention to the identifier.<br />
<br />
{{bc|<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
}}<br />
<br />
Create section like this for every monitor you have.<br />
<br />
===Serverlayout===<br />
<br />
Here's the fun stuff. This is how everything is added up. This is my first seat, called seat0. Here I tell Xorg for the server layout called "seat0" to use my screen0, which is attached to nvidia0, using keyboard0 and mouse0.<br />
<br />
The AutoAddDevices option is now needed to keep HAL from automatically adding all your input devices to all the X servers.<br />
<br />
{{bc|<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "Clone" "off"<br />
Option "AutoAddDevices" "off"<br />
Option "DisableModInDev" "true"<br />
Option "SingleCard" "on" # use this to simplfied isolatedevice option <br />
EndSection<br />
}}<br />
<br />
Create a section like this for every seat you have with their respective keyboards, mice and screens.<br />
<br />
==Testing==<br />
Before we start modifying our login manager, we'll first start with testing out the individual seats. If these are working, then we're good to go.<br />
<br />
I've used twm (tiny window manager) to test out if my seats work, but there's no reason you can't use KDE, gnome, or any other desktop environment or window manager. I've used this in my {{ic|~/.xinitrc}}:<br />
exec twm<br />
<br />
Use the following command to test out an individual seat:<br />
startx -- -layout seat0 -config xorg.conf.multiseat<br />
<br />
Do this for every seat you have. If they are all working correctly and the keyboard/mouse combination matches, then congratulations! You are almost finished! In case you are wondering why I didn't you use the full path to my new configuration file, that's because X doesn't allow that when running as non-root. It will search for xorg.conf.multiseat relative to {{ic|/etc/X11}}.<br />
<br />
==Setting up the loginmanager==<br />
<br />
===For KDM (KDE's Display Manager)===<br />
<br />
Open {{ic|/usr/share/config/kdm/kdmrc}} and set the following variables:<br />
<br />
{{bc|1=<br />
StaticServers=:0,:1 #In the case of two seats. If you have three this would become :0,:1,:2 and so forth.<br />
ReserveServers=:2,:3 #You can define here as many as you want, but these should always start at the highest seat + 1.<br />
}}<br />
Next you'll need to add an [X-:n-Core] for each seat (where n = the seat)<br />
{{bc|1=<br />
[X-:0-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat0<br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch<br />
}}<br />
<br />
Add section like this for every seat you have, and do not forget to change the :0 and the -layout seat0. Note that the "-sharevts" and "-novtswitch" options should be added for all seats ''except'' the first one. Otherwise, you can end with rectangles of virtual terminals "showing through" on your primary screen.<br />
<br />
===For GDM (Gnome's Display Manager)===<br />
{{note|The following will work with GDM 2.20 but not with newer versions of GDM. GDM 2.20 is in AUR.}}<br />
<br />
Open {{ic|/etc/gdm/custom.conf}} and set the following variables (This sample demos two seats):<br />
{{bc|1=<br />
[servers]<br />
0=Standard0<br />
1=Standard1<br />
<br />
[server-Standard0]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat0<br />
flexible=true<br />
<br />
[server-Standard1]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat1<br />
flexible=true<br />
}}<br />
<br />
===For XDM (X Display Manager)===<br />
<br />
Open {{ic|/etc/X11/xdm/Xservers}} and set the following variables (This sample demos two seats):<br />
<br />
{{bc|<br />
# NOTE: don't add -sharevts on seat0, otherwise it may reset in about 10~20 minutes automatically.<br />
:0 local /usr/bin/X :0 vt07 -nolisten tcp -novtswitch -layout seat0 -config xorg.conf.multiseat<br />
:1 local /usr/bin/X :1 vt08 -nolisten tcp -sharevts -novtswitch -layout seat1 -config xorg.conf.multiseat<br />
}}<br />
<br />
Also if you use the Archlinux theme edit {{ic|/etc/X11/xdm/xdm-config}} for every screen:<br />
<br />
{{bc|<br />
DisplayManager._0.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._0.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._0.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
DisplayManager._1.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._1.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._1.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
}}<br />
<br />
===For LightDM (Light Display Manager)===<br />
<br />
LightDM works well with ALSA only and PulseAudio removed if you wish to have shared audio, an alsamixer equalizer and software mixing.<br />
<br />
In the example below LightDM and MATE with ALSA was installed with PulseAudio removed. PulseAudio could also be used but it requires a more complicated configuration to maintain high audio quality. The relevant hardware used is an ATI Radeon HD 5850 and an Intel Sandy Bridge (onboard) HD 3000. You configuration may vary.<br />
<br />
Open {{ic|/etc/lightdm/lightdm.conf}} and follow the sample. Autologin is optional. This works both as multi-user multiseat and single user multi-seat. In the former case only the last user to login will have audio control and access. Specific hardware could be addressed in {{ic|/etc/asound.conf}} to allocate audio to both users simultaneously if required. In the latter case the sound card will be shared equally among the seats using ALSA with PulseAudio removed - libpulse itself should be kept for various software dependencies however:<br />
<br />
{{bc|1=<br />
[LightDM]<br />
greeter-user=lightdm<br />
log-directory=/var/log/lightdm<br />
run-directory=/run/lightdm<br />
<br />
[SeatDefaults]<br />
xserver-command=/usr/bin/X<br />
greeter-session=lightdm-gtk-greeter<br />
greeter-show-manual-login=true<br />
user-session=mate<br />
session-wrapper=/etc/lightdm/Xsession<br />
pam-service=lightdm-autologin<br />
exit-on-failure=true<br />
<br />
[Seat:0]<br />
xserver-command=/usr/bin/X :0 -sharevts<br />
xserver-layout=Layout0<br />
#autologin-user=joeblow<br />
#autologin-user-timeout=-1<br />
#session-setup-script=/etc/lightdm/scripts/sound_start<br />
#session-cleanup-script=/etc/lightdm/scripts/sound_stop<br />
<br />
[Seat:1]<br />
xserver-command=/usr/bin/X :1 -sharevts<br />
xserver-layout=Layout1<br />
#autologin-user=jillschmill<br />
#autologin-user-timeout=-1<br />
}}<br />
<br />
Next, remove respective {{ic|~/.asoundrc}} files (as well as related PulseAudio config files if you removed that) and follow this template with {{ic|/etc/asound.conf}} for the sound:<br />
<br />
{{bc|<br />
ctl.equal {<br />
type equal;<br />
}<br />
<br />
pcm.plugequal {<br />
type equal;<br />
# Modify the line below if you do not<br />
# want to use sound card 0.<br />
#slave.pcm "plughw:0,0";<br />
#by default we want to play from more sources at time:<br />
slave.pcm "plug:dmix";<br />
}<br />
#pcm.equal {<br />
# If you do not want the equalizer to be your<br />
# default soundcard comment the following<br />
# line and uncomment the above line. (You can<br />
# choose it as the output device by addressing<br />
# it with specific apps,eg mpg123 -a equal 06.Back_In_Black.mp3)<br />
pcm.!default {<br />
type plug;<br />
slave.pcm plugequal;<br />
}<br />
}}<br />
<br />
Finally you must set the {{ic|/etc/X11/xorg.conf}} file. Here is a sample, adjust to your own system configuration after determing hardware information:<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "DefaultServerLayout" "Layout1"<br />
# Option "AllowMouseOpenFail" "true"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "DontZap" "false"<br />
Option "Xinerama" "0"<br />
Option "AutoAddGPU" "FALSE"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "kbd_0" "CoreKeyboard"<br />
InputDevice "mouse_0" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true" <br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout1"<br />
Screen 0 "Screen1" 0 0<br />
InputDevice "kbd_1" "CoreKeyboard"<br />
InputDevice "mouse_1" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true"<br />
EndSection<br />
<br />
Section "Module"<br />
# Load "dri2"<br />
# Load "glamoregl"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.6:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:04:00.0-usb-0:1:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.5:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.3:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
# Option "DPMS" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "radeon"<br />
# Option "AccelMethod" "glamor"<br />
Option "AccelMethod" "EXA"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:1:0:0"<br />
Screen 0<br />
# Option "EXAVSync"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device1"<br />
Driver "intel"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:0:2:0"<br />
Screen 0<br />
# Option "AccelMethod" "UXA"<br />
# Option "TearFree" "1"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Device0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen1"<br />
Device "Device1"<br />
Monitor "Monitor1"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
Make sure to delete the {{ic|~/.Xauthority}} file in respective user directories before the initial reboot.<br />
<br />
===For Auto Login multiseat (without Display Manager)===<br />
<br />
edit a script /boot/twin.sh<br />
{{bc|<br />
#!/bin/bash<br />
cmd1="/bin/bash --login -c \"/usr/bin/xinit --"<br />
cmd2="-nolisten tcp -keeptty -novtswitch -config xorg.multiseat.conf"<br />
usr=(user1 user2) # FIXME: assume user1, user2 is valid user id<br />
declare -a pid<br />
while true ; do<br />
for ((i=0; i<${#usr[*]}; i++)) ; do<br />
echo "usr[$i]=${usr[$i]} pid=${pid[$i]}"<br />
if [ -z "${pid[$i]}" ] || [ ! -d "/proc/${pid[$i]}" ] ; then<br />
# echo "pid ${pid[$i]} killed, execute again" <br />
cmd3="-layout seat$i vt0"$((7+i))"\""<br />
if [ $i -gt 0 ] ; then<br />
cmd3="-sharevts $cmd3"<br />
fi<br />
#echo "cmd3=$cmd3"<br />
/bin/su ${usr[$i]} -l -c "$cmd1 :$i $cmd2 $cmd3" &<br />
pid[$i]=$!<br />
#echo "new pid=${pid[$i]}"<br />
fi<br />
done<br />
sleep 5 # check process exist per 5 second<br />
done<br />
}}<br />
<br />
Open {{ic|/etc/inittab}} and setup as follows:<br />
<br />
{{bc|<br />
#id:3:initdefault:<br />
id:5:initdefault:<br />
...<br />
x2:5:once:/root/twin.sh > /root/twin.log 2>&1<br />
}}<br />
<br />
==Troubleshooting==<br />
<br />
===My Windows key doesn't work anymore===<br />
<br />
Put this in [[Execute commands after X start|a startup file]]:<br />
xmodmap -e "add Mod4 = Super_L Super_R"<br />
<br />
===Unreliable behaviour (black picture without cursor)===<br />
<br />
If everything seems to be set up correctly, but for some reason you always get a black picture without a cursor, try setting the first initialized card in the BIOS to be the PCI card one.<br />
<br />
===Little black boxes/dots on the desktop===<br />
<br />
This is actually portions of the virtual terminals being painted on top of X. It seems to be caused by the Linux kernel framebuffer. This can be fixed by disabling the framebuffer, or by removing the "-sharevts" option from the primary seat's X args.<br />
<br />
===Multimedia keys not working===<br />
<br />
If your keyboard(s) has extra "multimedia" keys, you may find that they stopped working in your multiseat setup. This is because such keyboards are often represented as more then one "event" device. As you did above, cat each /dev/input/event* device, this time pressing multimedia keys. Once you've found the right event device, add a separate keyboard InputDevice section for it, then add that InputDevice section to the corresponding ServerLayout section with the "SendCoreEvents" option, which indicates that input from this device should be handled, despite not being the core keyboard. In the end you should have sections something like the following:<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "Keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event6"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "Keyboard0Multimedia"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event7"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "Keyboard0" "CoreKeyboard"<br />
InputDevice "Keyboard0Multimedia" "SendCoreEvents"<br />
InputDevice "Mouse0" "CorePointer"<br />
Option "AutoAddDevices" "no"<br />
EndSection<br />
}}<br />
<br />
===The Ctrl-Alt-Fx, Alt-Fx keys mess up with virtual terminals===<br />
<br />
(Oct 2010) I follows this guide and everything works, except for Atl-F1, Atl-F2,... mess things up. Then I follow this guide https://help.ubuntu.com/community/MultiseatX (read the part for Ubuntu 10.04):<br />
<br />
{{bc|<br />
# cd /usr/bin<br />
# ln -s X X0<br />
# ln -s X X1<br />
}}<br />
<br />
Then fix in the '''/usr/share/config/kdm/kdmrc''' as follow<br />
<br />
{{bc|1=<br />
[General]<br />
ConsoleTTYs=tty1,tty2,tty3,tty4,tty5,tty6<br />
ServerVTs=7,8<br />
StaticServers=:0,:1<br />
ReserveServers=:2,:3<br />
...<br />
<br />
[X-:0-Core]<br />
ServerVT=8<br />
ServerCmd=/usr/bin/X1<br />
ServerArgsLocal=-nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0<br />
<br />
[X-:1-Core]<br />
ServerVT=7<br />
ServerCmd=/usr/bin/X0<br />
ServerArgsLocal=-nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0<br />
...<br />
}}<br />
<br />
It works for my computer: one on-board Intel card (xf86-video-intel driver), and one Nvidia card (xf86-video-nouveau driver). You can check if the parameters are passed correctly by:<br />
<br />
{{bc|<nowiki><br />
$ ps aux | grep 'PCI' | grep -Ev 'grep'<br />
root 16993 1.6 1.3 32900 26772 ? S 08:09 0:19 /usr/bin/X0 :1 vt7 -nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0 -auth /var/run/xauth/A:1-ES6CCb<br />
root 17124 5.9 0.5 18996 11980 ? S 08:09 1:09 /usr/bin/X1 :0 vt8 -nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0 -auth /var/run/xauth/A:0-Wgiyza<br />
<br />
</nowiki>}}<br />
<br />
The '''ServerVT=7''', '''ServerVT=8''' would be pass to as '''vt7''', '''vt8'''<br />
<br />
==Final configuration==<br />
<br />
===/etc/X11/xorg.conf===<br />
<br />
This is my full xorg.conf with multiseat that works:<br />
{{bc|<br />
Section "Module"<br />
Load "dbe"<br />
<br />
SubSection "extmod"<br />
Option "omit xfree86-dga"<br />
EndSubSection<br />
<br />
Load "type1"<br />
Load "speedo"<br />
Load "freetype"<br />
Load "glx"<br />
EndSection<br />
<br />
<br />
Section "Files"<br />
RgbPath "/usr/share/X11/rgb"<br />
<br />
FontPath "/usr/share/fonts/misc"<br />
FontPath "/usr/share/fonts/75dpi"<br />
FontPath "/usr/share/fonts/100dpi"<br />
FontPath "/usr/share/fonts/TTF"<br />
FontPath "/usr/share/fonts/Type1"<br />
FontPath "/usr/share/fonts/msfonts"<br />
FontPath "/usr/share/fonts/misc2"<br />
FontPath "/usr/share/fonts/local"<br />
FontPath "/usr/local/share/fonts"<br />
EndSection<br />
<br />
<br />
Section "ServerFlags"<br />
# Option "DontZap"<br />
Option "AllowMouseOpenFail" "true"<br />
# Option "DefaultServerLayout" "alltogether"<br />
Option "Xinerama" "0"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event5"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2" # Auto detect<br />
Option "Device" "/dev/input/mouse2"<br />
Option "ZAxisMapping" "4 5"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse1"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse1"<br />
EndSection<br />
<br />
<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:1:0:0"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "nvidia1"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:0:10:0"<br />
EndSection<br />
<br />
<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "screen1"<br />
Device "nvidia1"<br />
Monitor "cpdm151"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1024x768" "800x600"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat1"<br />
Screen "screen1" 0 0<br />
InputDevice "mouse1" "CorePointer"<br />
InputDevice "keyboard1" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "Extensions"<br />
Option "Composite" "Disable"<br />
Option "RENDER" "Enable"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "cpdm151"<br />
Option "dpms"<br />
HorizSync 30-61<br />
VertRefresh 60<br />
EndSection<br />
}}<br />
<br />
===/opt/kde/share/config/kdm/kdmrc===<br />
<br />
This is my kdmrc:<br />
<br />
{{bc|1=<br />
[General]<br />
ConfigVersion=2.3<br />
ConsoleTTYs=vc/1,vc/2,vc/3,vc/4,vc/5,vc/6<br />
PidFile=/var/run/kdm.pid<br />
ReserveServers=:2,:3<br />
ServerVTs=-7<br />
StaticServers=:0,:1<br />
<br />
[Shutdown]<br />
BootManager=Grub<br />
HaltCmd=/sbin/halt<br />
RebootCmd=/sbin/reboot<br />
<br />
[X-*-Core]<br />
AllowNullPasswd=false<br />
AllowRootLogin=false<br />
AllowShutdown=Root<br />
Authorize=true<br />
AutoReLogin=false<br />
ClientLogFile=.xsession-errors-%s<br />
Reset=/opt/kde/share/config/kdm/Xreset<br />
Resources=/opt/kde/share/config/kdm/Xresources<br />
Session=/opt/kde/share/config/kdm/Xsession<br />
SessionsDirs=/etc/X11/sessions,/usr/share/xsessions,/opt/kde/share/apps/kdm/sessions<br />
Setup=/opt/kde/share/config/kdm/Xsetup<br />
Startup=/opt/kde/share/config/kdm/Xstartup<br />
<br />
[X-*-Greeter]<br />
AllowConsole=true<br />
AntiAliasing=true<br />
AuthComplain=true<br />
BackgroundCfg=/opt/kde/share/config/kdm/backgroundrc<br />
ColorScheme=<br />
DefaultUser=<br />
EchoMode=OneStar<br />
FaceSource=PreferUser<br />
FailFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
FocusPasswd=false<br />
ForgingSeed=1097313140<br />
GUIStyle=<br />
GreetFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
GreetString=Arch Linux %r (%h)<br />
GreeterPos=50,50<br />
HiddenUsers=root<br />
Language=en_US<br />
LogoArea=None<br />
LogoPixmap=<br />
MaxShowUID=65000<br />
MinShowUID=500<br />
PreselectUser=None<br />
SelectedUsers=<br />
ShowUsers=NotHidden<br />
SortUsers=true<br />
StdFont=Tahoma,11,-1,5,50,0,0,0,0,0<br />
UseBackground=false<br />
UserCompletion=false<br />
UserList=true<br />
<br />
[X-:*-Core]<br />
AllowNullPasswd=true<br />
AllowRootLogin=true<br />
AllowShutdown=All<br />
NoPassEnable=false<br />
NoPassUsers=<br />
<br />
[X-:*-Greeter]<br />
AllowClose=true<br />
DefaultUser=glenn<br />
FocusPasswd=true<br />
LoginMode=DefaultLocal<br />
PreselectUser=Previous<br />
<br />
[X-:0-Core]<br />
AutoLoginAgain=false<br />
AutoLoginDelay=0<br />
AutoLoginEnable=false<br />
AutoLoginLocked=false<br />
AutoLoginUser=glenn<br />
ClientLogFile=.xsession-errors<br />
ServerArgsLocal=-nolisten tcp -layout seat0 -sharevts -novtswitch <br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch <br />
<br />
[Xdmcp]<br />
Enable=false<br />
Willing=/opt/kde/share/config/kdm/Xwilling<br />
Xaccess=/opt/kde/share/config/kdm/Xaccess<br />
}}<br />
<br />
==Related problems==<br />
<br />
===PulseAudio===<br />
If two users want to use the sound card simultaneously, it is necessary to use a sound server, [[PulseAudio]] being most prevalent. Usually, the PulseAudio server runs only for active user and does not allow for multiple user instances. Solution to this problem is using the system-wide PulseAudio server. Although this approach is discouraged by its authors, it is probably most applicable setup.<br />
<br />
;Configuring for system-wide PulseAudio<br />
* Create user pulse and put him into group audio (PulseAudio drops root privileges and changes to user pulse. Group membership allows for device access.)<br />
* Create group pulse-access and put users, who will play sound locally into it (Group membership is used for access control for local access to PA daemon.)<br />
* In /etc/pulse/default.pa state explicitly the access rights<br />
{{bc|1=<br />
load-module module-native-protocol-unix auth-group=pulse-access auth-group-enable=1<br />
}}<br />
<br />
Start PA as system-wide, under root: {{bc|pulseaudio --system}}<br />
<br />
In {{ic|/var/run/pulse}} should appear files for communication with daemon, namely pid and native. <br />
<br />
;User access<br />
You can check communication with system daemon as non-root by e.g. {{ic|pactl -s "unix:/var/run/pulse/native" list}}.<br />
<br />
It is possible to enable automatic connection to local daemon in /etc/pulse/client.conf<br />
{{bc|1=<br />
auto-connect-localhost = yes<br />
}}<br />
<br />
The users should be able to connect to PA server. All the cons for system-wide daemon become essentially pros, e.g. ability to control volume of other users streams in pavucontrol.<br />
<br />
;Troubleshooting<br />
It is possible to enable the http interface to PA for debugging in /etc/pulse/default.pa<br />
{{ic|load-module module-http-protocol-tcp}} and then connect to it at http://localhost:4714/<br />
<br />
==See also==<br />
*[https://bbs.archlinux.org/viewtopic.php?id=105450 The original Arch Forums thread].<br />
<br />
*The arckwiki page [[Multi-pointer X]] explains how to setup two separate pair of devices on the same session.</div>Shillshockedhttps://wiki.archlinux.org/index.php?title=Xorg_multiseat&diff=296944Xorg multiseat2014-02-12T05:40:53Z<p>Shillshocked: /* For LightDM (Light Display Manager) */</p>
<hr />
<div>[[Category:X Server]]<br />
{{Expansion|Is it possible login two users without keyin user name and password?<br\>systemd makes this easier, cover systemd ways}}<br />
Multiseat is a certain setup where multiple users work simultaneously on one computer. This is achieved by having two monitors, two keyboards and two mice. The advantages are quite obvious:<br />
* Less power consumption (only one computer)<br />
* Less hardware to purchase<br />
* All the cool kids do it<br />
<br />
==Requirements==<br />
<br />
===Keyboards and mice===<br />
<br />
Any standard PS/2 or USB keyboards will suffice. Same thing for mice.<br />
<br />
===Graphics hardware===<br />
<br />
For the best possible result you'll need two graphics cards. I used an nVidia FX5500 AGP and an nVidia 6200 PCI. If you look around a bit you can certainly find new and decent PCI graphics card for a soft price.<br />
<br />
It is possible to use only one videocard which has dual heads (like most nvidia cards will have), but this has some limitations: you have to use Xephyr on the second monitor which seems quite a messy solution from what I've read, and for optimal usage both screens need the same resolution.<br />
<br />
If you have two pci-express slots, take advantage of them! That way you'll even be able to play two games at the same time. (PCI is too slow to play comfortably)<br />
<br />
===Processors and memory===<br />
<br />
If you really are working with two users on the same computer, I'd at least recommend a dual-core processor and plenty of RAM. A fast hard drive (10.000 RPM or higher) is also recommended for comfortable use.<br />
<br />
===Software===<br />
<br />
You'll need Xorg with the drivers for your graphics card (according to some sources, the closed source nvidia driver works better than the open source nv driver for this, I have t tested this myself) and the evdev (xf86-input-evdev) driver. That's all. All this can be found in the Arch Linux core and extra repositories.<br />
<br />
===Some X knowledge===<br />
<br />
If you know how X works this will be a lot easier. Before you start, I recommend generating a clean configuration with xorgconfig that works with a single screen. Read through this xorg configuration and make yourself familiar. And as usual the manpages will provide you with most of the answers. You may reference some man pages: xorg, xserver, startx, xdm, xinit.<br />
'''sudo X -configure''', '''X -showopts''' may give you some hint.<br />
<br />
==Definitions==<br />
<br />
For this article to be clear, I'll be using the following definitions:<br />
* screen: A screen is something Xorg can display its stuff on. A screen has a monitor and a graphics card assigned to it.<br />
* monitor: A physical monitor like the one you're now sitting in front of.<br />
* server layout: a definition of which screen, keyboard and mouse to use.<br />
* seat: A workplace with a physical monitor, physical keyboard and physical mouse.<br />
<br />
==Tips and tricks==<br />
<br />
* Set up ssh on your computer, so you can ssh to the machine from another computer (such as a laptop). This is very useful because you'll probably run into X not responding anymore or not giving you picture at all.<br />
* Finding out which keyboard and mouse is which: open a terminal and use cat to find out. For example, {{ic|cat /dev/input/mouse1}}. If you then move your mouse and you see all weird things happening than that is the mouse you're moving. Same goes for keyboards, which are called eventN.<br />
* Try a basic configuration first. Don't start with the fancy stuff yet, get a very basic Xorg working first.<br />
* Leave your {{ic|xorg.conf}} alone and create a new file, called {{ic|xorg.conf.multiseat}} in {{ic|/etc/X11}} to store your new multiseat configuration. After this configuration is working you can overwrite the {{ic|xorg.conf}} file with your new {{ic|xorg.conf.multiseat}}.<br />
* Create a backup of all relevant configuration files. What do you mean you'll skip this one?<br />
* Take a look at the full configuration I used at the end of this article before you start.<br />
<br />
==About evdev==<br />
<br />
evdev is an Xorg driver which can make use of the kernel event devices, which you can find in {{ic|/dev/input}}.<br />
<br />
==Setting up Xorg==<br />
<br />
The logic behind this is that you have two server layouts, each assigned with their own keyboard, mouse, video card and monitor. <br />
<br />
===The basics===<br />
<br />
First of all we'll set up the basics for xorg.<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "AllowMouseOpenFail" "on"<br />
Option "AllowEmptyInput" "on"<br />
Option "ZapWarning" "on"<br />
Option "HandleSpecialKeys" "off" # Zapping on<br />
Option "DRI2" "on"<br />
Option "Xinerama" "off"<br />
EndSection<br />
}}<br />
<br />
===Defining available input devices===<br />
<br />
This part of the configuration tells Xorg which input devices it has available. Input devices are keyboards and mice, but can also be, for example, touchscreens and pens.<br />
<br />
This section defines my first keyboard, called keyboard0. As you can seen it uses the evdev driver. {{ic|/dev/input/event1}} corresponds with the keyboard connected to the PS/2 port of my computer. Create a section like this for each keyboard you have. Don't forget to modify the identifier of course. Keep the identifier simple and match it with the other names. This keyboard0 will be used for screen0 together with mouse0.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
# Option "Device" "/dev/input/by-path/platform-i8042-serio-0-event-kbd" <br />
# Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-kbd"<br />
Option "xkb_rules" "evdev"<br />
Option "xkb_model" "evdev"<br />
Option "xkb_layout" "us"<br />
Option "GrabDevice" "on" # prevent send event to other X-servers<br />
# If you are using a non en_US keyboard, set the layout here.<br />
# Option "XkbLayout" "be"<br />
EndSection<br />
}}<br />
<br />
<br />
This section defines my first mouse, called mouse0. This uses the regular mouse driver. /dev/input/mouse2 corresponds with the mouse connected to the PS/2 port of my computer. Create a section like this for each mouse you have.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse2"<br />
EndSection<br />
# or use evdev, that could assign by id<br />
Section "InputDevice"<br />
Identifier "Mouse0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
}}<br />
<br />
===Graphics card===<br />
<br />
Now we'll set up the graphics card for each screen.<br />
<br />
{{bc|<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "NoLogo" "1" # Remove nvidia branding at startup<br />
BusId "PCI:1:0:0"<br />
Option "ProbeAllGpus" "false" # Only required for nvidia<br />
EndSection<br />
}}<br />
<br />
This section defines my first graphics card, called nvidia0. This uses the closed source nvidia driver. Take a close look at the BusID. This option specifies which hardware card to use. You can find out the BusId's with lspci. However, you'll soon find out this doesn't always match. That's because lspci displays the device address in hexadecimal form. Xorg however uses decimal form. So you'll need to convert your address from hexadecimal form to decimal. Thus a device address of 0:0a:0 in lspci would become 0:10:0 in {{ic|xorg.conf}}.<br />
<br />
Create a section like this for every graphics card you have.<br />
<br />
===Screens===<br />
<br />
This section defines my first screen, called screen0. Pay close attention to the "monitor" option. For easy recognition I called it the model of my monitor.<br />
<br />
{{bc|<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
}}<br />
<br />
Create a section like this for every screen you have.<br />
<br />
===Monitors===<br />
<br />
This section defines my first monitor, l1730s. Pay close attention to the identifier.<br />
<br />
{{bc|<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
}}<br />
<br />
Create section like this for every monitor you have.<br />
<br />
===Serverlayout===<br />
<br />
Here's the fun stuff. This is how everything is added up. This is my first seat, called seat0. Here I tell Xorg for the server layout called "seat0" to use my screen0, which is attached to nvidia0, using keyboard0 and mouse0.<br />
<br />
The AutoAddDevices option is now needed to keep HAL from automatically adding all your input devices to all the X servers.<br />
<br />
{{bc|<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "Clone" "off"<br />
Option "AutoAddDevices" "off"<br />
Option "DisableModInDev" "true"<br />
Option "SingleCard" "on" # use this to simplfied isolatedevice option <br />
EndSection<br />
}}<br />
<br />
Create a section like this for every seat you have with their respective keyboards, mice and screens.<br />
<br />
==Testing==<br />
Before we start modifying our login manager, we'll first start with testing out the individual seats. If these are working, then we're good to go.<br />
<br />
I've used twm (tiny window manager) to test out if my seats work, but there's no reason you can't use KDE, gnome, or any other desktop environment or window manager. I've used this in my {{ic|~/.xinitrc}}:<br />
exec twm<br />
<br />
Use the following command to test out an individual seat:<br />
startx -- -layout seat0 -config xorg.conf.multiseat<br />
<br />
Do this for every seat you have. If they are all working correctly and the keyboard/mouse combination matches, then congratulations! You are almost finished! In case you are wondering why I didn't you use the full path to my new configuration file, that's because X doesn't allow that when running as non-root. It will search for xorg.conf.multiseat relative to {{ic|/etc/X11}}.<br />
<br />
==Setting up the loginmanager==<br />
<br />
===For KDM (KDE's Display Manager)===<br />
<br />
Open {{ic|/usr/share/config/kdm/kdmrc}} and set the following variables:<br />
<br />
{{bc|1=<br />
StaticServers=:0,:1 #In the case of two seats. If you have three this would become :0,:1,:2 and so forth.<br />
ReserveServers=:2,:3 #You can define here as many as you want, but these should always start at the highest seat + 1.<br />
}}<br />
Next you'll need to add an [X-:n-Core] for each seat (where n = the seat)<br />
{{bc|1=<br />
[X-:0-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat0<br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch<br />
}}<br />
<br />
Add section like this for every seat you have, and do not forget to change the :0 and the -layout seat0. Note that the "-sharevts" and "-novtswitch" options should be added for all seats ''except'' the first one. Otherwise, you can end with rectangles of virtual terminals "showing through" on your primary screen.<br />
<br />
===For GDM (Gnome's Display Manager)===<br />
{{note|The following will work with GDM 2.20 but not with newer versions of GDM. GDM 2.20 is in AUR.}}<br />
<br />
Open {{ic|/etc/gdm/custom.conf}} and set the following variables (This sample demos two seats):<br />
{{bc|1=<br />
[servers]<br />
0=Standard0<br />
1=Standard1<br />
<br />
[server-Standard0]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat0<br />
flexible=true<br />
<br />
[server-Standard1]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat1<br />
flexible=true<br />
}}<br />
<br />
===For XDM (X Display Manager)===<br />
<br />
Open {{ic|/etc/X11/xdm/Xservers}} and set the following variables (This sample demos two seats):<br />
<br />
{{bc|<br />
# NOTE: don't add -sharevts on seat0, otherwise it may reset in about 10~20 minutes automatically.<br />
:0 local /usr/bin/X :0 vt07 -nolisten tcp -novtswitch -layout seat0 -config xorg.conf.multiseat<br />
:1 local /usr/bin/X :1 vt08 -nolisten tcp -sharevts -novtswitch -layout seat1 -config xorg.conf.multiseat<br />
}}<br />
<br />
Also if you use the Archlinux theme edit {{ic|/etc/X11/xdm/xdm-config}} for every screen:<br />
<br />
{{bc|<br />
DisplayManager._0.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._0.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._0.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
DisplayManager._1.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._1.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._1.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
}}<br />
<br />
===For LightDM (Light Display Manager)===<br />
<br />
LightDM works well with ALSA only and PulseAudio removed if you wish to have shared audio, an alsamixer equalizer and software mixing.<br />
<br />
In the example below LightDM and MATE with ALSA was installed with PulseAudio removed. PulseAudio could also be used but it requires a more complicated configuration to maintain high audio quality. The relevant hardware used is an ATI Radeon HD 5850 and an Intel Sandy Bridge (onboard) HD 3000. You configuration may vary.<br />
<br />
Open {{ic|/etc/lightdm/lightdm.conf}} and follow the sample. Autologin is optional. This works both as multi-user multiseat and single user multi-seat. In the former case only the last user to login will have audio control and access. In the latter case the sound card will be shared among the seats using ALSA with PulseAudio removed - libpulse itself may be kept for various software dependencies however:<br />
<br />
{{bc|1=<br />
[LightDM]<br />
greeter-user=lightdm<br />
log-directory=/var/log/lightdm<br />
run-directory=/run/lightdm<br />
<br />
[SeatDefaults]<br />
xserver-command=/usr/bin/X<br />
greeter-session=lightdm-gtk-greeter<br />
greeter-show-manual-login=true<br />
user-session=mate<br />
session-wrapper=/etc/lightdm/Xsession<br />
pam-service=lightdm-autologin<br />
exit-on-failure=true<br />
<br />
[Seat:0]<br />
xserver-command=/usr/bin/X :0 -sharevts<br />
xserver-layout=Layout0<br />
#autologin-user=joeblow<br />
#autologin-user-timeout=-1<br />
#session-setup-script=/etc/lightdm/scripts/sound_start<br />
#session-cleanup-script=/etc/lightdm/scripts/sound_stop<br />
<br />
[Seat:1]<br />
xserver-command=/usr/bin/X :1 -sharevts<br />
xserver-layout=Layout1<br />
#autologin-user=jillschmill<br />
#autologin-user-timeout=-1<br />
}}<br />
<br />
Next, remove respective {{ic|~/.asoundrc}} files (as well as related PulseAudio config files if you removed that) and follow this template with {{ic|/etc/asound.conf}} for the sound:<br />
<br />
{{bc|<br />
ctl.equal {<br />
type equal;<br />
}<br />
<br />
pcm.plugequal {<br />
type equal;<br />
# Modify the line below if you do not<br />
# want to use sound card 0.<br />
#slave.pcm "plughw:0,0";<br />
#by default we want to play from more sources at time:<br />
slave.pcm "plug:dmix";<br />
}<br />
#pcm.equal {<br />
# If you do not want the equalizer to be your<br />
# default soundcard comment the following<br />
# line and uncomment the above line. (You can<br />
# choose it as the output device by addressing<br />
# it with specific apps,eg mpg123 -a equal 06.Back_In_Black.mp3)<br />
pcm.!default {<br />
type plug;<br />
slave.pcm plugequal;<br />
}<br />
}}<br />
<br />
Finally you must set the {{ic|/etc/X11/xorg.conf}} file. Here is a sample, adjust to your own system configuration after determing hardware information:<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "DefaultServerLayout" "Layout1"<br />
# Option "AllowMouseOpenFail" "true"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "DontZap" "false"<br />
Option "Xinerama" "0"<br />
Option "AutoAddGPU" "FALSE"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "kbd_0" "CoreKeyboard"<br />
InputDevice "mouse_0" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true" <br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout1"<br />
Screen 0 "Screen1" 0 0<br />
InputDevice "kbd_1" "CoreKeyboard"<br />
InputDevice "mouse_1" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true"<br />
EndSection<br />
<br />
Section "Module"<br />
# Load "dri2"<br />
# Load "glamoregl"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.6:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:04:00.0-usb-0:1:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.5:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.3:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
# Option "DPMS" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "radeon"<br />
# Option "AccelMethod" "glamor"<br />
Option "AccelMethod" "EXA"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:1:0:0"<br />
Screen 0<br />
# Option "EXAVSync"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device1"<br />
Driver "intel"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:0:2:0"<br />
Screen 0<br />
# Option "AccelMethod" "UXA"<br />
# Option "TearFree" "1"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Device0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen1"<br />
Device "Device1"<br />
Monitor "Monitor1"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
Make sure to delete the {{ic|~/.Xauthority}} file in respective user directories before the initial reboot.<br />
<br />
===For Auto Login multiseat (without Display Manager)===<br />
<br />
edit a script /boot/twin.sh<br />
{{bc|<br />
#!/bin/bash<br />
cmd1="/bin/bash --login -c \"/usr/bin/xinit --"<br />
cmd2="-nolisten tcp -keeptty -novtswitch -config xorg.multiseat.conf"<br />
usr=(user1 user2) # FIXME: assume user1, user2 is valid user id<br />
declare -a pid<br />
while true ; do<br />
for ((i=0; i<${#usr[*]}; i++)) ; do<br />
echo "usr[$i]=${usr[$i]} pid=${pid[$i]}"<br />
if [ -z "${pid[$i]}" ] || [ ! -d "/proc/${pid[$i]}" ] ; then<br />
# echo "pid ${pid[$i]} killed, execute again" <br />
cmd3="-layout seat$i vt0"$((7+i))"\""<br />
if [ $i -gt 0 ] ; then<br />
cmd3="-sharevts $cmd3"<br />
fi<br />
#echo "cmd3=$cmd3"<br />
/bin/su ${usr[$i]} -l -c "$cmd1 :$i $cmd2 $cmd3" &<br />
pid[$i]=$!<br />
#echo "new pid=${pid[$i]}"<br />
fi<br />
done<br />
sleep 5 # check process exist per 5 second<br />
done<br />
}}<br />
<br />
Open {{ic|/etc/inittab}} and setup as follows:<br />
<br />
{{bc|<br />
#id:3:initdefault:<br />
id:5:initdefault:<br />
...<br />
x2:5:once:/root/twin.sh > /root/twin.log 2>&1<br />
}}<br />
<br />
==Troubleshooting==<br />
<br />
===My Windows key doesn't work anymore===<br />
<br />
Put this in [[Execute commands after X start|a startup file]]:<br />
xmodmap -e "add Mod4 = Super_L Super_R"<br />
<br />
===Unreliable behaviour (black picture without cursor)===<br />
<br />
If everything seems to be set up correctly, but for some reason you always get a black picture without a cursor, try setting the first initialized card in the BIOS to be the PCI card one.<br />
<br />
===Little black boxes/dots on the desktop===<br />
<br />
This is actually portions of the virtual terminals being painted on top of X. It seems to be caused by the Linux kernel framebuffer. This can be fixed by disabling the framebuffer, or by removing the "-sharevts" option from the primary seat's X args.<br />
<br />
===Multimedia keys not working===<br />
<br />
If your keyboard(s) has extra "multimedia" keys, you may find that they stopped working in your multiseat setup. This is because such keyboards are often represented as more then one "event" device. As you did above, cat each /dev/input/event* device, this time pressing multimedia keys. Once you've found the right event device, add a separate keyboard InputDevice section for it, then add that InputDevice section to the corresponding ServerLayout section with the "SendCoreEvents" option, which indicates that input from this device should be handled, despite not being the core keyboard. In the end you should have sections something like the following:<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "Keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event6"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "Keyboard0Multimedia"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event7"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "Keyboard0" "CoreKeyboard"<br />
InputDevice "Keyboard0Multimedia" "SendCoreEvents"<br />
InputDevice "Mouse0" "CorePointer"<br />
Option "AutoAddDevices" "no"<br />
EndSection<br />
}}<br />
<br />
===The Ctrl-Alt-Fx, Alt-Fx keys mess up with virtual terminals===<br />
<br />
(Oct 2010) I follows this guide and everything works, except for Atl-F1, Atl-F2,... mess things up. Then I follow this guide https://help.ubuntu.com/community/MultiseatX (read the part for Ubuntu 10.04):<br />
<br />
{{bc|<br />
# cd /usr/bin<br />
# ln -s X X0<br />
# ln -s X X1<br />
}}<br />
<br />
Then fix in the '''/usr/share/config/kdm/kdmrc''' as follow<br />
<br />
{{bc|1=<br />
[General]<br />
ConsoleTTYs=tty1,tty2,tty3,tty4,tty5,tty6<br />
ServerVTs=7,8<br />
StaticServers=:0,:1<br />
ReserveServers=:2,:3<br />
...<br />
<br />
[X-:0-Core]<br />
ServerVT=8<br />
ServerCmd=/usr/bin/X1<br />
ServerArgsLocal=-nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0<br />
<br />
[X-:1-Core]<br />
ServerVT=7<br />
ServerCmd=/usr/bin/X0<br />
ServerArgsLocal=-nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0<br />
...<br />
}}<br />
<br />
It works for my computer: one on-board Intel card (xf86-video-intel driver), and one Nvidia card (xf86-video-nouveau driver). You can check if the parameters are passed correctly by:<br />
<br />
{{bc|<nowiki><br />
$ ps aux | grep 'PCI' | grep -Ev 'grep'<br />
root 16993 1.6 1.3 32900 26772 ? S 08:09 0:19 /usr/bin/X0 :1 vt7 -nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0 -auth /var/run/xauth/A:1-ES6CCb<br />
root 17124 5.9 0.5 18996 11980 ? S 08:09 1:09 /usr/bin/X1 :0 vt8 -nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0 -auth /var/run/xauth/A:0-Wgiyza<br />
<br />
</nowiki>}}<br />
<br />
The '''ServerVT=7''', '''ServerVT=8''' would be pass to as '''vt7''', '''vt8'''<br />
<br />
==Final configuration==<br />
<br />
===/etc/X11/xorg.conf===<br />
<br />
This is my full xorg.conf with multiseat that works:<br />
{{bc|<br />
Section "Module"<br />
Load "dbe"<br />
<br />
SubSection "extmod"<br />
Option "omit xfree86-dga"<br />
EndSubSection<br />
<br />
Load "type1"<br />
Load "speedo"<br />
Load "freetype"<br />
Load "glx"<br />
EndSection<br />
<br />
<br />
Section "Files"<br />
RgbPath "/usr/share/X11/rgb"<br />
<br />
FontPath "/usr/share/fonts/misc"<br />
FontPath "/usr/share/fonts/75dpi"<br />
FontPath "/usr/share/fonts/100dpi"<br />
FontPath "/usr/share/fonts/TTF"<br />
FontPath "/usr/share/fonts/Type1"<br />
FontPath "/usr/share/fonts/msfonts"<br />
FontPath "/usr/share/fonts/misc2"<br />
FontPath "/usr/share/fonts/local"<br />
FontPath "/usr/local/share/fonts"<br />
EndSection<br />
<br />
<br />
Section "ServerFlags"<br />
# Option "DontZap"<br />
Option "AllowMouseOpenFail" "true"<br />
# Option "DefaultServerLayout" "alltogether"<br />
Option "Xinerama" "0"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event5"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2" # Auto detect<br />
Option "Device" "/dev/input/mouse2"<br />
Option "ZAxisMapping" "4 5"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse1"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse1"<br />
EndSection<br />
<br />
<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:1:0:0"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "nvidia1"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:0:10:0"<br />
EndSection<br />
<br />
<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "screen1"<br />
Device "nvidia1"<br />
Monitor "cpdm151"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1024x768" "800x600"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat1"<br />
Screen "screen1" 0 0<br />
InputDevice "mouse1" "CorePointer"<br />
InputDevice "keyboard1" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "Extensions"<br />
Option "Composite" "Disable"<br />
Option "RENDER" "Enable"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "cpdm151"<br />
Option "dpms"<br />
HorizSync 30-61<br />
VertRefresh 60<br />
EndSection<br />
}}<br />
<br />
===/opt/kde/share/config/kdm/kdmrc===<br />
<br />
This is my kdmrc:<br />
<br />
{{bc|1=<br />
[General]<br />
ConfigVersion=2.3<br />
ConsoleTTYs=vc/1,vc/2,vc/3,vc/4,vc/5,vc/6<br />
PidFile=/var/run/kdm.pid<br />
ReserveServers=:2,:3<br />
ServerVTs=-7<br />
StaticServers=:0,:1<br />
<br />
[Shutdown]<br />
BootManager=Grub<br />
HaltCmd=/sbin/halt<br />
RebootCmd=/sbin/reboot<br />
<br />
[X-*-Core]<br />
AllowNullPasswd=false<br />
AllowRootLogin=false<br />
AllowShutdown=Root<br />
Authorize=true<br />
AutoReLogin=false<br />
ClientLogFile=.xsession-errors-%s<br />
Reset=/opt/kde/share/config/kdm/Xreset<br />
Resources=/opt/kde/share/config/kdm/Xresources<br />
Session=/opt/kde/share/config/kdm/Xsession<br />
SessionsDirs=/etc/X11/sessions,/usr/share/xsessions,/opt/kde/share/apps/kdm/sessions<br />
Setup=/opt/kde/share/config/kdm/Xsetup<br />
Startup=/opt/kde/share/config/kdm/Xstartup<br />
<br />
[X-*-Greeter]<br />
AllowConsole=true<br />
AntiAliasing=true<br />
AuthComplain=true<br />
BackgroundCfg=/opt/kde/share/config/kdm/backgroundrc<br />
ColorScheme=<br />
DefaultUser=<br />
EchoMode=OneStar<br />
FaceSource=PreferUser<br />
FailFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
FocusPasswd=false<br />
ForgingSeed=1097313140<br />
GUIStyle=<br />
GreetFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
GreetString=Arch Linux %r (%h)<br />
GreeterPos=50,50<br />
HiddenUsers=root<br />
Language=en_US<br />
LogoArea=None<br />
LogoPixmap=<br />
MaxShowUID=65000<br />
MinShowUID=500<br />
PreselectUser=None<br />
SelectedUsers=<br />
ShowUsers=NotHidden<br />
SortUsers=true<br />
StdFont=Tahoma,11,-1,5,50,0,0,0,0,0<br />
UseBackground=false<br />
UserCompletion=false<br />
UserList=true<br />
<br />
[X-:*-Core]<br />
AllowNullPasswd=true<br />
AllowRootLogin=true<br />
AllowShutdown=All<br />
NoPassEnable=false<br />
NoPassUsers=<br />
<br />
[X-:*-Greeter]<br />
AllowClose=true<br />
DefaultUser=glenn<br />
FocusPasswd=true<br />
LoginMode=DefaultLocal<br />
PreselectUser=Previous<br />
<br />
[X-:0-Core]<br />
AutoLoginAgain=false<br />
AutoLoginDelay=0<br />
AutoLoginEnable=false<br />
AutoLoginLocked=false<br />
AutoLoginUser=glenn<br />
ClientLogFile=.xsession-errors<br />
ServerArgsLocal=-nolisten tcp -layout seat0 -sharevts -novtswitch <br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch <br />
<br />
[Xdmcp]<br />
Enable=false<br />
Willing=/opt/kde/share/config/kdm/Xwilling<br />
Xaccess=/opt/kde/share/config/kdm/Xaccess<br />
}}<br />
<br />
==Related problems==<br />
<br />
===PulseAudio===<br />
If two users want to use the sound card simultaneously, it is necessary to use a sound server, [[PulseAudio]] being most prevalent. Usually, the PulseAudio server runs only for active user and does not allow for multiple user instances. Solution to this problem is using the system-wide PulseAudio server. Although this approach is discouraged by its authors, it is probably most applicable setup.<br />
<br />
;Configuring for system-wide PulseAudio<br />
* Create user pulse and put him into group audio (PulseAudio drops root privileges and changes to user pulse. Group membership allows for device access.)<br />
* Create group pulse-access and put users, who will play sound locally into it (Group membership is used for access control for local access to PA daemon.)<br />
* In /etc/pulse/default.pa state explicitly the access rights<br />
{{bc|1=<br />
load-module module-native-protocol-unix auth-group=pulse-access auth-group-enable=1<br />
}}<br />
<br />
Start PA as system-wide, under root: {{bc|pulseaudio --system}}<br />
<br />
In {{ic|/var/run/pulse}} should appear files for communication with daemon, namely pid and native. <br />
<br />
;User access<br />
You can check communication with system daemon as non-root by e.g. {{ic|pactl -s "unix:/var/run/pulse/native" list}}.<br />
<br />
It is possible to enable automatic connection to local daemon in /etc/pulse/client.conf<br />
{{bc|1=<br />
auto-connect-localhost = yes<br />
}}<br />
<br />
The users should be able to connect to PA server. All the cons for system-wide daemon become essentially pros, e.g. ability to control volume of other users streams in pavucontrol.<br />
<br />
;Troubleshooting<br />
It is possible to enable the http interface to PA for debugging in /etc/pulse/default.pa<br />
{{ic|load-module module-http-protocol-tcp}} and then connect to it at http://localhost:4714/<br />
<br />
==See also==<br />
*[https://bbs.archlinux.org/viewtopic.php?id=105450 The original Arch Forums thread].<br />
<br />
*The arckwiki page [[Multi-pointer X]] explains how to setup two separate pair of devices on the same session.</div>Shillshockedhttps://wiki.archlinux.org/index.php?title=Xorg_multiseat&diff=296943Xorg multiseat2014-02-12T05:36:32Z<p>Shillshocked: /* Semantic change */</p>
<hr />
<div>[[Category:X Server]]<br />
{{Expansion|Is it possible login two users without keyin user name and password?<br\>systemd makes this easier, cover systemd ways}}<br />
Multiseat is a certain setup where multiple users work simultaneously on one computer. This is achieved by having two monitors, two keyboards and two mice. The advantages are quite obvious:<br />
* Less power consumption (only one computer)<br />
* Less hardware to purchase<br />
* All the cool kids do it<br />
<br />
==Requirements==<br />
<br />
===Keyboards and mice===<br />
<br />
Any standard PS/2 or USB keyboards will suffice. Same thing for mice.<br />
<br />
===Graphics hardware===<br />
<br />
For the best possible result you'll need two graphics cards. I used an nVidia FX5500 AGP and an nVidia 6200 PCI. If you look around a bit you can certainly find new and decent PCI graphics card for a soft price.<br />
<br />
It is possible to use only one videocard which has dual heads (like most nvidia cards will have), but this has some limitations: you have to use Xephyr on the second monitor which seems quite a messy solution from what I've read, and for optimal usage both screens need the same resolution.<br />
<br />
If you have two pci-express slots, take advantage of them! That way you'll even be able to play two games at the same time. (PCI is too slow to play comfortably)<br />
<br />
===Processors and memory===<br />
<br />
If you really are working with two users on the same computer, I'd at least recommend a dual-core processor and plenty of RAM. A fast hard drive (10.000 RPM or higher) is also recommended for comfortable use.<br />
<br />
===Software===<br />
<br />
You'll need Xorg with the drivers for your graphics card (according to some sources, the closed source nvidia driver works better than the open source nv driver for this, I have t tested this myself) and the evdev (xf86-input-evdev) driver. That's all. All this can be found in the Arch Linux core and extra repositories.<br />
<br />
===Some X knowledge===<br />
<br />
If you know how X works this will be a lot easier. Before you start, I recommend generating a clean configuration with xorgconfig that works with a single screen. Read through this xorg configuration and make yourself familiar. And as usual the manpages will provide you with most of the answers. You may reference some man pages: xorg, xserver, startx, xdm, xinit.<br />
'''sudo X -configure''', '''X -showopts''' may give you some hint.<br />
<br />
==Definitions==<br />
<br />
For this article to be clear, I'll be using the following definitions:<br />
* screen: A screen is something Xorg can display its stuff on. A screen has a monitor and a graphics card assigned to it.<br />
* monitor: A physical monitor like the one you're now sitting in front of.<br />
* server layout: a definition of which screen, keyboard and mouse to use.<br />
* seat: A workplace with a physical monitor, physical keyboard and physical mouse.<br />
<br />
==Tips and tricks==<br />
<br />
* Set up ssh on your computer, so you can ssh to the machine from another computer (such as a laptop). This is very useful because you'll probably run into X not responding anymore or not giving you picture at all.<br />
* Finding out which keyboard and mouse is which: open a terminal and use cat to find out. For example, {{ic|cat /dev/input/mouse1}}. If you then move your mouse and you see all weird things happening than that is the mouse you're moving. Same goes for keyboards, which are called eventN.<br />
* Try a basic configuration first. Don't start with the fancy stuff yet, get a very basic Xorg working first.<br />
* Leave your {{ic|xorg.conf}} alone and create a new file, called {{ic|xorg.conf.multiseat}} in {{ic|/etc/X11}} to store your new multiseat configuration. After this configuration is working you can overwrite the {{ic|xorg.conf}} file with your new {{ic|xorg.conf.multiseat}}.<br />
* Create a backup of all relevant configuration files. What do you mean you'll skip this one?<br />
* Take a look at the full configuration I used at the end of this article before you start.<br />
<br />
==About evdev==<br />
<br />
evdev is an Xorg driver which can make use of the kernel event devices, which you can find in {{ic|/dev/input}}.<br />
<br />
==Setting up Xorg==<br />
<br />
The logic behind this is that you have two server layouts, each assigned with their own keyboard, mouse, video card and monitor. <br />
<br />
===The basics===<br />
<br />
First of all we'll set up the basics for xorg.<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "AllowMouseOpenFail" "on"<br />
Option "AllowEmptyInput" "on"<br />
Option "ZapWarning" "on"<br />
Option "HandleSpecialKeys" "off" # Zapping on<br />
Option "DRI2" "on"<br />
Option "Xinerama" "off"<br />
EndSection<br />
}}<br />
<br />
===Defining available input devices===<br />
<br />
This part of the configuration tells Xorg which input devices it has available. Input devices are keyboards and mice, but can also be, for example, touchscreens and pens.<br />
<br />
This section defines my first keyboard, called keyboard0. As you can seen it uses the evdev driver. {{ic|/dev/input/event1}} corresponds with the keyboard connected to the PS/2 port of my computer. Create a section like this for each keyboard you have. Don't forget to modify the identifier of course. Keep the identifier simple and match it with the other names. This keyboard0 will be used for screen0 together with mouse0.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
# Option "Device" "/dev/input/by-path/platform-i8042-serio-0-event-kbd" <br />
# Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-kbd"<br />
Option "xkb_rules" "evdev"<br />
Option "xkb_model" "evdev"<br />
Option "xkb_layout" "us"<br />
Option "GrabDevice" "on" # prevent send event to other X-servers<br />
# If you are using a non en_US keyboard, set the layout here.<br />
# Option "XkbLayout" "be"<br />
EndSection<br />
}}<br />
<br />
<br />
This section defines my first mouse, called mouse0. This uses the regular mouse driver. /dev/input/mouse2 corresponds with the mouse connected to the PS/2 port of my computer. Create a section like this for each mouse you have.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse2"<br />
EndSection<br />
# or use evdev, that could assign by id<br />
Section "InputDevice"<br />
Identifier "Mouse0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
}}<br />
<br />
===Graphics card===<br />
<br />
Now we'll set up the graphics card for each screen.<br />
<br />
{{bc|<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "NoLogo" "1" # Remove nvidia branding at startup<br />
BusId "PCI:1:0:0"<br />
Option "ProbeAllGpus" "false" # Only required for nvidia<br />
EndSection<br />
}}<br />
<br />
This section defines my first graphics card, called nvidia0. This uses the closed source nvidia driver. Take a close look at the BusID. This option specifies which hardware card to use. You can find out the BusId's with lspci. However, you'll soon find out this doesn't always match. That's because lspci displays the device address in hexadecimal form. Xorg however uses decimal form. So you'll need to convert your address from hexadecimal form to decimal. Thus a device address of 0:0a:0 in lspci would become 0:10:0 in {{ic|xorg.conf}}.<br />
<br />
Create a section like this for every graphics card you have.<br />
<br />
===Screens===<br />
<br />
This section defines my first screen, called screen0. Pay close attention to the "monitor" option. For easy recognition I called it the model of my monitor.<br />
<br />
{{bc|<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
}}<br />
<br />
Create a section like this for every screen you have.<br />
<br />
===Monitors===<br />
<br />
This section defines my first monitor, l1730s. Pay close attention to the identifier.<br />
<br />
{{bc|<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
}}<br />
<br />
Create section like this for every monitor you have.<br />
<br />
===Serverlayout===<br />
<br />
Here's the fun stuff. This is how everything is added up. This is my first seat, called seat0. Here I tell Xorg for the server layout called "seat0" to use my screen0, which is attached to nvidia0, using keyboard0 and mouse0.<br />
<br />
The AutoAddDevices option is now needed to keep HAL from automatically adding all your input devices to all the X servers.<br />
<br />
{{bc|<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "Clone" "off"<br />
Option "AutoAddDevices" "off"<br />
Option "DisableModInDev" "true"<br />
Option "SingleCard" "on" # use this to simplfied isolatedevice option <br />
EndSection<br />
}}<br />
<br />
Create a section like this for every seat you have with their respective keyboards, mice and screens.<br />
<br />
==Testing==<br />
Before we start modifying our login manager, we'll first start with testing out the individual seats. If these are working, then we're good to go.<br />
<br />
I've used twm (tiny window manager) to test out if my seats work, but there's no reason you can't use KDE, gnome, or any other desktop environment or window manager. I've used this in my {{ic|~/.xinitrc}}:<br />
exec twm<br />
<br />
Use the following command to test out an individual seat:<br />
startx -- -layout seat0 -config xorg.conf.multiseat<br />
<br />
Do this for every seat you have. If they are all working correctly and the keyboard/mouse combination matches, then congratulations! You are almost finished! In case you are wondering why I didn't you use the full path to my new configuration file, that's because X doesn't allow that when running as non-root. It will search for xorg.conf.multiseat relative to {{ic|/etc/X11}}.<br />
<br />
==Setting up the loginmanager==<br />
<br />
===For KDM (KDE's Display Manager)===<br />
<br />
Open {{ic|/usr/share/config/kdm/kdmrc}} and set the following variables:<br />
<br />
{{bc|1=<br />
StaticServers=:0,:1 #In the case of two seats. If you have three this would become :0,:1,:2 and so forth.<br />
ReserveServers=:2,:3 #You can define here as many as you want, but these should always start at the highest seat + 1.<br />
}}<br />
Next you'll need to add an [X-:n-Core] for each seat (where n = the seat)<br />
{{bc|1=<br />
[X-:0-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat0<br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch<br />
}}<br />
<br />
Add section like this for every seat you have, and do not forget to change the :0 and the -layout seat0. Note that the "-sharevts" and "-novtswitch" options should be added for all seats ''except'' the first one. Otherwise, you can end with rectangles of virtual terminals "showing through" on your primary screen.<br />
<br />
===For GDM (Gnome's Display Manager)===<br />
{{note|The following will work with GDM 2.20 but not with newer versions of GDM. GDM 2.20 is in AUR.}}<br />
<br />
Open {{ic|/etc/gdm/custom.conf}} and set the following variables (This sample demos two seats):<br />
{{bc|1=<br />
[servers]<br />
0=Standard0<br />
1=Standard1<br />
<br />
[server-Standard0]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat0<br />
flexible=true<br />
<br />
[server-Standard1]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat1<br />
flexible=true<br />
}}<br />
<br />
===For XDM (X Display Manager)===<br />
<br />
Open {{ic|/etc/X11/xdm/Xservers}} and set the following variables (This sample demos two seats):<br />
<br />
{{bc|<br />
# NOTE: don't add -sharevts on seat0, otherwise it may reset in about 10~20 minutes automatically.<br />
:0 local /usr/bin/X :0 vt07 -nolisten tcp -novtswitch -layout seat0 -config xorg.conf.multiseat<br />
:1 local /usr/bin/X :1 vt08 -nolisten tcp -sharevts -novtswitch -layout seat1 -config xorg.conf.multiseat<br />
}}<br />
<br />
Also if you use the Archlinux theme edit {{ic|/etc/X11/xdm/xdm-config}} for every screen:<br />
<br />
{{bc|<br />
DisplayManager._0.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._0.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._0.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
DisplayManager._1.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._1.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._1.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
}}<br />
<br />
===For LightDM (Light Display Manager)===<br />
<br />
LightDM works well with ALSA only and PulseAudio removed if you wish to have shared audio, an alsamixer equalizer and software mixing.<br />
<br />
In the example below LightDM and MATE with ALSA was installed with PulseAudio removed. PulseAudio could also be used but it requires a more complicated configuration to maintain high audio quality. The relevant hardware used is an ATI Radeon HD 5850 and an Intel Sandy Bridge (onboard) HD 3000. You configuration may vary.<br />
<br />
Open {{ic|/etc/lightdm/lightdm.conf}} and follow the sample. Autologin is optional. This works both as multi-user multiseat and single user multi-seat (in the latter case the sound card will be shared among the seats using ALSA with PulseAudio removed - libpulse itself may be kept for various software dependencies however):<br />
<br />
{{bc|1=<br />
[LightDM]<br />
greeter-user=lightdm<br />
log-directory=/var/log/lightdm<br />
run-directory=/run/lightdm<br />
<br />
[SeatDefaults]<br />
xserver-command=/usr/bin/X<br />
greeter-session=lightdm-gtk-greeter<br />
greeter-show-manual-login=true<br />
user-session=mate<br />
session-wrapper=/etc/lightdm/Xsession<br />
pam-service=lightdm-autologin<br />
exit-on-failure=true<br />
<br />
[Seat:0]<br />
xserver-command=/usr/bin/X :0 -sharevts<br />
xserver-layout=Layout0<br />
#autologin-user=joeblow<br />
#autologin-user-timeout=-1<br />
#session-setup-script=/etc/lightdm/scripts/sound_start<br />
#session-cleanup-script=/etc/lightdm/scripts/sound_stop<br />
<br />
[Seat:1]<br />
xserver-command=/usr/bin/X :1 -sharevts<br />
xserver-layout=Layout1<br />
#autologin-user=jillschmill<br />
#autologin-user-timeout=-1<br />
}}<br />
<br />
Next, remove respective {{ic|~/.asoundrc}} files (as well as related PulseAudio config files if you removed that) and follow this template with {{ic|/etc/asound.conf}} for the sound:<br />
<br />
{{bc|<br />
ctl.equal {<br />
type equal;<br />
}<br />
<br />
pcm.plugequal {<br />
type equal;<br />
# Modify the line below if you do not<br />
# want to use sound card 0.<br />
#slave.pcm "plughw:0,0";<br />
#by default we want to play from more sources at time:<br />
slave.pcm "plug:dmix";<br />
}<br />
#pcm.equal {<br />
# If you do not want the equalizer to be your<br />
# default soundcard comment the following<br />
# line and uncomment the above line. (You can<br />
# choose it as the output device by addressing<br />
# it with specific apps,eg mpg123 -a equal 06.Back_In_Black.mp3)<br />
pcm.!default {<br />
type plug;<br />
slave.pcm plugequal;<br />
}<br />
}}<br />
<br />
Finally you must set the {{ic|/etc/X11/xorg.conf}} file. Here is a sample, adjust to your own system configuration after determing hardware information:<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "DefaultServerLayout" "Layout1"<br />
# Option "AllowMouseOpenFail" "true"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "DontZap" "false"<br />
Option "Xinerama" "0"<br />
Option "AutoAddGPU" "FALSE"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "kbd_0" "CoreKeyboard"<br />
InputDevice "mouse_0" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true" <br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout1"<br />
Screen 0 "Screen1" 0 0<br />
InputDevice "kbd_1" "CoreKeyboard"<br />
InputDevice "mouse_1" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true"<br />
EndSection<br />
<br />
Section "Module"<br />
# Load "dri2"<br />
# Load "glamoregl"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.6:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:04:00.0-usb-0:1:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.5:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.3:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
# Option "DPMS" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "radeon"<br />
# Option "AccelMethod" "glamor"<br />
Option "AccelMethod" "EXA"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:1:0:0"<br />
Screen 0<br />
# Option "EXAVSync"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device1"<br />
Driver "intel"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:0:2:0"<br />
Screen 0<br />
# Option "AccelMethod" "UXA"<br />
# Option "TearFree" "1"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Device0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen1"<br />
Device "Device1"<br />
Monitor "Monitor1"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
Make sure to delete the {{ic|~/.Xauthority}} file in respective user directories before the initial reboot.<br />
<br />
===For Auto Login multiseat (without Display Manager)===<br />
<br />
edit a script /boot/twin.sh<br />
{{bc|<br />
#!/bin/bash<br />
cmd1="/bin/bash --login -c \"/usr/bin/xinit --"<br />
cmd2="-nolisten tcp -keeptty -novtswitch -config xorg.multiseat.conf"<br />
usr=(user1 user2) # FIXME: assume user1, user2 is valid user id<br />
declare -a pid<br />
while true ; do<br />
for ((i=0; i<${#usr[*]}; i++)) ; do<br />
echo "usr[$i]=${usr[$i]} pid=${pid[$i]}"<br />
if [ -z "${pid[$i]}" ] || [ ! -d "/proc/${pid[$i]}" ] ; then<br />
# echo "pid ${pid[$i]} killed, execute again" <br />
cmd3="-layout seat$i vt0"$((7+i))"\""<br />
if [ $i -gt 0 ] ; then<br />
cmd3="-sharevts $cmd3"<br />
fi<br />
#echo "cmd3=$cmd3"<br />
/bin/su ${usr[$i]} -l -c "$cmd1 :$i $cmd2 $cmd3" &<br />
pid[$i]=$!<br />
#echo "new pid=${pid[$i]}"<br />
fi<br />
done<br />
sleep 5 # check process exist per 5 second<br />
done<br />
}}<br />
<br />
Open {{ic|/etc/inittab}} and setup as follows:<br />
<br />
{{bc|<br />
#id:3:initdefault:<br />
id:5:initdefault:<br />
...<br />
x2:5:once:/root/twin.sh > /root/twin.log 2>&1<br />
}}<br />
<br />
==Troubleshooting==<br />
<br />
===My Windows key doesn't work anymore===<br />
<br />
Put this in [[Execute commands after X start|a startup file]]:<br />
xmodmap -e "add Mod4 = Super_L Super_R"<br />
<br />
===Unreliable behaviour (black picture without cursor)===<br />
<br />
If everything seems to be set up correctly, but for some reason you always get a black picture without a cursor, try setting the first initialized card in the BIOS to be the PCI card one.<br />
<br />
===Little black boxes/dots on the desktop===<br />
<br />
This is actually portions of the virtual terminals being painted on top of X. It seems to be caused by the Linux kernel framebuffer. This can be fixed by disabling the framebuffer, or by removing the "-sharevts" option from the primary seat's X args.<br />
<br />
===Multimedia keys not working===<br />
<br />
If your keyboard(s) has extra "multimedia" keys, you may find that they stopped working in your multiseat setup. This is because such keyboards are often represented as more then one "event" device. As you did above, cat each /dev/input/event* device, this time pressing multimedia keys. Once you've found the right event device, add a separate keyboard InputDevice section for it, then add that InputDevice section to the corresponding ServerLayout section with the "SendCoreEvents" option, which indicates that input from this device should be handled, despite not being the core keyboard. In the end you should have sections something like the following:<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "Keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event6"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "Keyboard0Multimedia"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event7"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "Keyboard0" "CoreKeyboard"<br />
InputDevice "Keyboard0Multimedia" "SendCoreEvents"<br />
InputDevice "Mouse0" "CorePointer"<br />
Option "AutoAddDevices" "no"<br />
EndSection<br />
}}<br />
<br />
===The Ctrl-Alt-Fx, Alt-Fx keys mess up with virtual terminals===<br />
<br />
(Oct 2010) I follows this guide and everything works, except for Atl-F1, Atl-F2,... mess things up. Then I follow this guide https://help.ubuntu.com/community/MultiseatX (read the part for Ubuntu 10.04):<br />
<br />
{{bc|<br />
# cd /usr/bin<br />
# ln -s X X0<br />
# ln -s X X1<br />
}}<br />
<br />
Then fix in the '''/usr/share/config/kdm/kdmrc''' as follow<br />
<br />
{{bc|1=<br />
[General]<br />
ConsoleTTYs=tty1,tty2,tty3,tty4,tty5,tty6<br />
ServerVTs=7,8<br />
StaticServers=:0,:1<br />
ReserveServers=:2,:3<br />
...<br />
<br />
[X-:0-Core]<br />
ServerVT=8<br />
ServerCmd=/usr/bin/X1<br />
ServerArgsLocal=-nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0<br />
<br />
[X-:1-Core]<br />
ServerVT=7<br />
ServerCmd=/usr/bin/X0<br />
ServerArgsLocal=-nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0<br />
...<br />
}}<br />
<br />
It works for my computer: one on-board Intel card (xf86-video-intel driver), and one Nvidia card (xf86-video-nouveau driver). You can check if the parameters are passed correctly by:<br />
<br />
{{bc|<nowiki><br />
$ ps aux | grep 'PCI' | grep -Ev 'grep'<br />
root 16993 1.6 1.3 32900 26772 ? S 08:09 0:19 /usr/bin/X0 :1 vt7 -nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0 -auth /var/run/xauth/A:1-ES6CCb<br />
root 17124 5.9 0.5 18996 11980 ? S 08:09 1:09 /usr/bin/X1 :0 vt8 -nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0 -auth /var/run/xauth/A:0-Wgiyza<br />
<br />
</nowiki>}}<br />
<br />
The '''ServerVT=7''', '''ServerVT=8''' would be pass to as '''vt7''', '''vt8'''<br />
<br />
==Final configuration==<br />
<br />
===/etc/X11/xorg.conf===<br />
<br />
This is my full xorg.conf with multiseat that works:<br />
{{bc|<br />
Section "Module"<br />
Load "dbe"<br />
<br />
SubSection "extmod"<br />
Option "omit xfree86-dga"<br />
EndSubSection<br />
<br />
Load "type1"<br />
Load "speedo"<br />
Load "freetype"<br />
Load "glx"<br />
EndSection<br />
<br />
<br />
Section "Files"<br />
RgbPath "/usr/share/X11/rgb"<br />
<br />
FontPath "/usr/share/fonts/misc"<br />
FontPath "/usr/share/fonts/75dpi"<br />
FontPath "/usr/share/fonts/100dpi"<br />
FontPath "/usr/share/fonts/TTF"<br />
FontPath "/usr/share/fonts/Type1"<br />
FontPath "/usr/share/fonts/msfonts"<br />
FontPath "/usr/share/fonts/misc2"<br />
FontPath "/usr/share/fonts/local"<br />
FontPath "/usr/local/share/fonts"<br />
EndSection<br />
<br />
<br />
Section "ServerFlags"<br />
# Option "DontZap"<br />
Option "AllowMouseOpenFail" "true"<br />
# Option "DefaultServerLayout" "alltogether"<br />
Option "Xinerama" "0"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event5"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2" # Auto detect<br />
Option "Device" "/dev/input/mouse2"<br />
Option "ZAxisMapping" "4 5"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse1"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse1"<br />
EndSection<br />
<br />
<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:1:0:0"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "nvidia1"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:0:10:0"<br />
EndSection<br />
<br />
<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "screen1"<br />
Device "nvidia1"<br />
Monitor "cpdm151"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1024x768" "800x600"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat1"<br />
Screen "screen1" 0 0<br />
InputDevice "mouse1" "CorePointer"<br />
InputDevice "keyboard1" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "Extensions"<br />
Option "Composite" "Disable"<br />
Option "RENDER" "Enable"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "cpdm151"<br />
Option "dpms"<br />
HorizSync 30-61<br />
VertRefresh 60<br />
EndSection<br />
}}<br />
<br />
===/opt/kde/share/config/kdm/kdmrc===<br />
<br />
This is my kdmrc:<br />
<br />
{{bc|1=<br />
[General]<br />
ConfigVersion=2.3<br />
ConsoleTTYs=vc/1,vc/2,vc/3,vc/4,vc/5,vc/6<br />
PidFile=/var/run/kdm.pid<br />
ReserveServers=:2,:3<br />
ServerVTs=-7<br />
StaticServers=:0,:1<br />
<br />
[Shutdown]<br />
BootManager=Grub<br />
HaltCmd=/sbin/halt<br />
RebootCmd=/sbin/reboot<br />
<br />
[X-*-Core]<br />
AllowNullPasswd=false<br />
AllowRootLogin=false<br />
AllowShutdown=Root<br />
Authorize=true<br />
AutoReLogin=false<br />
ClientLogFile=.xsession-errors-%s<br />
Reset=/opt/kde/share/config/kdm/Xreset<br />
Resources=/opt/kde/share/config/kdm/Xresources<br />
Session=/opt/kde/share/config/kdm/Xsession<br />
SessionsDirs=/etc/X11/sessions,/usr/share/xsessions,/opt/kde/share/apps/kdm/sessions<br />
Setup=/opt/kde/share/config/kdm/Xsetup<br />
Startup=/opt/kde/share/config/kdm/Xstartup<br />
<br />
[X-*-Greeter]<br />
AllowConsole=true<br />
AntiAliasing=true<br />
AuthComplain=true<br />
BackgroundCfg=/opt/kde/share/config/kdm/backgroundrc<br />
ColorScheme=<br />
DefaultUser=<br />
EchoMode=OneStar<br />
FaceSource=PreferUser<br />
FailFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
FocusPasswd=false<br />
ForgingSeed=1097313140<br />
GUIStyle=<br />
GreetFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
GreetString=Arch Linux %r (%h)<br />
GreeterPos=50,50<br />
HiddenUsers=root<br />
Language=en_US<br />
LogoArea=None<br />
LogoPixmap=<br />
MaxShowUID=65000<br />
MinShowUID=500<br />
PreselectUser=None<br />
SelectedUsers=<br />
ShowUsers=NotHidden<br />
SortUsers=true<br />
StdFont=Tahoma,11,-1,5,50,0,0,0,0,0<br />
UseBackground=false<br />
UserCompletion=false<br />
UserList=true<br />
<br />
[X-:*-Core]<br />
AllowNullPasswd=true<br />
AllowRootLogin=true<br />
AllowShutdown=All<br />
NoPassEnable=false<br />
NoPassUsers=<br />
<br />
[X-:*-Greeter]<br />
AllowClose=true<br />
DefaultUser=glenn<br />
FocusPasswd=true<br />
LoginMode=DefaultLocal<br />
PreselectUser=Previous<br />
<br />
[X-:0-Core]<br />
AutoLoginAgain=false<br />
AutoLoginDelay=0<br />
AutoLoginEnable=false<br />
AutoLoginLocked=false<br />
AutoLoginUser=glenn<br />
ClientLogFile=.xsession-errors<br />
ServerArgsLocal=-nolisten tcp -layout seat0 -sharevts -novtswitch <br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch <br />
<br />
[Xdmcp]<br />
Enable=false<br />
Willing=/opt/kde/share/config/kdm/Xwilling<br />
Xaccess=/opt/kde/share/config/kdm/Xaccess<br />
}}<br />
<br />
==Related problems==<br />
<br />
===PulseAudio===<br />
If two users want to use the sound card simultaneously, it is necessary to use a sound server, [[PulseAudio]] being most prevalent. Usually, the PulseAudio server runs only for active user and does not allow for multiple user instances. Solution to this problem is using the system-wide PulseAudio server. Although this approach is discouraged by its authors, it is probably most applicable setup.<br />
<br />
;Configuring for system-wide PulseAudio<br />
* Create user pulse and put him into group audio (PulseAudio drops root privileges and changes to user pulse. Group membership allows for device access.)<br />
* Create group pulse-access and put users, who will play sound locally into it (Group membership is used for access control for local access to PA daemon.)<br />
* In /etc/pulse/default.pa state explicitly the access rights<br />
{{bc|1=<br />
load-module module-native-protocol-unix auth-group=pulse-access auth-group-enable=1<br />
}}<br />
<br />
Start PA as system-wide, under root: {{bc|pulseaudio --system}}<br />
<br />
In {{ic|/var/run/pulse}} should appear files for communication with daemon, namely pid and native. <br />
<br />
;User access<br />
You can check communication with system daemon as non-root by e.g. {{ic|pactl -s "unix:/var/run/pulse/native" list}}.<br />
<br />
It is possible to enable automatic connection to local daemon in /etc/pulse/client.conf<br />
{{bc|1=<br />
auto-connect-localhost = yes<br />
}}<br />
<br />
The users should be able to connect to PA server. All the cons for system-wide daemon become essentially pros, e.g. ability to control volume of other users streams in pavucontrol.<br />
<br />
;Troubleshooting<br />
It is possible to enable the http interface to PA for debugging in /etc/pulse/default.pa<br />
{{ic|load-module module-http-protocol-tcp}} and then connect to it at http://localhost:4714/<br />
<br />
==See also==<br />
*[https://bbs.archlinux.org/viewtopic.php?id=105450 The original Arch Forums thread].<br />
<br />
*The arckwiki page [[Multi-pointer X]] explains how to setup two separate pair of devices on the same session.</div>Shillshockedhttps://wiki.archlinux.org/index.php?title=Xorg_multiseat&diff=296942Xorg multiseat2014-02-12T05:34:29Z<p>Shillshocked: /* Added LightDM and MATE, as well as specific examples for shared audio with software mixing and an equalizer in an ALSA configuration including single and multi-user multiseat setups*/</p>
<hr />
<div>[[Category:X Server]]<br />
{{Expansion|Is it possible login two users without keyin user name and password?<br\>systemd makes this easier, cover systemd ways}}<br />
Multiseat is a certain setup where multiple users work simultaneously on one computer. This is achieved by having two monitors, two keyboards and two mice. The advantages are quite obvious:<br />
* Less power consumption (only one computer)<br />
* Less hardware to purchase<br />
* All the cool kids do it<br />
<br />
==Requirements==<br />
<br />
===Keyboards and mice===<br />
<br />
Any standard PS/2 or USB keyboards will suffice. Same thing for mice.<br />
<br />
===Graphics hardware===<br />
<br />
For the best possible result you'll need two graphics cards. I used an nVidia FX5500 AGP and an nVidia 6200 PCI. If you look around a bit you can certainly find new and decent PCI graphics card for a soft price.<br />
<br />
It is possible to use only one videocard which has dual heads (like most nvidia cards will have), but this has some limitations: you have to use Xephyr on the second monitor which seems quite a messy solution from what I've read, and for optimal usage both screens need the same resolution.<br />
<br />
If you have two pci-express slots, take advantage of them! That way you'll even be able to play two games at the same time. (PCI is too slow to play comfortably)<br />
<br />
===Processors and memory===<br />
<br />
If you really are working with two users on the same computer, I'd at least recommend a dual-core processor and plenty of RAM. A fast hard drive (10.000 RPM or higher) is also recommended for comfortable use.<br />
<br />
===Software===<br />
<br />
You'll need Xorg with the drivers for your graphics card (according to some sources, the closed source nvidia driver works better than the open source nv driver for this, I have t tested this myself) and the evdev (xf86-input-evdev) driver. That's all. All this can be found in the Arch Linux core and extra repositories.<br />
<br />
===Some X knowledge===<br />
<br />
If you know how X works this will be a lot easier. Before you start, I recommend generating a clean configuration with xorgconfig that works with a single screen. Read through this xorg configuration and make yourself familiar. And as usual the manpages will provide you with most of the answers. You may reference some man pages: xorg, xserver, startx, xdm, xinit.<br />
'''sudo X -configure''', '''X -showopts''' may give you some hint.<br />
<br />
==Definitions==<br />
<br />
For this article to be clear, I'll be using the following definitions:<br />
* screen: A screen is something Xorg can display its stuff on. A screen has a monitor and a graphics card assigned to it.<br />
* monitor: A physical monitor like the one you're now sitting in front of.<br />
* server layout: a definition of which screen, keyboard and mouse to use.<br />
* seat: A workplace with a physical monitor, physical keyboard and physical mouse.<br />
<br />
==Tips and tricks==<br />
<br />
* Set up ssh on your computer, so you can ssh to the machine from another computer (such as a laptop). This is very useful because you'll probably run into X not responding anymore or not giving you picture at all.<br />
* Finding out which keyboard and mouse is which: open a terminal and use cat to find out. For example, {{ic|cat /dev/input/mouse1}}. If you then move your mouse and you see all weird things happening than that is the mouse you're moving. Same goes for keyboards, which are called eventN.<br />
* Try a basic configuration first. Don't start with the fancy stuff yet, get a very basic Xorg working first.<br />
* Leave your {{ic|xorg.conf}} alone and create a new file, called {{ic|xorg.conf.multiseat}} in {{ic|/etc/X11}} to store your new multiseat configuration. After this configuration is working you can overwrite the {{ic|xorg.conf}} file with your new {{ic|xorg.conf.multiseat}}.<br />
* Create a backup of all relevant configuration files. What do you mean you'll skip this one?<br />
* Take a look at the full configuration I used at the end of this article before you start.<br />
<br />
==About evdev==<br />
<br />
evdev is an Xorg driver which can make use of the kernel event devices, which you can find in {{ic|/dev/input}}.<br />
<br />
==Setting up Xorg==<br />
<br />
The logic behind this is that you have two server layouts, each assigned with their own keyboard, mouse, video card and monitor. <br />
<br />
===The basics===<br />
<br />
First of all we'll set up the basics for xorg.<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "AllowMouseOpenFail" "on"<br />
Option "AllowEmptyInput" "on"<br />
Option "ZapWarning" "on"<br />
Option "HandleSpecialKeys" "off" # Zapping on<br />
Option "DRI2" "on"<br />
Option "Xinerama" "off"<br />
EndSection<br />
}}<br />
<br />
===Defining available input devices===<br />
<br />
This part of the configuration tells Xorg which input devices it has available. Input devices are keyboards and mice, but can also be, for example, touchscreens and pens.<br />
<br />
This section defines my first keyboard, called keyboard0. As you can seen it uses the evdev driver. {{ic|/dev/input/event1}} corresponds with the keyboard connected to the PS/2 port of my computer. Create a section like this for each keyboard you have. Don't forget to modify the identifier of course. Keep the identifier simple and match it with the other names. This keyboard0 will be used for screen0 together with mouse0.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
# Option "Device" "/dev/input/by-path/platform-i8042-serio-0-event-kbd" <br />
# Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-kbd"<br />
Option "xkb_rules" "evdev"<br />
Option "xkb_model" "evdev"<br />
Option "xkb_layout" "us"<br />
Option "GrabDevice" "on" # prevent send event to other X-servers<br />
# If you are using a non en_US keyboard, set the layout here.<br />
# Option "XkbLayout" "be"<br />
EndSection<br />
}}<br />
<br />
<br />
This section defines my first mouse, called mouse0. This uses the regular mouse driver. /dev/input/mouse2 corresponds with the mouse connected to the PS/2 port of my computer. Create a section like this for each mouse you have.<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse2"<br />
EndSection<br />
# or use evdev, that could assign by id<br />
Section "InputDevice"<br />
Identifier "Mouse0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-id/usb-Tangtop_Generic_USBPS2-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
}}<br />
<br />
===Graphics card===<br />
<br />
Now we'll set up the graphics card for each screen.<br />
<br />
{{bc|<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "NoLogo" "1" # Remove nvidia branding at startup<br />
BusId "PCI:1:0:0"<br />
Option "ProbeAllGpus" "false" # Only required for nvidia<br />
EndSection<br />
}}<br />
<br />
This section defines my first graphics card, called nvidia0. This uses the closed source nvidia driver. Take a close look at the BusID. This option specifies which hardware card to use. You can find out the BusId's with lspci. However, you'll soon find out this doesn't always match. That's because lspci displays the device address in hexadecimal form. Xorg however uses decimal form. So you'll need to convert your address from hexadecimal form to decimal. Thus a device address of 0:0a:0 in lspci would become 0:10:0 in {{ic|xorg.conf}}.<br />
<br />
Create a section like this for every graphics card you have.<br />
<br />
===Screens===<br />
<br />
This section defines my first screen, called screen0. Pay close attention to the "monitor" option. For easy recognition I called it the model of my monitor.<br />
<br />
{{bc|<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
}}<br />
<br />
Create a section like this for every screen you have.<br />
<br />
===Monitors===<br />
<br />
This section defines my first monitor, l1730s. Pay close attention to the identifier.<br />
<br />
{{bc|<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
}}<br />
<br />
Create section like this for every monitor you have.<br />
<br />
===Serverlayout===<br />
<br />
Here's the fun stuff. This is how everything is added up. This is my first seat, called seat0. Here I tell Xorg for the server layout called "seat0" to use my screen0, which is attached to nvidia0, using keyboard0 and mouse0.<br />
<br />
The AutoAddDevices option is now needed to keep HAL from automatically adding all your input devices to all the X servers.<br />
<br />
{{bc|<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "Clone" "off"<br />
Option "AutoAddDevices" "off"<br />
Option "DisableModInDev" "true"<br />
Option "SingleCard" "on" # use this to simplfied isolatedevice option <br />
EndSection<br />
}}<br />
<br />
Create a section like this for every seat you have with their respective keyboards, mice and screens.<br />
<br />
==Testing==<br />
Before we start modifying our login manager, we'll first start with testing out the individual seats. If these are working, then we're good to go.<br />
<br />
I've used twm (tiny window manager) to test out if my seats work, but there's no reason you can't use KDE, gnome, or any other desktop environment or window manager. I've used this in my {{ic|~/.xinitrc}}:<br />
exec twm<br />
<br />
Use the following command to test out an individual seat:<br />
startx -- -layout seat0 -config xorg.conf.multiseat<br />
<br />
Do this for every seat you have. If they are all working correctly and the keyboard/mouse combination matches, then congratulations! You are almost finished! In case you are wondering why I didn't you use the full path to my new configuration file, that's because X doesn't allow that when running as non-root. It will search for xorg.conf.multiseat relative to {{ic|/etc/X11}}.<br />
<br />
==Setting up the loginmanager==<br />
<br />
===For KDM (KDE's Display Manager)===<br />
<br />
Open {{ic|/usr/share/config/kdm/kdmrc}} and set the following variables:<br />
<br />
{{bc|1=<br />
StaticServers=:0,:1 #In the case of two seats. If you have three this would become :0,:1,:2 and so forth.<br />
ReserveServers=:2,:3 #You can define here as many as you want, but these should always start at the highest seat + 1.<br />
}}<br />
Next you'll need to add an [X-:n-Core] for each seat (where n = the seat)<br />
{{bc|1=<br />
[X-:0-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat0<br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch<br />
}}<br />
<br />
Add section like this for every seat you have, and do not forget to change the :0 and the -layout seat0. Note that the "-sharevts" and "-novtswitch" options should be added for all seats ''except'' the first one. Otherwise, you can end with rectangles of virtual terminals "showing through" on your primary screen.<br />
<br />
===For GDM (Gnome's Display Manager)===<br />
{{note|The following will work with GDM 2.20 but not with newer versions of GDM. GDM 2.20 is in AUR.}}<br />
<br />
Open {{ic|/etc/gdm/custom.conf}} and set the following variables (This sample demos two seats):<br />
{{bc|1=<br />
[servers]<br />
0=Standard0<br />
1=Standard1<br />
<br />
[server-Standard0]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat0<br />
flexible=true<br />
<br />
[server-Standard1]<br />
name=Standard server<br />
command=/usr/bin/X -nolisten tcp -novtswitch -sharevts -r -config xorg.conf.multiseat<br />
-layout seat1<br />
flexible=true<br />
}}<br />
<br />
===For XDM (X Display Manager)===<br />
<br />
Open {{ic|/etc/X11/xdm/Xservers}} and set the following variables (This sample demos two seats):<br />
<br />
{{bc|<br />
# NOTE: don't add -sharevts on seat0, otherwise it may reset in about 10~20 minutes automatically.<br />
:0 local /usr/bin/X :0 vt07 -nolisten tcp -novtswitch -layout seat0 -config xorg.conf.multiseat<br />
:1 local /usr/bin/X :1 vt08 -nolisten tcp -sharevts -novtswitch -layout seat1 -config xorg.conf.multiseat<br />
}}<br />
<br />
Also if you use the Archlinux theme edit {{ic|/etc/X11/xdm/xdm-config}} for every screen:<br />
<br />
{{bc|<br />
DisplayManager._0.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._0.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._0.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
DisplayManager._1.setup: /etc/X11/xdm/arch-xdm/Xsetup<br />
DisplayManager._1.startup: /etc/X11/xdm/arch-xdm/Xstartup<br />
DisplayManager._1.reset: /etc/X11/xdm/arch-xdm/Xreset<br />
}}<br />
<br />
===For LightDM (The Light Display Manager)===<br />
<br />
LightDM works well with ALSA only and PulseAudio removed if you wish to have shared audio, an alsamixer equalizer and software mixing.<br />
<br />
In the example below LightDM and MATE with ALSA was installed with PulseAudio removed. PulseAudio could also be used but it requires a more complicated configuration to maintain high audio quality. The relevant hardware used is an ATI Radeon HD 5850 and an Intel Sandy Bridge (onboard) HD 3000. You configuration may vary.<br />
<br />
Open {{ic|/etc/lightdm/lightdm.conf}} and follow the sample. Autologin is optional. This works both as multi-user multiseat and single user multi-seat (in the latter case the sound card will be shared among the seats using ALSA with PulseAudio removed - libpulse itself may be kept for various software dependencies however):<br />
<br />
{{bc|1=<br />
[LightDM]<br />
greeter-user=lightdm<br />
log-directory=/var/log/lightdm<br />
run-directory=/run/lightdm<br />
<br />
[SeatDefaults]<br />
xserver-command=/usr/bin/X<br />
greeter-session=lightdm-gtk-greeter<br />
greeter-show-manual-login=true<br />
user-session=mate<br />
session-wrapper=/etc/lightdm/Xsession<br />
pam-service=lightdm-autologin<br />
exit-on-failure=true<br />
<br />
[Seat:0]<br />
xserver-command=/usr/bin/X :0 -sharevts<br />
xserver-layout=Layout0<br />
#autologin-user=joeblow<br />
#autologin-user-timeout=-1<br />
#session-setup-script=/etc/lightdm/scripts/sound_start<br />
#session-cleanup-script=/etc/lightdm/scripts/sound_stop<br />
<br />
[Seat:1]<br />
xserver-command=/usr/bin/X :1 -sharevts<br />
xserver-layout=Layout1<br />
#autologin-user=jillschmill<br />
#autologin-user-timeout=-1<br />
}}<br />
<br />
Next, remove respective {{ic|~/.asoundrc}} files (as well as related PulseAudio config files if you removed that) and follow this template with {{ic|/etc/asound.conf}} for the sound:<br />
<br />
{{bc|<br />
ctl.equal {<br />
type equal;<br />
}<br />
<br />
pcm.plugequal {<br />
type equal;<br />
# Modify the line below if you do not<br />
# want to use sound card 0.<br />
#slave.pcm "plughw:0,0";<br />
#by default we want to play from more sources at time:<br />
slave.pcm "plug:dmix";<br />
}<br />
#pcm.equal {<br />
# If you do not want the equalizer to be your<br />
# default soundcard comment the following<br />
# line and uncomment the above line. (You can<br />
# choose it as the output device by addressing<br />
# it with specific apps,eg mpg123 -a equal 06.Back_In_Black.mp3)<br />
pcm.!default {<br />
type plug;<br />
slave.pcm plugequal;<br />
}<br />
}}<br />
<br />
Finally you must set the {{ic|/etc/X11/xorg.conf}} file. Here is a sample, adjust to your own system configuration after determing hardware information:<br />
<br />
{{bc|<br />
Section "ServerFlags"<br />
Option "DefaultServerLayout" "Layout1"<br />
# Option "AllowMouseOpenFail" "true"<br />
Option "AutoAddDevices" "false"<br />
Option "AutoEnableDevices" "false"<br />
Option "DontZap" "false"<br />
Option "Xinerama" "0"<br />
Option "AutoAddGPU" "FALSE"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "kbd_0" "CoreKeyboard"<br />
InputDevice "mouse_0" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true" <br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout1"<br />
Screen 0 "Screen1" 0 0<br />
InputDevice "kbd_1" "CoreKeyboard"<br />
InputDevice "mouse_1" "CorePointer"<br />
Option "AllowEmptyInput" "true"<br />
Option "DontVTSwitch" "true"<br />
EndSection<br />
<br />
Section "Module"<br />
# Load "dri2"<br />
# Load "glamoregl"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.6:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "kbd_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:04:00.0-usb-0:1:1.0-event-kbd"<br />
Option "GrabDevice" "on"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "105"<br />
Option "XkbLayout" "us"<br />
Option "Protocol" "Standard"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.5:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse_1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/by-path/pci-0000:00:1a.0-usb-0:1.3:1.0-event-mouse"<br />
Option "GrabDevice" "on"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
# Option "DPMS" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "VendorName" "Unknown"<br />
Option "ModelName" "Generic Autodetecting Monitor"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "radeon"<br />
# Option "AccelMethod" "glamor"<br />
Option "AccelMethod" "EXA"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:1:0:0"<br />
Screen 0<br />
# Option "EXAVSync"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device1"<br />
Driver "intel"<br />
VendorName ""<br />
BoardName ""<br />
BusID "PCI:0:2:0"<br />
Screen 0<br />
# Option "AccelMethod" "UXA"<br />
# Option "TearFree" "1"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Device0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen1"<br />
Device "Device1"<br />
Monitor "Monitor1"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
Make sure to delete the {{ic|~/.Xauthority}} file in respective user directories before the initial reboot.<br />
<br />
===For Auto Login multiseat (without Display Manager)===<br />
<br />
edit a script /boot/twin.sh<br />
{{bc|<br />
#!/bin/bash<br />
cmd1="/bin/bash --login -c \"/usr/bin/xinit --"<br />
cmd2="-nolisten tcp -keeptty -novtswitch -config xorg.multiseat.conf"<br />
usr=(user1 user2) # FIXME: assume user1, user2 is valid user id<br />
declare -a pid<br />
while true ; do<br />
for ((i=0; i<${#usr[*]}; i++)) ; do<br />
echo "usr[$i]=${usr[$i]} pid=${pid[$i]}"<br />
if [ -z "${pid[$i]}" ] || [ ! -d "/proc/${pid[$i]}" ] ; then<br />
# echo "pid ${pid[$i]} killed, execute again" <br />
cmd3="-layout seat$i vt0"$((7+i))"\""<br />
if [ $i -gt 0 ] ; then<br />
cmd3="-sharevts $cmd3"<br />
fi<br />
#echo "cmd3=$cmd3"<br />
/bin/su ${usr[$i]} -l -c "$cmd1 :$i $cmd2 $cmd3" &<br />
pid[$i]=$!<br />
#echo "new pid=${pid[$i]}"<br />
fi<br />
done<br />
sleep 5 # check process exist per 5 second<br />
done<br />
}}<br />
<br />
Open {{ic|/etc/inittab}} and setup as follows:<br />
<br />
{{bc|<br />
#id:3:initdefault:<br />
id:5:initdefault:<br />
...<br />
x2:5:once:/root/twin.sh > /root/twin.log 2>&1<br />
}}<br />
<br />
==Troubleshooting==<br />
<br />
===My Windows key doesn't work anymore===<br />
<br />
Put this in [[Execute commands after X start|a startup file]]:<br />
xmodmap -e "add Mod4 = Super_L Super_R"<br />
<br />
===Unreliable behaviour (black picture without cursor)===<br />
<br />
If everything seems to be set up correctly, but for some reason you always get a black picture without a cursor, try setting the first initialized card in the BIOS to be the PCI card one.<br />
<br />
===Little black boxes/dots on the desktop===<br />
<br />
This is actually portions of the virtual terminals being painted on top of X. It seems to be caused by the Linux kernel framebuffer. This can be fixed by disabling the framebuffer, or by removing the "-sharevts" option from the primary seat's X args.<br />
<br />
===Multimedia keys not working===<br />
<br />
If your keyboard(s) has extra "multimedia" keys, you may find that they stopped working in your multiseat setup. This is because such keyboards are often represented as more then one "event" device. As you did above, cat each /dev/input/event* device, this time pressing multimedia keys. Once you've found the right event device, add a separate keyboard InputDevice section for it, then add that InputDevice section to the corresponding ServerLayout section with the "SendCoreEvents" option, which indicates that input from this device should be handled, despite not being the core keyboard. In the end you should have sections something like the following:<br />
<br />
{{bc|<br />
Section "InputDevice"<br />
Identifier "Keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event6"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "Keyboard0Multimedia"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event7"<br />
Option "XkbModel" "evdev"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Layout0"<br />
Screen 0 "Screen0" 0 0<br />
InputDevice "Keyboard0" "CoreKeyboard"<br />
InputDevice "Keyboard0Multimedia" "SendCoreEvents"<br />
InputDevice "Mouse0" "CorePointer"<br />
Option "AutoAddDevices" "no"<br />
EndSection<br />
}}<br />
<br />
===The Ctrl-Alt-Fx, Alt-Fx keys mess up with virtual terminals===<br />
<br />
(Oct 2010) I follows this guide and everything works, except for Atl-F1, Atl-F2,... mess things up. Then I follow this guide https://help.ubuntu.com/community/MultiseatX (read the part for Ubuntu 10.04):<br />
<br />
{{bc|<br />
# cd /usr/bin<br />
# ln -s X X0<br />
# ln -s X X1<br />
}}<br />
<br />
Then fix in the '''/usr/share/config/kdm/kdmrc''' as follow<br />
<br />
{{bc|1=<br />
[General]<br />
ConsoleTTYs=tty1,tty2,tty3,tty4,tty5,tty6<br />
ServerVTs=7,8<br />
StaticServers=:0,:1<br />
ReserveServers=:2,:3<br />
...<br />
<br />
[X-:0-Core]<br />
ServerVT=8<br />
ServerCmd=/usr/bin/X1<br />
ServerArgsLocal=-nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0<br />
<br />
[X-:1-Core]<br />
ServerVT=7<br />
ServerCmd=/usr/bin/X0<br />
ServerArgsLocal=-nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0<br />
...<br />
}}<br />
<br />
It works for my computer: one on-board Intel card (xf86-video-intel driver), and one Nvidia card (xf86-video-nouveau driver). You can check if the parameters are passed correctly by:<br />
<br />
{{bc|<nowiki><br />
$ ps aux | grep 'PCI' | grep -Ev 'grep'<br />
root 16993 1.6 1.3 32900 26772 ? S 08:09 0:19 /usr/bin/X0 :1 vt7 -nolisten tcp -novtswitch -keeptty -layout Seat0 -isolateDevice PCI:0:2:0 -auth /var/run/xauth/A:1-ES6CCb<br />
root 17124 5.9 0.5 18996 11980 ? S 08:09 1:09 /usr/bin/X1 :0 vt8 -nolisten tcp -sharevts -novtswitch -keeptty -layout Seat1 -isolateDevice PCI:1:0:0 -auth /var/run/xauth/A:0-Wgiyza<br />
<br />
</nowiki>}}<br />
<br />
The '''ServerVT=7''', '''ServerVT=8''' would be pass to as '''vt7''', '''vt8'''<br />
<br />
==Final configuration==<br />
<br />
===/etc/X11/xorg.conf===<br />
<br />
This is my full xorg.conf with multiseat that works:<br />
{{bc|<br />
Section "Module"<br />
Load "dbe"<br />
<br />
SubSection "extmod"<br />
Option "omit xfree86-dga"<br />
EndSubSection<br />
<br />
Load "type1"<br />
Load "speedo"<br />
Load "freetype"<br />
Load "glx"<br />
EndSection<br />
<br />
<br />
Section "Files"<br />
RgbPath "/usr/share/X11/rgb"<br />
<br />
FontPath "/usr/share/fonts/misc"<br />
FontPath "/usr/share/fonts/75dpi"<br />
FontPath "/usr/share/fonts/100dpi"<br />
FontPath "/usr/share/fonts/TTF"<br />
FontPath "/usr/share/fonts/Type1"<br />
FontPath "/usr/share/fonts/msfonts"<br />
FontPath "/usr/share/fonts/misc2"<br />
FontPath "/usr/share/fonts/local"<br />
FontPath "/usr/local/share/fonts"<br />
EndSection<br />
<br />
<br />
Section "ServerFlags"<br />
# Option "DontZap"<br />
Option "AllowMouseOpenFail" "true"<br />
# Option "DefaultServerLayout" "alltogether"<br />
Option "Xinerama" "0"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard0"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event1"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "keyboard1"<br />
Driver "evdev"<br />
Option "Device" "/dev/input/event5"<br />
Option "XkbModel" "evdev"<br />
Option "XkbLayout" "be"<br />
EndSection<br />
<br />
<br />
Section "InputDevice"<br />
Identifier "mouse0"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2" # Auto detect<br />
Option "Device" "/dev/input/mouse2"<br />
Option "ZAxisMapping" "4 5"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "mouse1"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mouse1"<br />
EndSection<br />
<br />
<br />
Section "Device"<br />
Identifier "nvidia0"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:1:0:0"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "nvidia1"<br />
Driver "nvidia"<br />
Option "RenderAccel" "true"<br />
Option "TripleBuffer" "True"<br />
Option "NoLogo" "1"<br />
BusId "PCI:0:10:0"<br />
EndSection<br />
<br />
<br />
Section "Screen"<br />
Identifier "screen0"<br />
Device "nvidia0"<br />
Monitor "l1730s"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1280x1024" "1024x768"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "screen1"<br />
Device "nvidia1"<br />
Monitor "cpdm151"<br />
DefaultDepth 24<br />
Option "DPI" "100x100"<br />
<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1024x768" "800x600"<br />
EndSubsection<br />
<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat0"<br />
Screen "screen0" 0 0<br />
InputDevice "mouse0" "CorePointer"<br />
InputDevice "keyboard0" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "seat1"<br />
Screen "screen1" 0 0<br />
InputDevice "mouse1" "CorePointer"<br />
InputDevice "keyboard1" "CoreKeyboard"<br />
Option "AutoAddDevices" "off"<br />
EndSection<br />
<br />
Section "Extensions"<br />
Option "Composite" "Disable"<br />
Option "RENDER" "Enable"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "l1730s"<br />
HorizSync 30-93<br />
VertRefresh 60<br />
Option "dpms"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "cpdm151"<br />
Option "dpms"<br />
HorizSync 30-61<br />
VertRefresh 60<br />
EndSection<br />
}}<br />
<br />
===/opt/kde/share/config/kdm/kdmrc===<br />
<br />
This is my kdmrc:<br />
<br />
{{bc|1=<br />
[General]<br />
ConfigVersion=2.3<br />
ConsoleTTYs=vc/1,vc/2,vc/3,vc/4,vc/5,vc/6<br />
PidFile=/var/run/kdm.pid<br />
ReserveServers=:2,:3<br />
ServerVTs=-7<br />
StaticServers=:0,:1<br />
<br />
[Shutdown]<br />
BootManager=Grub<br />
HaltCmd=/sbin/halt<br />
RebootCmd=/sbin/reboot<br />
<br />
[X-*-Core]<br />
AllowNullPasswd=false<br />
AllowRootLogin=false<br />
AllowShutdown=Root<br />
Authorize=true<br />
AutoReLogin=false<br />
ClientLogFile=.xsession-errors-%s<br />
Reset=/opt/kde/share/config/kdm/Xreset<br />
Resources=/opt/kde/share/config/kdm/Xresources<br />
Session=/opt/kde/share/config/kdm/Xsession<br />
SessionsDirs=/etc/X11/sessions,/usr/share/xsessions,/opt/kde/share/apps/kdm/sessions<br />
Setup=/opt/kde/share/config/kdm/Xsetup<br />
Startup=/opt/kde/share/config/kdm/Xstartup<br />
<br />
[X-*-Greeter]<br />
AllowConsole=true<br />
AntiAliasing=true<br />
AuthComplain=true<br />
BackgroundCfg=/opt/kde/share/config/kdm/backgroundrc<br />
ColorScheme=<br />
DefaultUser=<br />
EchoMode=OneStar<br />
FaceSource=PreferUser<br />
FailFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
FocusPasswd=false<br />
ForgingSeed=1097313140<br />
GUIStyle=<br />
GreetFont=Tahoma,11,-1,5,75,0,0,0,0,0<br />
GreetString=Arch Linux %r (%h)<br />
GreeterPos=50,50<br />
HiddenUsers=root<br />
Language=en_US<br />
LogoArea=None<br />
LogoPixmap=<br />
MaxShowUID=65000<br />
MinShowUID=500<br />
PreselectUser=None<br />
SelectedUsers=<br />
ShowUsers=NotHidden<br />
SortUsers=true<br />
StdFont=Tahoma,11,-1,5,50,0,0,0,0,0<br />
UseBackground=false<br />
UserCompletion=false<br />
UserList=true<br />
<br />
[X-:*-Core]<br />
AllowNullPasswd=true<br />
AllowRootLogin=true<br />
AllowShutdown=All<br />
NoPassEnable=false<br />
NoPassUsers=<br />
<br />
[X-:*-Greeter]<br />
AllowClose=true<br />
DefaultUser=glenn<br />
FocusPasswd=true<br />
LoginMode=DefaultLocal<br />
PreselectUser=Previous<br />
<br />
[X-:0-Core]<br />
AutoLoginAgain=false<br />
AutoLoginDelay=0<br />
AutoLoginEnable=false<br />
AutoLoginLocked=false<br />
AutoLoginUser=glenn<br />
ClientLogFile=.xsession-errors<br />
ServerArgsLocal=-nolisten tcp -layout seat0 -sharevts -novtswitch <br />
<br />
[X-:1-Core]<br />
ServerArgsLocal=-nolisten tcp -layout seat1 -sharevts -novtswitch <br />
<br />
[Xdmcp]<br />
Enable=false<br />
Willing=/opt/kde/share/config/kdm/Xwilling<br />
Xaccess=/opt/kde/share/config/kdm/Xaccess<br />
}}<br />
<br />
==Related problems==<br />
<br />
===PulseAudio===<br />
If two users want to use the sound card simultaneously, it is necessary to use a sound server, [[PulseAudio]] being most prevalent. Usually, the PulseAudio server runs only for active user and does not allow for multiple user instances. Solution to this problem is using the system-wide PulseAudio server. Although this approach is discouraged by its authors, it is probably most applicable setup.<br />
<br />
;Configuring for system-wide PulseAudio<br />
* Create user pulse and put him into group audio (PulseAudio drops root privileges and changes to user pulse. Group membership allows for device access.)<br />
* Create group pulse-access and put users, who will play sound locally into it (Group membership is used for access control for local access to PA daemon.)<br />
* In /etc/pulse/default.pa state explicitly the access rights<br />
{{bc|1=<br />
load-module module-native-protocol-unix auth-group=pulse-access auth-group-enable=1<br />
}}<br />
<br />
Start PA as system-wide, under root: {{bc|pulseaudio --system}}<br />
<br />
In {{ic|/var/run/pulse}} should appear files for communication with daemon, namely pid and native. <br />
<br />
;User access<br />
You can check communication with system daemon as non-root by e.g. {{ic|pactl -s "unix:/var/run/pulse/native" list}}.<br />
<br />
It is possible to enable automatic connection to local daemon in /etc/pulse/client.conf<br />
{{bc|1=<br />
auto-connect-localhost = yes<br />
}}<br />
<br />
The users should be able to connect to PA server. All the cons for system-wide daemon become essentially pros, e.g. ability to control volume of other users streams in pavucontrol.<br />
<br />
;Troubleshooting<br />
It is possible to enable the http interface to PA for debugging in /etc/pulse/default.pa<br />
{{ic|load-module module-http-protocol-tcp}} and then connect to it at http://localhost:4714/<br />
<br />
==See also==<br />
*[https://bbs.archlinux.org/viewtopic.php?id=105450 The original Arch Forums thread].<br />
<br />
*The arckwiki page [[Multi-pointer X]] explains how to setup two separate pair of devices on the same session.</div>Shillshocked