How can I set up multiseat with only one physical graphics card?

So this is an old guide, but it may still work. MultiSeatOneCard.

Some notes before I start bringing instructions over:

  • All the gdm configuration it wants you to do may not even be necessary. If you have GNOME, you already have gdm (and a much newer version). Unity uses lightdm, which looks like it may not work. You should install gdm and use it to try this guide.

  • Just another warning: OLD GUIDE. It may not work, it may break Ubuntu, it may blow up your machine (not really of course). Please be careful and back stuff up.

Now for the guide

The wiki suggests disabling the splash screen with the following. I don't know if the procedure still works or not.

A lot can go wrong with this setup and the fancy splash screen during the boot doesn't help. In order to disable it (maybe temporarily) edit /etc/default/grub and change the GRUB_CMDLINE_LINUX_DEFAULT assignment from quiet splash to nomodeset noplymouth. Then run sudo update-grub.

The next part, about "expanded desktop" can probably be skipped too. Just plug in both monitors and set them to "extended mode" in your monitor settings.

Now, for some configuration.

First, find in /etc/gdm/gdm.conf, in the [servers] section a line starting with 0=.... (without # at the beginning of the line). Put a # in front of it.

That should be possible without much trouble.

Then edit /etc/gdm/gdm.conf-custom. Find the [security] section and add a line PamStack=gdm-2.20.

This is where you might have a problem. Instead of 2.20, you may need to try 3.18 (this is for 16.04).

find the [xdmcp] section and add a line Enable=true.

That should cause no trouble.

XDMCP is not particularly secure protocol so it is a good idea to make gdm refuse connections from other computers. Add a line gdm: 127.* in /etc/hosts.allow and a line gdm: ALL in /etc/hosts.deny.

This, you can choose not to do. If you care about security, I suggest you do it, but otherwise, I think you can leave it.

Now restart gdm by rebooting (probably the easiest way). If you see the GDM login screen, something's up. Check over the original guide and tweak some settings.

If you don't have a login screen, then get to a TTY and run X -query 127.0.0.1. If GDM comes up, kill it (get back to the TTY and kill it there).

Make a new user called monitor:

addgroup --gid 983 monitor
adduser --uid 983 --gid 983 monitor

Create a file (guide has no name specs) in /etc/udev/rules.d/my.rules and put in the following:

SUBSYSTEM=="input", OWNER="monitor", GROUP="monitor"

Some package installations:

apt-get install x11-utils xserver-xephyr

We need to separate the monitors with some aliases:

ln -s xmessage /usr/bin/xmessage0
ln -s xmessage /usr/bin/xmessage1

Log into the monitor user in the TTY and create ~/.xsession.

Put this inside:

runscreen () {
    # $1 = number
    # $2 = geometry
    local xpid winid k
    while :; do
        xmessage$1 -geometry $2 "Window $1" &
        xpid=$!
        k=10
        while \
            winid=`xwininfo -name xmessage$1|grep 'Window id'|cut -d' ' -f4` \
            && [ $k -gt 0 -a ! "$winid" ]
        do
            sleep 1
            k=$(($k - 1))
        done
        if [ "$winid" ]; then
            Xephyr :1$1 -parent "$winid" -dpms -keybd "evdev,,device=$3,$xkb" -mouse "evdev,,device=$4" -query 127.0.0.1 
        fi
        kill $xpid
        sleep 3
        kill -9 $xpid
    done 
}

# For some reason I was unable to set the following in xorg.conf
# We need to turn off power management of the main X server because it doesn't
# see either of the keyboards and the mice so it will enter power-saving mode
# after 10 minutes
xset s off
xset dpms 0 0 0
xset -dpms

xkb='xkbrules=xorg,xkbmodel=evdev,xkblayout=us'

# PS/2 keyboard and mouse
kbd1=`ls /dev/input/by-path/platform-*-event-kbd`
mouse1=`ls /dev/input/by-path/platform-*-event-mouse`

# USB keyboard and mouse
kbd2=`ls /dev/input/by-path/pci-*-event-kbd`
mouse2=`ls /dev/input/by-path/pci-*-event-mouse`

runscreen 1 1280x1024+1920+0 "$kbd2" "$mouse2" &
runscreen 0 1920x1080+0+0 "$kbd1" "$mouse1"

Remember to edit it to reflect your resolutions.

Run startx as the monitor user and see if it works.

This needs to be made to start at boot if it works, so add this to the end of ~/.profile (for the monitor account):

if [ "`tty`" = /dev/tty6 ]; then
    exec startx
fi

Kill the GUI and go to TTY6. Login as monitor and it should start up.

If that works, edit the file /etc/init/tty6.conf as root and replace the line starting with /sbin/getty with

exec /bin/login -f monitor tty6 </dev/tty6 >/dev/tty6 2>&1

If it works, but you want to also separate audio, the linked MultiSeatX guide has some stuff for you.

Please remember this may not work. I typed this up rather quickly and will hopefully edit it to be a bit more clear if necessary. I have adapted parts of the guide to be more up-to-date and increase the chance of success.

Good luck!


It sounds very cool, so I browsed around and found this wiki entry as linked from this wikipedia entry. It basically uses a tool called xephyr to organize inputs/outputs.

The entry is pretty old and only updated for ubuntu 12.04, but xephyr is still in the standard repos (just tested its presence on my computer). The config edits seem complex but pretty straightforward, it might still work. Here is a blog dating from 2014, that makes one also hopeful.

Please let us know how you fare!