I have really been looking forward to getting this tutorial published. This article will describe something that will be sure to make every Windows and Mac user very jealous. When we are done, we will have converted one computer into two computers. How? Read on.
In order to make this work, there are a couple of requirements:
* If you have an integrated card and a dedicated video card, you may be able to proceed if your BIOS allows both to be active at the same time. This is what I did in my setup.
Unfortunately, I have not played around with my setup enough to determine if it is possible to create a multiseat setup using a single dual-head video card. I may explore this in a future article.
Each "seat" consists of a single monitor, mouse, and keyboard and will eventually run its own login session. The first seat will always be referred to as
seat0. We will assign the name
seat-1 to the second seat. Although this article will explore only two seats, it is possible to have more than two seats.
We will be using loginctl to assign devices to particular seats. Unfortunately, this is where things get a bit tricky. Devices are identified by directories in
/sys, which isn't exactly user-friendly. However, loginctl provides an additional command that will prove to be very helpful. Open a terminal and run the following command:
loginctl seat-status seat0
This command will provide identifiers for the hardware currently assigned to
seat0. Because you only have one seat, this will include all of your connected hardware. Here's what the output of the command looks like on my machine:
You will need to identify each of your devices by their descriptive names and use the associated
/sys/... path when assigning them to seats. Consider the following example:
├─/sys/devices/platform/i8042/serio0/input/input2 │ input:input2 "AT Translated Set 2 keyboard"
This device refers to the PS/2 keyboard (PS/2 devices are controlled by the i8042 controller). We can assign this device to
seat-1 by using the following command:
sudo loginctl attach seat-1 /sys/devices/platform/i8042/serio0/input/input2
Once you have attached the keyboard to another seat, it will no longer function on
seat0. Try typing something on the keyboard - it won't have any effect. In order to actually use the keyboard, you will need to assign one of your video cards to the seat. In my case, I have both an APU (Radeon HD 7560D) and a Radeon R9 270X. Each includes the card and associated framebuffer:
It may be a bit confusing to see
fb1 assigned to
fb0 assigned to
card1 but if you are careful to match the bus numbers (
0000:00:01.0, etc.) you shouldn't have any problems.
Once you have assigned the hardware to the appropriate seat, reboot your computer and cross your fingers. (Simply logging out or restarting X didn't seem to work for me.) If all went well, you will be greeted with two login screens - one on each monitor.
Don't worry if one of the keyboards or mice isn't assigned to the correct seat. Use the commands above to reassign them to the correct seat. The changes will be applied instantly and you won't need to restart anything.
Try logging in under two different user accounts and launching applications. Each seat is completely isolated from the others, allowing each user to login and use their account as they normally would.
At first, it might seem impossible to have separate sound cards assigned to each seat since most computers only have a single soundcard. Or do they?
If your video card has an HDMI port, chances are good that you can use the HDMI port for audio playback as well as video. Open System Settings and click the Sound icon. Try selecting one of the other soundcards listed:
If you have Bluetooth speakers (or, more correctly stated, anything that can act as an A2DP sink), you may be able to use that. I haven't tried this myself, but I see no reason why it wouldn't work.
Once you have identified two soundcards, you can assign them to a particular seat using the same commands as above. For example, I assigned my primary soundcard to
sudo loginctl attach seat-1 /sys/devices/pci0000:00/0000:00:14.2/sound/card1
One of the easiest ways to control USB peripherals attached to a seat is to connect them all to a USB hub and assign the entire hub to the seat. That way, the user using the seat can add and remove devices as they please without the need to assign them one-at-a-time.
Reverting your setup to its initial configuration (a single seat) couldn't be easier. Just run the following command:
sudo loginctl flush-devices
Download the official 2buntu app for both Android and Ubuntu Touch.