Kensington USB Adapter in Linux with udlfb

So I have decided to post this tutorial online because I had to figure out all of this on my own.
This setup is for my laptop that has intel integrated graphics (Sandybridge).
Due to a hardware limitation, you are only allowed to have one additional monitor attached via VGA/HDMI/DVI . I have one monitor attached via DVI and the other the Kensington USB to DVI Display Adapter.
I have gotten this working on the following linux distributions:
ubuntu 11.04
fedora 16
arch linux (current)

BEFORE YOU START:

  • This will get you two monitors (attached and external connected via HDMI/DVI/VGA) where you can move windows between them, and the USB monitor is a separate “instance” so to speak. You can move your mouse between, copy/paste, but you cannot move windows between them.
  • THIS ONLY WORKS FOR XFCE4. KDE4 and GNOME3 seem to now know how to handle the setup and just shows a background (maybe fixed soon?).
  • You have to xrandr –output HDMI3 –right-of LVDS1 (or something similar) EVERYTIME you log in. You also cannot do it via XFCE’s Startup Applications because it will run it on the USB display (it is first), and it cannot see the other monitors, so the command does nothing. I always alt-f2 with my laptop monitor having focus and run that command). I have not found a good way to not do this. If you do not do this, your laptop display will be mirrored on your HDMI/DVI/DVI monitor). Also if you change the X config and make the USB monitor not first, X on the USB monitor will not work.

You need the following packages (I apologize for not having this copy and paste):

  • xorg development libraries
  • xog utils (ubuntu. You need it for X macros. I did not need anything extra for fedora/arch)
  • dev tools (gcc/autoconf, etc.. build-essential,@development-tools or base-devel (ubuntu/debian, fedora, arch)

clone this git repository:
http://git.plugable.com/webdav/xf-video-udlfb/
git clone http://git.plugable.com/webdav/xf-video-udlfb/

./configure ( if you do not want to symlink /usr/local/X11/modules/drivers/displaylink_drv.so to /usr/X11/modules/drivers/ you must ./configure –prefix=/usr)
make && make install
this should create and install displaylink_drv.so

Use the following xorg file (install it in /etc/X11/xorg.conf.d/ . You may have to create that directory in debian/ubuntu, I forget where they put things normally, I think it is in /usr/share/X11/xorg.conf.d but I could be wrong, you could just place it there):

 

############ Original Video Settings ###########

Section “Device”
Identifier “Configured Video Device”
Driver “intel”
EndSection

Section “Device”
Identifier “Configured Video Device2″
Driver “intel”
EndSection

Section “Monitor”
Identifier “Configured Monitor”
EndSection

Section “Monitor”
Identifier “Configured Monitor2″
EndSection

Section “Screen”
Identifier “Default Screen”
Monitor “Configured Monitor”
Device “Configured Video Device”
SubSection “Display”
Depth 24
Modes “1920×1080″
EndSubSection
EndSection

Section “Screen”
Identifier “Default Screen2″
Monitor “Configured Monitor2″
Device “Configured Video Device2″
SubSection “Display”
Depth 24
Modes “1280×800″
EndSubSection
EndSection

#################################################

Section “ServerLayout”
Identifier “Server Layout”
Screen 0 “DisplayLinkScreen”
Screen 1 “Default Screen” RightOf “DisplayLinkScreen”
Screen 2 “Default Screen2″ RightOf “Default Screen”
Option “Xinerama” “off”
EndSection

#################################################

############### DisplayLink Stuff ###############

Section “Device”
Identifier “DisplayLinkDevice”
driver “displaylink”
Option “fbdev” “/dev/fb1″
EndSection

Section “Monitor”
Identifier “DisplayLinkMonitor”
EndSection

Section “Screen”
Identifier “DisplayLinkScreen”
Device “DisplayLinkDevice”
Monitor “DisplayLinkMonitor”
SubSection “Display”
Depth 16
Modes “1280×1024″
EndSubSection
EndSection

 

On Fedora, log out and log back in and it should work (the kernel module udlfb should be loaded upon boot. Your USB monitor will be green until this xorg module is loaded)

On arch linux and ubuntu:

DO NOT LOAD udlfb ON BOOT! Blacklist that module. This is a COMPLETE pain, but if you do not do this, and you try to start X , it will segfault. I have no idea why right now, just that it does. Arch linux blacklists this module by default, so you have to have to either load the module manually before you start X, or let your DM start, change to a virtual console, modprobe udlfb, restart your DM, and then it will work. If you get a segfault, something tried to start X with udlfb loaded on boot.

Also, of gnome3,kde4,xfce4, ONLY xfce4 seems to work with this. The others seem to freak out and not know how to display anything other than a background. Hopefully this will change soon.

 

I hope this helps someone, it is not easy to find up to date information on Displaylink drivers in Linux, let alone have dual monitors with one of them being Displaylink.