21 Feb 2010

Virtually Real

I recently needed to pull a retired hard drive from an old, no longer working box. This HD contained an ancient copy of Red Hat 9 that had been continually patched since Red Hat 6 in order to support an ancient build of Netscape's Directory Server and Messaging Server products.

Anyway - the box was no longer functional, but the drive had been untouched in years. I needed to bring the mail server back to life so I could resurrect the old archive on mail on it. I figured this would be pretty straightforward as long as the drive tiself was still functional (and ater sitting unspun and unused for several years this was a fingers-crossed assumption). So ... How to tackle this?

"No problem! I'll just create a virtual image in VMWare running Red Hat 9, put the HD into a IDE/USB shell, copy over the message store/binaries/ldap db, and voila!"

Well that didn't work. There are many compat libs, and shouldn't-ever-be-installed-any-more libs, and who knows what else that are buried in this old drive to support the slapd daemon. Without them the daemon won't start.

"No problem! I've got the drive connected to a USB port. The virtual machine see it. I'll just tell the virtual machine to boot directly from the drive!"

Well that didn't work either. It seems that VMWare Fusion 2.x doesn't understand how to boot from an actual HD connected to the USB port of the host machine. Much searching found hacks that involed qemu making images, or using dd to clone the drive into virtual storage, etc. I wasn't able to (quickly) find information about whether VMWare Fusion 3.x can do this out of the box, but I DID find that they won't let me try/evaluate 3.x with paying them money (since, you know, I already own 2.x).

I suppose I could try Parallels, but I couldn't find docs from them that explicitely said they support booting from a real disk.

qemu for Mac could be an option. Beats me. The two seconds I spent looking at its docs made the whole thing seem ill advised.

VirtualBox 3.x from Sun/Oracle is free, open source and claims to support booting from a real drive. Yay! But ... Did it Just Work? No. More searching was required. Turns out that VirtualBox does support this, but only if you invoke magic command line arguments to crease a disk "wrapper" that points to the right thing. I ended up doing it with this:

# VBoxManage internalcommands createrawvmdk -filename zim1.vmdk -rawdisk /dev/disk3
Sun VirtualBox Command Line Management Interface Version 3.1.4
(C) 2005-2010 Sun Microsystems, Inc.
All rights reserved.

RAW host disk access VMDK file zim1.vmdk created successfully.

From there I could select zim1.vmdk as a storage source in VirtualBox and assign it to a virtual machine. After that - Voila! Everything boots! Then there ws just the normal admin wrangling of the virtual machine to make the network work as expected, message slapd and nms to start, create a new IMAP account in my local mail reader that points to the virtual machine, and slurp down 7+ years of old email.

 

Note to people that make virtual machine software - this should not be this hard. I should be able to simply point to a block storage device on the host machine and say "that block storage device should be considered IDE 1 Master. Go." Why are you making this so hard?

Post new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre> <code>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.