Instructions

Differences between revisions 7 and 8
Revision 7 as of 2014-08-22 20:24:42
Size: 7173
Editor: b123ae8d
Comment:
Revision 8 as of 2014-08-25 12:51:39
Size: 7622
Editor: b123ae44
Comment:
Deletions are marked like this. Additions are marked like this.
Line 9: Line 9:

'''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).
Line 17: Line 19:
 * Tag it with the seat name (e.g., `seat1`). This is optional for `seat0` but required for other seats.
 * Set the `ID_SEAT` property to the seat name (e.g., `seat1`). This is optional for `seat0` but required for other seats.
 * 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.
Line 29: Line 31:
Example system #1 has two seats (`seat0` and `seat1`) 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: 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:
Line 32: Line 34:
TAG=="seat", DEVPATH=="/devices/pci0000:00/0000:00:1d.7/usb2/*", ENV{ID_SEAT}="seat1", TAG+="seat1" TAG=="seat", DEVPATH=="/devices/pci0000:00/0000:00:1d.7/usb2/*", ENV{ID_SEAT}="seat-1", TAG+="seat-1"
Line 35: Line 37:
TAG=="seat", DEVPATH=="/devices/pci0000:00/0000:00:07.0/0000:03:00.0/*", ENV{ID_SEAT}="seat1", TAG+="seat1" TAG=="seat", DEVPATH=="/devices/pci0000:00/0000:00:07.0/0000:03:00.0/*", ENV{ID_SEAT}="seat-1", TAG+="seat-1"
Line 39: Line 41:
Example system #2 has two seats (`seat0` and `seat1`) 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: 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:
Line 42: Line 44:
TAG=="seat", DEVPATH=="/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.6/*", ENV{ID_SEAT}="seat1", TAG+="seat1" TAG=="seat", DEVPATH=="/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.6/*", ENV{ID_SEAT}="seat-1", TAG+="seat-1"
Line 45: Line 47:
TAG=="seat", DEVPATH=="/devices/pci0000:00/0000:00:1c.0/0000:02:00.0/*", ENV{ID_SEAT}="seat1", TAG+="seat1" TAG=="seat", DEVPATH=="/devices/pci0000:00/0000:00:1c.0/0000:02:00.0/*", ENV{ID_SEAT}="seat-1", TAG+="seat-1"
Line 104: Line 106:
xdg-seat=seat1 xdg-seat=seat-1
Line 109: Line 111:
Suppose you need to modify your `xorg.conf` to change some video driver settings for `seat1`. You have a couple of options: Suppose you need to modify your `xorg.conf` to change some video driver settings for `seat-1`. You have a couple of options:
Line 111: Line 113:
 1. Create a file like `/etc/X11/xorg.conf.seat1` that contains all X settings for `seat1`, then set `xserver-config` in your `/etc/lightdm/lightdm.conf`:  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`:
Line 115: Line 117:
xserver-config=/etc/X11/xorg.conf.seat1 xserver-config=/etc/X11/xorg.conf.seat-1
Line 120: Line 122:
xdg-seat=seat1 xdg-seat=seat-1
Line 122: Line 124:
xserver-config=/etc/X11/xorg.conf.seat1 xserver-config=/etc/X11/xorg.conf.seat-1
Line 125: Line 127:
 2. Create a file like `/etc/X11/xorg.conf.d/90-seat1.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:  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:
Line 131: Line 133:
    MatchSeat "seat1"     MatchSeat "seat-1"

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:

  • # 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"
    
    # add master-of-seat tag to video cards
    TAG=="seat", DEVPATH=="/devices/pci0000:00/0000:00:01.0/0000:01:00.0/*", TAG+="master-of-seat"
    TAG=="seat", DEVPATH=="/devices/pci0000:00/0000:00:1c.0/0000:02:00.0/*", TAG+="master-of-seat"

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)

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 seatFoo is added, the following config section will be loaded, if available:

  • [Seat:seatFoo]
    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):

      [AutoSeat: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)