Virtualise me

Published: October 02, 2009
Tags: virtualbox virtualisation thinkpad

Up until relatively recently, my computer arrangement had been as follows: I had two desktop computers, sharing a monitor, keyboard and mouse using a KVM switch. One of the machines was an old-ish IBM Thinkpad T42 laptop, which I put in a port-replicating docking station so I could easily take work out on the road with me. The Thinkpad ran Arch Linux and it's what I used to do almost everything - email, the web, development, research, music and videos. I liked the Thinkpad for the convenience of its portability and also because it didn't use a lot of power, and the various ACPI features like CPU throttling and suspending to RAM worked well under Linux, so that it drew practically no power when I wasn't actually using it. The other computer is a big, clunky tower desktop running Windows XP which was off most of the time, only switched on when I really needed something I could only do on Windows. Mostly this was to print (I can't get CUPS to play nice with our Canon MX850) or to play games. I don't actually do much PC gaming these days, but I did play WoW for a few months recently until it became boring. Wizards of the Coast now have a free Dungeons and Dragons MMORPG game that I have my eye on, but I'm trying to put off trying it until I pass an upcoming deadline for a journal article submission.

Anyway, a few months ago I accidentally destroyed my Thinkpad's motherboard in an incident that I guess I should write up as a cautionary tale about self-repair (probably more so against being impatient, but that's another story). So I needed a new Linux desktop machine until such time as I could find an affordable replacement Thinkpad mobo. I have a collection of 3 HP "e-Vectra" machines, which I bought from eBay years ago when I was very interested in cluster computing. I really like these machines because they're easy to find cheap, are very small (less than 30cm/1 foot in either of the long dimensions and not 10cm wide), they stack well (check out the photo in this forum post!) and don't draw a lot of power (there's no internal PSU, just a little brick transformer at the end of the cord, like a laptop). They're not the most powerful machines in the world, with 700 MHz Pentium III's and 128 MB of RAM, but I maintain that the perception of those sorts of stats as "uselessly low" by most people is largely an illusion generated by bloated mainstream software (this is a problem in both the Windows world and the FOSS world) and by a hardware industry driven almost purely by the game industry. I upgraded the RAM in one of them to 256 MB and went about seeing how it held up as a modern desktop. It wasn't terrible, and if it weren't for today's RAM-intensive web, it probably would have sufficed, but ultimately Firefox froze up just way too often so I had to look for another solution.

The big Windows XP machine actually has two identical hard drives in a RAID array, so I split them apart and installed Linux on the second one, keeping XP on the first. This machine is considerably more modern (2.8 GHz Athlon 64 processor, 2 GB RAM), so no performance issues at all, but having my Linux system and Windows system on the same machine was kind of a hassle. Anytime I wanted to do play a game or print something, I'd need to carefully close down everything I had running in Linux and reboot, only to have to carefully open all that stuff back up again when I was finished. Furthermore, I couldn't manage to get suspend to RAM working on that machine under Linux at all, so the machine ended up being left on 24/7. Because this machine was originally built for gaming by my brother-in-law, it's horribly power hungry(although probably not half as bad as the machine he built to replace it, leading to my inheriting this one) so I really didn't like this.

For the last few days I've been experimenting with a novel solution to this situation, and I think that I'll stick with it because it's worked out better than I ever expected. I've installed Sun's VirtualBox system on the Windows XP install of the machine and installed Linux inside of a virtual machine. This is pretty much the first time I've ever experimented with any kind of virtualisation technology seriously, and I have to say I'm incredibly impressed. I never imagined that the performance of a virtual machine would be good enough to actually use it as a desktop, but I'm writing this right now from inside the virtual Linux install, with mail client and browser running, and music playing smoothly. The performance is just fine. Yes, it's perceptibly slower than running Linux natively, but only just, and it's 100% endurable. With the virutal machine running in full-screen mode, there's pretty much nothing at all to give away the fact that Windows is talking to the hardware underneath it, all I can see is my ion3 X11 desktop. However, when the need arises, I can just minimise the machine and find myself at an XP desktop, ready to play games, to print something out, or to suspend the machine to RAM (which of course works perfectly under Windows). It really is like having immediate access to the very best of both worlds, the mainstream software and superior hardware support of Windows and the, well, everything else of Linux. As an added bonus, I can backup my entire Linux system as a single file, and even migrate a copy of it to any other Windows machine running VirtualBox! Seriously cool stuff.

The only real drawback I've found is that, because the virtual machine's network interface is implemented using NAT behind the host machine's interface, a few networky things don't work out of the box. The only thing that hasn't worked so far is NFS, as described in this forum post. This was easily solved by using sshfs, which just worked. Also I'll have to set up port forwarding if I want to be able to ssh into the virtual box from anywhere else, but that's no big thing.

I'm going to wait a few weeks to make sure there really aren't any hidden problems with this approach, but I'm thinking I'll probably stick to this arrangement and "re-RAID-ify" the two drives with the XP/virtual Linux image. Viva la virtualisation!

Feeds
Archives
Top tags