Upgraded to Ubuntu 10.10

The upgrade to Ubuntu 10.10, “Maverick Meerkat”, went smoothly enough. Except for one thing: Grub, as always. For some reason, Grub really hates me: for the last three Ubuntu upgrades, every time when I rebooted after the installation, it failed to boot. This despite the fact that I have a very straightforward setup: no dual-boot or anything, just a single Ubuntu installation on the machine. The error message this time was something along the lines of “unknown function”; I didn’t write it down exactly.

Last time, when upgrading to 10.04, it took me quite a while to get it working again. This time, fortunately, it went reasonably smoothly: download the live CD and boot with it, follow the usual magic incantations to chroot into your Ubuntu installation, and do dpkg-reconfigure grub-pc in order to generate a nice fresh Grub setup. No manual messing-around with the Grub config files was needed, this time.

Another problem, which a colleague warned me about, specifically concerns machines with an older on-board Intel video card. These older chipsets can only handle a virtual screen of up to 2048x2048 pixels. Since XRandr implements dual-screen support by creating a single virtual screen in the video card and mapping the physical screens into it, this means that you cannot have e.g. two 1280x1024 screens next to each other, because then the horizontal size of the virtual screen would exceed 2048. Well, actually you can, but DRI won’t work in that case, so you won’t have hardware acceleration, Compiz support, and various other goodies.

One easy and lame solution is to tell Ubuntu that your screens are placed above each other, rather than next to each other, so that you have a virtual screen of 1280x2048, which fits within the allowed limits. But of course this makes the mouse movements across the screens rather unintuitive, unless you actually place your physical screens that way..

We had this problem in Ubuntu 9.04; it went away in 10.04, but now apparently it is back again in 10.10. I’m sure that it’s possible to configure 10.10 in such a way that it works the same as in 9.04, but I never bothered. Instead, I perpetrated a horrible hack, of which I am horribly ashamed and perversely proud at the same time: movemouse. Movemouse is a tiny C program which monitors your mouse movements and adjusts them so that the mouse behaves appropriately for screens which are next to each other, even though Ubuntu believes that they are above each other. (I stole most of the code from Edward Rosten’s greasymouse.)

It’s silly, but it works. If you have the same problem:

a) Configure your two screens so that they form a 1280x2048 virtual screen. b) Download and unpack the .tar file. c) Build the ‘movemouse’ binary, or just use the 32-bits version included in the download. d) Run it. It will print your display dimensions, which should be 1280x2048, but your mouse will now behave as if your screens are in a 2560x1024 configuration. Abort with Ctrl-C. e) Place the binary somewhere, e.g. in /usr/bin or ~/bin, and add it to your Startup Applications.

Of course, this is pointless if your screens are more than 1024 pixels high, because then it won’t fit no matter how you position them. So if you have this problem, rather than downloading silly little executables from people you don’t know, perhaps it’s time to get better hardware?