Tag Archives: amazon:asin=B0081LVOTQ

One Fedora 17 Box up to 16 USB Multiseat Terminals

Fedora 17, as shipped, supports only 7 or 8 plug-and-play USB terminals per machine. The cause is the kernel evdev driver’s limit of 32 input devices.

You can see how your 32 evdev slots are currently getting used on a system with the command

for i in {0..31..1}; do udevadm info -a -n /dev/input/event$i | grep name; done

On the Fedora 17 multiseat box I’m using now to write this post, I have 3 USB terminals sharing one box — while I’ve spent the afternoon figuring this stuff out on one of the USB terminals, at the same time the kids have been watching endless youtube videos with their headsets on the other two. On this box, the command above shows:

    ATTRS{name}=="Power Button"
    ATTRS{name}=="Power Button"
    ATTRS{name}=="Plantronics Plantronics .Audio 655 DSP"
    ATTRS{name}=="Dell Dell USB Keyboard"
    ATTRS{name}=="USB Optical Mouse"
    ATTRS{name}=="USB Optical Mouse"
    ATTRS{name}=="Dell Dell USB Keyboard"
    ATTRS{name}=="GASIA USB KB V11"
    ATTRS{name}=="GASIA USB KB V11"
    ATTRS{name}=="SIGMACHIP Usb Mouse"
    ATTRS{name}=="C-Media Electronics Inc. USB Multimedia Audio Device"
    ATTRS{name}=="CM109 USB driver"
    ATTRS{name}=="HDA Intel PCH HDMI/DP,pcm=3"
    ATTRS{name}=="HDA Intel PCH Line"
    ATTRS{name}=="HDA Intel PCH Rear Mic"
    ATTRS{name}=="HDA Intel PCH Front Mic"
    ATTRS{name}=="HDA Intel PCH Front Headphone"
    ATTRS{name}=="HDA Intel PCH Line Out"
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found

This shows I only have 14 evdev slots left (the “device node not found” ones are available slots). So I know I could only connect 7 terminals total to this machine (a USB terminal’s unused audio buttons + keyboard + mouse takes up 3, I could only get 14 / 3 = 4 more than the three I have).

We can lift the limit of USB terminals from 7 to 16 by disabling often unused input devices: hardware volume controls and system (power) buttons. The following udev rules script does that with 3 rules.

Note that this will mean you’ll have to power off / sleep from the UI, your mainboard audio will be disabled, and special keyboard multimedia keys will be disabled. Feel free to comment out the appropriate lines in the udev rules if you want to keep those.

To apply these optimizations, create a system file (as sudo) called /usr/lib/udev/rules.d/72-seat.rules
with the following contents and reboot.

#
# Bernie Thompson bernie@plugable.com
#
# These udev rules help alleviate the Linux kernel limit of 32 evdev devices.
# This file should be deleted once the kernel's 32 device limit is lifted.
#
# Background: Every input device on the system, including several for 
# power buttons, PCI audio, USB audio, keyboard multimedia keys, etc. 
# all count towards the 32 limit.  Many systems reserve at least 8 for
# these uses. So as shipped with Fedora 17, only 7 or so USB terminals 
# (like the Plugable DC-125 or Plugable UD-160-M) will work.
#
# Run this at a command line to see how your 32 event slots are being used:
#
# for i in {0..31..1}; do udevadm info -a -n /dev/input/event$i | grep name; done
#
# If you have any event slots free, you'll see a "device node not found" message for each
#
# USB terminals consume an extra event device with the USB HID device
# associated with the audio interface for volume control. The udev rule below
# frees it up. This will enable around 12 USB terminals per server.
#
SUBSYSTEMS=="usb", SUBSYSTEM=="input", ENV{ID_SEAT}!="seat0", ENV{ID_USB_INTERFACE_NUM}!="00", RUN="/bin/sh -c 'echo $id > /sys/$devpath/../../../driver/unbind'"

#
# Free up any input devices associated with audio on the PCI bus.
# *IMPORTANT* This will disable your PC's mainboard PCI audio
# (because we can only unbind the whole PCI device)
# This will enable 13 or so USB terminals per server
# Comment out the line with a "#" if you'd like PCI audio to work
#
SUBSYSTEM=="pci", ATTR{class}=="0x040300", RUN="/bin/sh -c 'echo $kernel > /sys/$devpath/driver/unbind'"

# 
# Free up any ACPI (system power) buttons. 
# *IMPORTANT* This will disable all built-in buttons on your PC (e.g. power)
# You will need to shut down, etc. from the Linux UI with administrative rights.
# This has the side-effect of making your PC slightly more secure against student tampering.
# Comment out the line with a "#" if you'd like these to work
# This will enable an extra USB terminal or so per server
# If you have no other event devices, other than the USB terminals, should get to 16 terminals.
#
SUBSYSTEM=="acpi", DRIVER=="button", RUN="/bin/sh -c 'echo $kernel > /sys/$devpath/driver/unbind'"

After creating that udev rule and rebooting, things look much more favorable in terms of evdev slots. Only the “real” USB keyboards and mice are left to consume slots:

    ATTRS{name}=="SIGMACHIP Usb Mouse"
device node not found
device node not found
    ATTRS{name}=="Dell Dell USB Keyboard"
    ATTRS{name}=="USB Optical Mouse"
    ATTRS{name}=="USB Optical Mouse"
    ATTRS{name}=="Dell Dell USB Keyboard"
    ATTRS{name}=="GASIA USB KB V11"
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found

There are now enough free slots for 16 USB terminals (or, more specifically, their keyboards and mice).

Hopefully this is just a temporary workaround, until someone tackles the task of lifting the kernel’s limit of 32 evdev devices. That’s a very constraining limit for a whole host of reasons.

Note that one of the remaining bugs in Fedora 17 is that random USB terminals often come up to a green screen, requiring an unplug/replug to get a login. These scripts may increase the frequency of that if you have a lot of terminals, as the system bounces against the 32 device limit, then returns below it as the udev rules execute.

Hopefully in future versions of Fedora / systemd, those race conditions will be closed.

Hope you enjoy turning your one Fedora 17 PC into many. Please comment if you have any problems applying, we’ll try to help. See also our post on some huge Fedora 17 performance optimizations for USB multiseat which greatly improve the default experience.

And if you’re running more than 8 terminals with Fedora 17, please post a comment – we’d love to hear about it!
[ud-160-m-post]

Dconf configuration: GNOME 3 Fallback Mode

The Linux GNOME 3 UI assumes you have a beefy 3D GPU and capable driver, which can cause problems when that isn’t the case.

Individual GNOME 3 users can fix this by setting their desktop experience to GNOME 3 “fallback mode” which can avoid the 3D compute burden. Fallback mode is an essential setting for older PCs, VMs, USB graphics, remote desktop, etc. It also provides the (arguably) more familiar GNOME 2 like experience (Applications / Places menus, desktop icons, etc.)

It’s possible to configure fallback mode for all users, plus the login screens, centrally by changing some dconf settings. Here’s how:

First, if you don’t already have a “user” profile, then we create one — specifying a new settings database we’ll call “fallback”. Create a file /etc/dconf/profile/user (as su / sudo) which contains these two lines:

user
fallback

Then we’ll create the settings directories for that new database

sudo mkdir /etc/dconf/db/fallback.d
sudo mkdir /etc/dconf/db/fallback.d/locks

Create a settings file to also use fallback once users are logged in. Create a file called /etc/dconf/db/fallback.d/60-user-fallback with:

[org/gnome/desktop/session]
session-name='gnome-fallback'

[org/gnome/desktop/background]
show-desktop-icons = true

# This one is useful more for automatic USB multiseat
[org/gnome/desktop/lockdown]
disable-user-switching = true

And, finally, create a settings file to have login screens themselves use fallback mode. Create a file /etc/dconf/db/gdm.d/60-login-fallback with:

[org/gnome/desktop/session]
session-name='gdm-fallback'

dconf is a binary settings database (very un-unix like), so for any of these changes to take effect, you must run

sudo dconf update

Which will update the binary blobs which are then queried by GNOME to apply these settings. See the dconf admin guide for more.

And that should do it. You should see the fallback look and feel (more like GNOME 2). And if you’re running in a VM, with USB multiseat, or anywhere you don’t access to a beefy 3D processor — you should see a big drop in CPU usage.

Again, these directions have only been tested on Fedora 17. Please feel free to comment on changes (if any) to apply them for other distros.

Plugable USB 2.0 Multiseat Zero Client for Windows Multipoint Server and Fedora Linux (DisplayLink DVI/VGA up to 192... Product Details
$79.00

New Distros and Linux Automatic USB Multiseat Support

OpenSUSE and ArchLinux appear to be making good progress on integrating the latest version of systemd, which is a central element of Linux’s new Automatic USB multiseat support — letting you turn one machine into many with plug and play USB terminals.

Since this is all open source, we expect the porting process will happen in time.

For now, the best bet is the distro under which support was first developed — Fedora 17 and later. On Fedora, any supported USB terminal (like those on the right), will automatically pop up a fresh login when plugged in, no software install or licenses needed.

Plugable DC-125 USB 2.0 Multiseat Zero Client for Windows Multipoint Server and Fedora Linux (VGA up to 1440x900 / 1... Product Details
$64.95