ASUS UX305UA and Linux

The ASUS UX305UA is an ultrabook with the Skylake microarchitecture – the (as of writing) latest iteration in Intel processors. Unfortunately, Skylake support on Linux wasn’t really a granted thing the time the device got released. Fortunately it’s gotten a lot better of late.

After searching and reporting some bugs to the Debian Bugtracker, nearly everything works out of the box on Debian Sid (unstable), and probably soon on Stretch (current testing). So if you’re installing a new one now, I’d really suggest you go for Sid instead.

After installing the base system via a netinstall image, you’ll probably end up with a Stretch (testing) installation with a 4.3 kernel. This will not really work when rebooting, giving you a black screen. To solve that, boot with

i915.preliminary_hw_support=1 i915.modeset=0

on the kernel command line.

After this, I’d recommend adding a line for unstable and experimental to your apt sources:

# echo "deb unstable main contrib non-free" > /etc/apt/sources.list.d/unstable.list
# echo "deb experimental main contrib non-free" > /etc/apt/sources.list.d/experimental.list

and then upgrading your system to the latest unstable:
# apt-get update && apt-get dist-upgrade
This will result in you getting a linux-4.5 kernel and a boatload of updated drivers (eg. Xorg)

Next, upgrade even further: scary experimental mode on! This you’ll need to do manually (experimental never auto-upgrades, because of the possible breakage that might be caused):

First, find out the latest kernel

# apt-cache search linux-image-4 | grep amd64
linux-headers-4.5.0-1-amd64 - Header files for Linux 4.5.0-1-amd64
linux-image-4.5.0-1-amd64 - Linux 4.5 for 64-bit PCs
linux-image-4.5.0-1-amd64-dbg - Debugging symbols for Linux 4.5.0-1-amd64
linux-headers-4.6.0-rc3-amd64 - Header files for Linux 4.6.0-rc3-amd64
linux-image-4.6.0-rc3-amd64 - Linux 4.6-rc3 for 64-bit PCs
linux-image-4.6.0-rc3-amd64-dbg - Debugging symbols for Linux 4.6.0-rc3-amd64
linux-image-4.5.0-1-amd64-signed - Signatures for Linux 4.5.0-1-amd64 kernel and modules
linux-headers-4.4.0-1-grsec-amd64 - Header files for Linux 4.4.0-1-grsec-amd64
linux-image-4.4.0-1-grsec-amd64 - Linux 4.4 for 64-bit PCs, Grsecurity protection

As you can see above, 4.6.0-rc3 is available, but since it’s a prerelease kernel it’s not automatically installed. We want it, and with it, a bunch of firmware packages (to make sure we have the latest)
# apt-get install -t experimental linux-image-4.6.0-rc3-amd64 firmware-linux firmware-iwlwifi firmware-misc-nonfree intel-microcode
For good measure, you can even throw the latest iwlwifi firmware (not packaged yet in Debian) in the mix (found on GitHub):
# wget -O /lib/firmware/iwlwifi-7265D-21.ucode
Next, reboot, and things should look a lot better already. Right now everything will work, except..

  • screen brightness buttons (Fn-F5 Fn-F6 Fn-F7). This requires (for now) this patch from kernel bugreport 98931. (Debian bugreport: 818494)
  • Screen auto brightness/ambient light (Fn-A): you can use the driver from GitHub
  • Disable-touchpad button (Fn-F7): you can use any old script, really. Just call synclient TouchpadOff=1 and it’s off. And =0 for on)

Using adb with a OnePlus X on Linux…

… is not really that hard. Just annoying. Since OnePlus’ USB ID is not in the default adb list, you need to add it yourself:
echo "0x2a70" >> ~/.android/adb_usb.ini
where 0x2a70 is the identifier for OnePlus. (you can find this with lsusb)

To add automatic permissions to the device node when it’s created, add this udev rule to /etc/udev/rules.d/51-android.rules (all on one line):

SUBSYSTEM=="usb", ATTR{idVendor}=="2a70", MODE="0666", GROUP="plugdev" ATTR{idVendor}=="2a70", ATTR{idProduct}=="9011|f003", SYMLINK+="libmtp-%k", MODE="660", GROUP="audio", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"

XPS13, Linux, suspend and Intel Rapid Start Technology

As an addendum to my previous post on how to install Debian Sid on the XPS13, I’ve been having issues with suspend – the laptop would sporadicaly not go to sleep properly on lid close, or it wouldn’t come out of suspend afterwards.

I seem to have found a solution for both:

  • The laptop suspends correctly after upgrading the xserver-xorg-video-intel driver to the version available in experimental, and upgrading the kernel to kernel 3.9 rc 6 (which contains a bunch of fixes for Ivy Bridge, and the touchpad driver comes built-in). You’ll need to manually build this kernel as detailed in the Debian Kernel Handbook.
  • The not waking up part seems to have been caused by the Intel Rapid Start Technology (iRST in short), which basically is an (S4) hibernate triggered from the BIOS a short while after you put the laptop in (S3) suspend (you never see this from the OS side). The laptop will dump the memory contents to a special partition on the harddisk and shutdown completely. Very good for battery life, less so for waking up from suspend – sometimes it would be instantaneously, sometimes it would take a minute or two, and at other times it just wouldn’t do anything.
    After disabling this in the BIOS the laptop works as expected.
    (you can find more about iRST and Dell here)

Dell XPS 13 and Debian Sid

I purchased a Dell XPS 13 Ultrabook, to replace my ageing Apple Macbook 2,1. After six years of daily use, it’s (over)due to retire.

The reasons for not going for another Apple product:

  • I don’t agree with their behaviour in the various markets where they’re competing. It’s competing, Apple, not sueing for the smallest tidbit. Want to survive, innovate.
  • I no longer use OSX. Linux all the way, baby.
  • Seriously overpriced hardware for the same specifications. The only thing going for them is the screen resolution on the Retina models.

Extra reasons to go for the XPS 13:

  • Nice extra discount through work.
  • Very nice screen resolution on a 13″. Not quite up to retina specs yet, but this is good enough ;)
  • Ultrabook. Light. Long battery.
  • SSD, and loads of RAM

Spec comparison:

Apple Macbook 2,1Dell XPS 13 (2013)
Screen resolution:1200×8001920×1200
Storage:80GiB HDD256GiB SSD
CPU:Core2Duo 2GHzCore i5-3337U
Battery life:3-4 hours7-8 hours

The laptop arrived in a sortof-stylish black Dell box, unfortunately taped over with all kinds of deliver stickers. Oh well.

The box it was shipped in

The box it was shipped in

Inside you can see the box for the power cord, and the box with the actual laptop. Nicely packaged, pluspoints here, Dell ;)

Nicely packaged

Nicely packaged

Fancy Dell box containing the actual laptop

Fancy Dell box containing the actual laptop

The actual laptop. Wrapped in plastic, protected with foam

The actual laptop. Wrapped in plastic, protected with foam

All unpacked and ready to rock!

All unpacked and ready to rock!

It’s also a bit smaller than my old Macbook, although they’re both rated as being 13″ laptops.

Dell XPS13 on top of my Macbook 2.1. Bit smaller. A lot lighter.

Dell XPS13 on top of my Macbook 2.1. Bit smaller. A lot lighter.

Unfortunately, the laptop I got shipped originally had some issues: plenty of backlight bleeding, and a wifi module that was broken – it would detect a wireless network for 1-2 minutes after powerup, and then nothing.
I called Dell, they sent round a technician… but after this repair, it was completely dead. So they shipped me a replacement, on which I’m typing this blog-post.

Back to the actual laptop – it’s a nice piece of hardware, but the Core i5 version comes shipped with Windows 8, unfortunately. Luckely for us, it’s easy to put something else on (or next) to it ;)
(note: the Core i7 version is the ‘developer’ version, which is shipped with Ubuntu! :D It’s called Project Sputnik)

Steps to shrink the Windows 8 partition (if you want to keep it around, otherwise you can just wipe the entire SDD. Don’t forget to first create some recovery images, though!):

  • Disable hibernate: open a command prompt (in admin mode) and type: powercfg /H off
  • Disable the windows pagefile (you can do this in Control Panel – System – Advanced Settings)
  • Disable system restore (ditto)

A reboot later, you should be able to shrink the partition to the minimum required (I left it around 50GiB). If you don’t disable all that crap, Windows will only allow you to shrink down to around 110GiB, which is frankly ridiculous.
You can enable everything again after shrinking the partition.

This will leave us with a nice amount of storage to put Linux on.

Now, download the Debian Testing latest weekly dvd 1 for amd64. You’ll also need a USB stick of 8GiB (4.5 is needed). Format that stick as FAT32, and copy the content of the DVD image on the stick (not the actual ISO).

After this is done, you can reboot the laptop. When you see the Dell logo flash on the screen, quickly hit F12 (repeatedly). This will present you with the boot menu, where you can choose what to boot. I recommend to pick ‘Legacy mode’, and from there ‘USB storage’. Normally this will boot the Debian installer from the memory stick.

To install Debian, I refer you to the Debian Installation Manual, an excellent document that details all the steps. Just be careful not to wipe out the existing Windows partition, should you want to keep it ;)

Some time later, you’ll get to reboot the system, and Debian should be the default choice to boot with the UEFI boot manager ;)

At this point it’s also highly recommended to add unstable and experimental sources to your /etc/apt/sources.list file – the testing distribution just installed it – ahem – slightly outdated in software terms, and we’ll definitely need a new kernel.

Add this to /etc/apt/sources.list (replacing XX with your two-letter country code):

deb sid main contrib non-free
deb experimental main contrib non-free
deb-src experimental main contrib non-free

Do an apt-get update && apt-get dist-upgrade and you’re good to go on the packages. For a newer kernel, do apt-cache search linux-image and check for the latest kernel release, right now that is linux-image-3.8-trunk-amd64, which you can install with apt-get install -t experimental linux-image-3.8-trunk-amd64.

Now, to fix some of the issues I’ve encountered:

Non-functional wifi
On another laptop (or in Windows), download the firmware-iwlwifi package. Install it – a reboot later you should be able to configure the wireless interface. You might also need wpasupplicant if you use encryption on your network. (I’m lazy, so I downloaded all the packages needed for wicd and configured stuff that way.)

Laptop wakes from suspend out of the blue
I’ve encountered a few times that the machine came out of suspend without any trigger from me – highly annoying (and dangerous, should this happen while the machine is in a backpack and start to heat up). I’ve found this Bug report on Launchpad about it. The fix seems to be to disable “Smart Connect” in the BIOS. I’ve tried it here, seems to work.

Touchpad isn’t recognized as a touchpad
The patches to support the touchpad are on route to be included in kernel 3.9, but (at the time of writing) that one hasn’t been released yet. So we need to take the latest kernel available in Debian Experimental (3.8.5) and patch this with the driver. Luckely Debian has The Linux Kernel Handbook which explains how to do all this the proper Debian way ;)

First, install the necessary build packages: apt-get install build-essential fakeroot devscripts && apt-get build-dep linux-3.8
Next, get the kernel sourcecode: apt-get source linux-image-3.8-trunk-amd64 -t experimental
Download the patches too: wget '' -O /usr/src/cypress-touchpad-v7.patch and wget '' -O /usr/src/cypress-touchpad-v7.patch
Now, go to the source directory cd /usr/src/linux-3.8.5 and execute the script to rebuild the kernel with the two patches:  bash debian/bin/test-patches ../cypress-touchpad-v7.patch ../increase-struct-ps2dev-cmdbuf-to-8-bytes.patch
Now go eat a pizza, make some coffee, solve a theorem or so. It’ll take a bit. When it finishes, you’ll have another shiny kernel in /usr/src, which you can install with dpkg -i linux-image-3.8-trunk-amd64_3.8.5-1~experimental.1a~test_amd64.deb And Bob’s your uncle.

Brightness level doesn’t stick after a suspend/resume
For this I made a custom suspend-resume hook for pm-utils. Add the following script as /etc/pm.d/sleep.d/00backlight



case $1 in
echo “Saving backlight brightness level…”
cat $SYSFS/actual_brightness > $TMP
if [ -e $TMP ]; then
echo “Restoring backlight brightness level…”
cat $TMP > $SYSFS/brightness
rm $TMP
echo “No brightness level save file found.”
echo “Dunno what you’re trying…”
exit 1

This script will read the backlight brightness level upon suspend, and store it in a file in /var/tmp. Upon resume, the value is read from the file and the brightness level set to it.

The permanent fix is also scheduled for kernel 3.9.

Unreadable (way too tiny) fonts in applications
This is actually a drawback from having a high-resolution screen: a lot fits on it, but the fonts are tiny.
I had the issue mostly in Opera, IceDove (a rebranded Thunderbird) and XTerm, my X Terminal of choice.

In Opera you can just set the default zoom level. I put this at 120%, everything is readable now.
For Thunderbird, I can advise installing the ViewAbout extension, and then looking in View -> ViewAbout -> about:config for the setting layout.css.devPixelsPerPx, and setting this to “1.2”.
For XTerm, I added this to .Xresources (in my home directory):

XTerm*faceName: Dejavu Sans Mono
XTerm*faceSize: 11

so that XTerm uses the Dejavu Sans Mono truetype font, size 11, instead of the default.

Adobe AIR 2.6 and Debian Sid 64-bit

I wanted to get Adobe AIR to work on my 64-bit Debian Sid installation, to try out some other twitter clients, more specifically Saezuri. (On a side note: the offering of twitter clients on linux is … mediocre. Bad, even. The (imho) best one is Pino, but it has problems of it’s own).

(Sidenote: Adobe has decided to discontinue AIR for Linux.)

It didn’t really go all that smooth, so here’s the process:

First, download the Adobe AIR 2.6 runtime from Save it somewhere (like /tmp).
Next, open a terminal and make it executable: chmod +x /tmp/AdobeAIRInstaller.bin

Normally, now, you can try to install it: /tmp/AdobeAIRInstaller.bin. This should popup a dialog, telling you it’s going to install it. Unfortunatly at this point, I ran into a problem: it didn’t find either Gnome Keyring or KDE Kwallet, even though I have both installed on my system. After some digging, I recalled that AIR is a 32-bit framework, so I would need the 32-bit libraries for it to work.
While leaving the installer open, I went to look for the extracted directory, which was found under /tmp/air.w9qZiT, where, in one of the subdirectories I found a bunch of binaries which ended looking for libraries like
I found the needed libraries in the i386 packages kdelibs4c2a and libqt3-mt (which are for Debian Squeeze…), extracted them and put them in /usr/lib32:

lrwxrwxrwx 1 root root 16 Aug 8 2010 ->
-rw-r--r-- 1 root root 213988 Aug 8 2010
lrwxrwxrwx 1 root root 19 Aug 8 2010 ->
-rw-r--r-- 1 root root 2465476 Aug 8 2010
lrwxrwxrwx 1 root root 17 Aug 8 2010 ->
-rw-r--r-- 1 root root 172488 Aug 8 2010
lrwxrwxrwx 1 root root 25 Aug 8 2010 ->
-rw-r--r-- 1 root root 61452 Aug 8 2010
lrwxrwxrwx 1 root root 17 Sep 5 2010 ->
lrwxrwxrwx 1 root root 17 Sep 5 2010 ->
-rw-r--r-- 1 root root 7515480 Sep 5 2010

(I’ve made a tarball with those libraries, which you can find here. You can install it by extracting it with cd /usr/lib32; tar xvfz ia32-libs.tar.gz.)

Retry the installer, still didn’t go further. After some more digging, I found an article detailing the use of AIR on non-KDE and non-Gnome systems on the Adobe Knowledge base. (I use a mix of Gnome, GTK and KDE apps, with XFCE as desktop environment)

What I had to do was run the following commands before launching the installer:

(for Gnome, see the article)

After this, the installer went ahead and dumped AIR in /opt/Adobe AIR. (spaces in a directory? Really, Adobe????)

Next hurdle: after installing Saezuri, I noticed it had a hideous black border:

Saezuri with black border

… completely not acceptable. Luckely, this was easily fixed by enabling display compositing in the XFCE settings. Another problem fixed:

Saezuri with transparancy

The last problem I ran into is that AIR seems to default to firefox as the default browser. Since I’m not a firefox user (I do have it installed for those special occasions), that didn’t do. After some more digging I found a blog post detailing how to change this: apparently Adobe decided that hardcoding firefox as a browser was a good idea. I fixed this by hex-editing the file under /opt/Adobe AIR/Versions/1.0, changing the hardcoded ‘firefox’ by ‘browser’, and adding a symlink under /usr/bin pointing browser to x-www-browser:
ln -s /usr/bin/x-www-browser /usr/bin/browser
(x-www-browser is part of the Debian alternatives system, which allows for easy selection of default browsers and what not.)

You can download the patched here.

Now AIR seems to behave the way I want it to, so I’m a happy camper :)

Running Linux on an Apple Macbook 2,1

This page documents my attempts (and successes!) to get Linux fully working on an Intel-based Apple MacBook, 2007 model.

Note: I no longer have this device.

DISCLAIMER: This information is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. If you fry your system by using this information that’s _your_ problem. Not mine. I accept no responsability for what happens with this information whatsoever.

PCI Specs

00:00.0 Host bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and 945GT Express Memory Controller Hub (rev 03)
00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03)
00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03)
00:07.0 Performance counters: Intel Corporation Device 27a3 (rev 03)
00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)
00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02)
00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02)
00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 02)
00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 02)
00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 02)
00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 02)
00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)
00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02)
00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 02)
00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA IDE Controller (rev 02)
00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02)
01:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8053 PCI-E Gigabit Ethernet Controller (rev 22)
02:00.0 Network controller: Atheros Communications Inc. AR5418 802.11abgn Wireless PCI Express Adapter (rev 01)
03:03.0 FireWire (IEEE 1394): Agere Systems FW323 (rev 61)

Here’s a detailed pci listing.

Linux 2.6.x kernel

The latest 2.6 kernel is:
Here’s my 2.6.26 kernel configuration. This is actually the stock debian kernel.


Hardware: this is the Intel Corporation 82801G (ICH7 Family) USB chip.

USB worked out of the box by loading the following modules:

  • usb-uhci (USB 1.x support)
  • ehci-hcd (USB 2 support)

It is required to install the udev package.

10/100/1000 MBit ethernet LAN

Hardware: this is a Marvell Technology Group Ltd. 88E8053 PCI-E Gigabit Ethernet Controller chip.

Works out of the box, using the sky2 module.


Hardware: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller

Works out of the box with the ALSA module called snd_hda_intel module.

VGA Framebuffer console

Hardware: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller

Since the inception of kernel-mode-setting (KMS), no additional work is needed to get
a decent framebuffer console. Load the i915 module, and you’re set.


Hardware: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller

To make it working just set your video driver to intel:

		Section "Device"
			Identifier	"Generic Video Card"
			Driver		"intel"

With modern Xorg versions, you don’t even need to specify this anymore.


Hardware: HL-DT-ST DVDRW GWA4080MA.

Works out of the box, using libata.


Hardeware: Apple, Inc. Bluetooth HCI MacBookPro.

Works perfectly with the bluetooth and btusb modules.

Debian users might want to install the bluetooth package.


SATA drive. Works out of the box, if you enable the ata_piix module.

DMA is automagically enabled. I use hdparm to set an extra parameter: hdparm -F /dev/sda


  • -F: set security-freeze (so that nothing can accidentily lock your disk with a password)

For Debian; check the hdparm package.


You need this if you don’t want your CPU to eat your batteries empty. It’s included in the kernel config.

It works perfectly after loading the acpi_cpufreq and any of the cpufreq- modules.

You can either install the cpufreqd daemon, or use the cpufreq_ondemand module (which modulates the speed by requirement).

For Debian, check the cpufreqd or powernowd packages.

Wireless Lan

Hardware: Atheros Communications Inc. AR5418 802.11abgn Wireless PCI Express Adapter

Works out of the box with the ath9k kernel module.


Hardware: Atheros Communications Inc. AR5418 802.11abgn Wireless PCI Express Adapter

This also works pretty much out of the box. The kernel module to use is ochi_1394.


Currently not supported by the linux kernel. Possible patch: is here. Untested

Multimedia Keys

This laptop has several function keys which allow for the changing of the volume, brightness, …

After installation of pommed, these keys work perfectly.

Debian users can install the pommed and gpomme packages.

(Userspace) Software Suspend

Works: suspend to ram (s2ram). I’m using the following parameters: -f (force) -p (do VBE post) -m (save/restore VBE mode)

Doesn’t work: suspend to disk (s2disk,s2both): causes a full system freeze, need to dig into this further.

iSight webcam

Works with kernel supplied driver.

You need to extract the firmware first from the Mac OS X driver, use isight-firmware-tools. Debian users can use the isight-firmware-tools package.

Touchpad in console

You can use the touchpad with gpm, using the exps2 driver.

Touchpad in X.Org

This is an AppleTouch touchpad. You can use it with this driver.

Add the following to the /etc/X11/xorg.conf file:

Section "InputDevice"
        Identifier      "AppleTouch"
        Driver          "synaptics"
        Option          "AccelFactor"           "0.015"
        Option          "BottomEdge"            "310"
        Option          "Device"                "/dev/psaux"
        Option          "FingerHigh"            "30"
        Option          "FingerLow"             "20"
        Option          "HorizScrollDelta"      "0"
        Option          "LeftEdge"              "100"
        Option          "MaxDoubleTapTime"      "180"
        Option          "MaxSpeed"              "0.88"
        Option          "MaxTapMove"            "220"
        Option          "MaxTapTime"            "150"
        Option          "MinSpeed"              "0.79"
        Option          "Protocol"              "auto-dev"
        Option          "RightEdge"             "1120"
        Option          "SendCoreEvents"        "true"
        Option          "SHMConfig"             "on"
        Option          "TapButton2"            "3"
        Option          "TapButton3"            "2"
        Option          "TopEdge"               "50"
        Option          "VertScrollDelta"       "25"
        Option          "VertTwoFingerScroll"   "true"

Here’s my complete xorg.conf file

It’s advisable to run syndaemon after starting X, to prevent accidental taps while you’re typing.
example: syndaemon -i 2 -t -d

Debian users can install the xserver-xorg-input-synaptics package.


Multiseat on Debian

Since I have a rather well-scaled desktop PC (nothing really fancy by today’s specs, but it’s underused as it is), and my gf sometimes wants to use it, and sometimes we both want to use it at the same time, I decided to turn it into a multiseat configuration.

What’s a multiseat? Basically you connect a second set of input peripherals (keyboard, mouse) and a second screen (and if necessary a second video card) and reconfigure it to act as a separate pc.
And with Linux, you just can, without a lot of trouble.

There are some different multiseat setups: those that run separate X servers (one per display), and those that run one X server for all displays and then run a nested server on top of that to split out the actual displays. The ‘problem’ wit the latter is that you usually don’t have any 3D acceleration left, though if you use Xephyr these days that seems to work aswell.

I opted for the first option.

My hardware (that matters for this setup):

  • Mice: 2 simple Logitech usb mice
  • Keyboards: 2 usb keyboards (one Cherry Cymotion Linux Master & one labtec Ultraflat)
  • Graphics: an onboard ATI Radeon HD 3200 (this is part of the AMD 780 chipset) video chip on my Asrock motherboard (was originally disabled and enabled for this multiseat setup) and an addon ATI Radeon HD 4850 card (with an RV700 chip).
  • Screens: two screens – in this case, one 20.1″ Viewsonic VX2025wm and one 22″ (newly purchased) LG w2253TW


  1. It is advised to use chips that can be driven with the same driver for a multiseat setup!
  2. If you use an onboard chipset (like I do), you’ll need to change the boot order so that this chip is actually used as the primary device, otherwise it won’t be initialised correctly.

Originally I had the ATI binary driver fglrx installed, but this does _not_ play well with a multiseat setup. The initialisation of the second card causes the system to hardlock.
Since this driver doesn’t work, I went for the xf86-video-ati driver, which is completely opensource, and in combination with a recent kernel allows for kernel mode setting. You do need the firmware for the card, usually found in the firmware-linux packages of your favourite distribution.

So, the works:


  1. Get a spankingly fresh kernel. 2.6.33 at least, preferably newer. Compile it with KMS support enabled. Note that when you enable KMS support, you’ll lose your console unless you compile in fbcon, but I advise against this, as this doesn’t seem to play well with a multiseat setup.
  2. Install the linux-firmware package or get the necessary firmwares for your cards (to get 3D acceleration)
  3. Get a decently fresh Mesa (7.7 branch)
  4. Lastly, get a mjummy fresh xf86-video-ati driver.

Originally, I compiled all these and installed them over the existing binaries in /usr, but fortunately my favourite distribution Debian has the necessary components in Sid and Experimental. these days.

Xorg.conf changes

After everything is installed, you need to modify your xorg.conf file.


Section "ServerFlags"
        Option      "DefaultServerLayout" "seat0"
        Option      "AllowMouseOpenFail"  "true"
        Option      "AutoAddDevices" "false"

The AutoAddDevices line is important, otherwise we can’t map the devices to the right seat.

The actual graphic chips/cards:

Section "Device"
        Identifier  "ATI RadeonHD 4850"
        Driver      "ati"
        BusID       "PCI:2:0:0"
        Option      "Int10" "off"

Section "Device"
        Identifier   "ATI RadeonHD 3200"
        driver       "ati"
        BusID        "PCI:1:5:0"
        Option       "Int10" "off"

Int10 off is important here, otherwise the second card will fail to initialise.
Do not forget to change the PCI identifiers! They probably won’t match my setup. You can find them by using lspci, for instance on my setup:

lspci | grep  "Radeon HD"
01:05.0 VGA compatible controller: ATI Technologies Inc Radeon HD 3200 Graphics
02:00.0 VGA compatible controller: ATI Technologies Inc RV770 [Radeon HD 4850]

So you can see that the HD3200 is on address 1:5 and the HD4580 is on address 2:0.

The monitors (nothing fancy)

Section "Monitor"
        Identifier   "Viewsonic Vx2025wm"
        Option      "DPMS"

Section "Monitor"
        Identifier    "LG W2253TW"
        Option       "DPMS"

Screen section (mapping monitors and cards)

Section "Screen"
        Identifier        "Screen0"
        Device           "ATI RadeonHD 4850"
        DefaultDepth   24

Section "Screen"
        Identifier        "Screen1"
        Device           "ATI RadeonHD 3200"
        DefaultDepth   24

Next, the ServerLayout sections, one per seat:

Section "ServerLayout"
        Identifier     "seat0"
        Screen      0  "Screen0" 0 0
        InputDevice    "Mouse0" "CorePointer"
        InputDevice    "Keyboard0" "CoreKeyboard"

Section "ServerLayout"
        Identifier     "seat1"
        Screen      1  "Screen1" 0 0
        InputDevice    "Mouse1" "CorePointer"
        InputDevice    "Keyboard1" "CoreKeyboard"

Next, the input devices:

Section "InputDevice"
    Identifier     "Keyboard0"
    Driver         "evdev"
    Option         "Device" "/dev/input/by-path/pci-0000:00:12.1-usb-0:3:1.0-event-kbd"
    Option         "XkbModel" "pc105"
    Option         "XkbLayout" "us"
    Option         "XkbRules"   "xorg"

Section "InputDevice"
    Identifier     "Mouse0"
    Driver         "evdev"
    Option         "Protocol" "ExplorerPS/2"
    Option         "Device" "/dev/input/by-path/pci-0000:00:13.0-usb-0:3:1.0-event-mouse"

Section "InputDevice"
    Identifier     "Keyboard1"
    Driver         "evdev"
    Option         "Device" "/dev/input/by-path/pci-0000:00:12.2-usb-0:3.1:1.0-event-kbd"
    Option         "XkbModel" "pc105"
    Option         "XkbLayout" "us"
    Option         "XkbRules"   "xorg"

Section "InputDevice"
    Identifier     "Mouse1"
    Driver         "evdev"
    Option         "Protocol" "ExplorerPS/2"
    Option         "Device" "/dev/input/by-path/pci-0000:00:12.2-usb-0:3.2:1.0-event-mouse"

You need to change the device paths to match the devices you want, either by checking /dev/input/by-path/ or by /dev/input/by-id/. The benefit of using by-id is that if you replug your devices, they’ll still be mapped correctly. Since I have devices with the same ID, this didn’t work for me.

All these changes sofar should allow you to manually start up the X servers with the respective keyboard/mouse/screen settings. You should be able to test it with these commands:

/usr/bin/X -br -nolisten tcp -layout seat0 -sharevts \ 
      -novtswitch -isolateDevice PCI:2:0:0


/usr/bin/X -br -nolisten tcp -layout seat1 -sharevts \ 
      -novtswitch -isolateDevice PCI:1:5:0

KDM changes

Now, since I want both the X servers to be available at boot time, and I’m using KDE anyway, I went with KDM.

In the [General] section, look for a line reading:


change it to:


Also, change:




Next, look for the [X-:0-Core] section, and copy the entire block, creating a second block with the section name [X-:1-Core].

In the [X-:0-Core] section, look for the line

ServerArgsLocal=-br -nolisten tcp

and change it to

ServerArgsLocal=-br -nolisten tcp -layout seat0 -sharevts -novtswitch -isolateDevice PCI:2:0:0

In the [X-:1-Core] section, look for the line

ServerArgsLocal=-br -nolisten tcp

and change it to

ServerArgsLocal=-br -nolisten tcp -layout seat1 -sharevts -novtswitch -isolateDevice PCI:1:5:0

One KDM restart later (/etc/init.d/kdm restart) you should have two X servers running, both on their respective screens!

Last but not least, kudos to WKPG wiki for the helpful article ;)

Autoswitching network interfaces

Since I’m a lazy git, I want my laptop to automatically switch back & forth between my wired and wireless interfaces. Seems that stuff like Network Manager can do that for you, but it’s not really my thing. I don’t like stuff where you need a GUI to configure it, a duplicaton of network configuration, and it also tends to hang my machine. No idea why, though.

After an afternoon of fiddling around with several things, I came up with the recipe:
1 portion ifplugd, a good mix of ifupdown configuration with guessnet mappings, and some home-grown scripts. Mix well, and let simmer over a hot stove for half an hour. ;)

The details (tailored to Debian Sid):

  1. Install ifplugd and guessnet: apt-get install ifplugd guessnet
  2. Configure the interface you want ifplugd to monitor. For me, this is eth0 (wired ethernet). You can do this by editing /etc/default/ifplugd and adding eth0 in the INTERFACES field.
    Restart ifplugd (/etc/init.d/ifplugd restart)
  3. Edit your /etc/network/interfaces file the way you like it. I’m using multiple wireless entries with guessnet:
    mapping ath0
            script guessnet-ifupdown
            map verbose: false
            map debug: false
            map autofilter: true
    iface ath0-work inet dhcp
            test wireless essid WORK
            wpa-ssid WORK
            wpa-key-mgmt WPA-PSK
            wpa-proto WPA
            wpa-psk "***"
            wpa-driver wext
    iface ath0-home inet dhcp
            test wireless essid HOME
            wpa-ssid HOME
            wpa-key-mgmt WPA-PSK
            wpa-proto WPA
            wpa-psk "***"
            wpa-driver wext

    For syntax info, see man guessnet

  4. Replace the script in /etc/ifplugd/action.d with something more usable. The installed script only calls ifup or ifdown depending on what’s happening. What we want is to ifdown the interface, and ifup the other.

    Something like this:

    set -e
    if [ $# -ne 2 ]; then
            echo "Incorrect usage!"
            echo "$0:  "
            exit 1
    case "$2" in
            if [ "$1" = $WIRED_INTERFACE ]; then
                    # Wired interface is going up, bring wireless down
                    # if it is active.
                    WIFI_MODULE_LOADED=$(lsmod | grep ^$WIFI_MODULE | wc -l)
                    if [ $WIFI_MODULE_LOADED -eq 1 ]; then
                            /sbin/ifdown $WIFI_INTERFACE
                            /sbin/rmmod $WIFI_MODULE
                    /sbin/ifup $WIRED_INTERFACE
                    /sbin/ifup $1
            if [ "$1" = $WIRED_INTERFACE ]; then
                    # Wired interface is going down, bring up the
                    # wireless one.
                    /sbin/ifdown $WIRED_INTERFACE
                    /sbin/modprobe $WIFI_MODULE
                    /sbin/ifconfig $WIFI_INTERFACE up
                    sleep 5
                    /sbin/ifup $WIFI_INTERFACE
                    WIFI_CONFIGURED=$(grep ^$WIFI_INTERFACE $IFUPDOWN_STATE | wc -l)
                    if [ $WIFI_CONFIGURED -eq 0 ]; then
                            # Interface was not configured, bring it back down
                            # to save power
                            /sbin/rmmod $WIFI_MODULE
                    /sbin/ifdown $1

Now, every time ifplugd configures up eth0, ath0 is automatically deconfigured, and vice versa.
The actual configuration of the interfaces is still in /etc/network/interfaces, so you can still handle it by hand if you want to.

As always, it works fine for me, but YMMV, and TIMTOWTDI!