Instructions

Differences between revisions 12 and 13
Revision 12 as of 2014-09-04 20:48:42
Size: 7560
Editor: b123ab58
Comment:
Revision 13 as of 2014-09-05 11:39:21
Size: 7579
Editor: b123ad3b
Comment:
Deletions are marked like this. Additions are marked like this.
Line 44: Line 44:
SUBSYSTEM=="drm", KERNEL=="card[0-9]*", ATTRS{vendor}=="0x10de", TAG+="master-of-seat" SUBSYSTEM=="drm", KERNEL=="card[0-9]*", ATTRS{vendor}=="0x10de", DRIVERS=="nvidia", TAG+="master-of-seat"

Interested in setting up your own multiseat system? Follow these instructions:

1. Name Your Seats

Come up with names for your seats. You must have a primary seat named seat0. All other seat names must begin with seat (see the rules for seat naming). Note that VT switching (and thus fast user switching) is (currently) only possible on seat0.

HINT: When naming your seats, use a dash between prefix seat and your seat name suffix (e.g.: seat-1). This convention is consistent with machine-generated seat names like seat-usb-pci-0000_00_1d_0-usb-0_1_2. It will also allow in the future the possibility of supporting globbing in LightDM's seat config sections (e.g. [Seat:seat*] would match any seat, but [Seat:seat-*] would match any non-seat0 seat).

2. Configure Seat Hardware

Assign hardware devices to your seats by setting up udev rules.

Per-Device Configuration

A device that is associated with a seat must be configured as follows:

  • It MUST be tagged with seat. This is required, even for seat0. The existing udev rules do this properly 99% of the time, but exotic hardware, proprietary drivers, or unusual circumstances may require you to write your own udev rules to tag a device with seat or to prevent a device from being tagged with seat.

  • Tag it with the seat name (e.g., seat-1). This is optional for seat0 but required for other seats.

  • Set the ID_SEAT property to the seat name (e.g., seat-1). This is optional for seat0 but required for other seats.

master-of-seat

One of the devices for your seat MUST be tagged with master-of-seat. This tag signals to logind that the seat hardware is ready (enough) to start a display manager on that seat. If the tag doesn't exist on any of the seat's hardware, logind won't tell the display manager about the seat, and might not set device permissions properly if a user logs into that seat (TODO: confirm).

The udev rules that come with open-source video drivers tag the video card with master-of-seat for you. You should only need to set up a rule to tag master-of-seat if you are using a proprietary video card driver.

It is recommended that you apply the master-of-seat tag to the video card, but you may tag a different device instead. Tagging the video card with master-of-seat is recommended because it is often the only device that is critical for the seat.

Example #1

Example system #1 has two seats (seat0 and seat-1) and uses open-source video drivers. The file /etc/udev/rules.d/99-multiseat.rules was created and the following rules were added to it:

  • # assign USB ports
    TAG=="seat", DEVPATH=="/devices/pci0000:00/0000:00:1d.7/usb2/*", ENV{ID_SEAT}="seat-1", TAG+="seat-1"
    
    # assign video cards
    TAG=="seat", DEVPATH=="/devices/pci0000:00/0000:00:07.0/0000:03:00.0/*", ENV{ID_SEAT}="seat-1", TAG+="seat-1"

Example #2

Example system #2 has two seats (seat0 and seat-1) and uses the proprietary NVIDIA driver. The file /etc/udev/rules.d/99-multiseat.rules was created and the following rules were added to it:

  • # add master-of-seat tag to video cards (0x10de is NVIDIA vendor id)
    SUBSYSTEM=="drm", KERNEL=="card[0-9]*", ATTRS{vendor}=="0x10de", DRIVERS=="nvidia", TAG+="master-of-seat"
    
    # assign USB ports
    TAG=="seat", DEVPATH=="/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.6/*", ENV{ID_SEAT}="seat-1", TAG+="seat-1"
    
    # assign video cards
    TAG=="seat", DEVPATH=="/devices/pci0000:00/0000:00:1c.0/0000:02:00.0/*", ENV{ID_SEAT}="seat-1", TAG+="seat-1"

Tips and Troubleshooting

You MUST NOT have any newlines in a rule.

Use udevadm trigger after you edit your rules to make them take effect

Use udevadm info --export-db to see what udev did with your devices (to debug your rules).

3. Install PPA Packages

Upgrade to the packages in the multiseat PPA by running the following commands:

  • sudo apt-add-repository ppa:ubuntu-multiseat/ppa
    sudo apt-get update
    sudo apt-get upgrade

4. Configure lightdm

For Ubuntu 14.04 LTS (trusty) and later

Available lightdm packages for trusty already include a patch for automatic multiseat support, so no additional settings in lightdm.conf are required in principle. However, if you want to customize some settings for automatically added seats (like autologin-user or xserver-command), you can use [Seat:seat*] config sections.

For example, if a new seat named seat-Foo is added, the following config section will be loaded, if available:

  • [Seat:seat-Foo]
    autologin-user=user1
    xserver-command=X -core -dpms -s 0

For Ubuntu 13.10 (saucy) and older

Modify your lightdm.conf and:

  • make sure you have an entry per seat
  • add xdg-seat=<seatname> to each seat's entry

  • add xserver-vt=0 to each seat's entry EXCEPT seat0

  • add user-authority-in-system-dir=true to the SeatDefaults section (this prevents LightDM from trying to use the same Xauthority file for all seats, which causes 'permission denied' problems)

If you do not use the version of X from the multiseat PPA, you will need to tell LightDM to start /lib/systemd/systemd-multi-seat-x instead of X. This program is a small wrapper around X that prevents input events on non-seat0 seats from going to seat0 and disables VT switching on non-seat0 seats. It is only available in Ubuntu 13.10 (saucy).

Example:

  • [SeatDefaults]
    user-authority-in-system-dir=true
    # for saucy and newer: the following line is only needed if you're not
    # using the version of X from the multiseat PPA (but it shouldn't hurt
    # if you are)
    xserver-command=/lib/systemd/systemd-multi-seat-x
    
    [Seat:0]
    xdg-seat=seat0
    
    [Seat:1]
    xdg-seat=seat-1
    xserver-vt=0

5. (if needed) Configure X.Org Server

Suppose you need to modify your xorg.conf to change some video driver settings for seat-1. You have a couple of options:

  1. Create a file like /etc/X11/xorg.conf.seat-1 that contains all X settings for seat-1, then set xserver-config in your /etc/lightdm/lightdm.conf:

    • For Ubuntu 14.04 LTS (trusty):

      [Seat:seat-1]
      xserver-config=/etc/X11/xorg.conf.seat-1

      For Ubuntu 13.10 (saucy) and older:

      [Seat:1]
      xdg-seat=seat-1
      xserver-vt=0
      xserver-config=/etc/X11/xorg.conf.seat-1

    Note: This will not work if you use the systemd-multi-seat-x wrapper because it generates its own config file that overrides the xserver-config value. There's also no way to do such a thing if you use gdm instead of lightdm (e.g. if you have installed Ubuntu GNOME), because it doesn't support passing custom config file to X server.

  2. Create a file like /etc/X11/xorg.conf.d/90-seat-1.conf and put the settings there. This config file will be read by all seats, so use the MatchSeat directive to target the settings to a particular seat. For example:

    • Section "Device"
          Identifier "card0"
          Driver "nvidia"
          Option "NoLogo" "True"
          MatchSeat "seat-1"
      EndSection

6. (raring only) install libpam-systemd

The libpam-systemd package replaces libpam-xdg-support. Ubuntu 13.10 (saucy) and newer already have libpam-systemd installed.

7. Reboot

8. Profit!

MultiseatTeam/Instructions (last edited 2014-12-16 13:01:43 by 187-11-244-53)