|
Block-level Parallels-Fusion Migration
I currently run my mail server under Debian running on Parallels Desktop 2. Unfortunately Parallels Desktop 2 is end-of-lifed and has USB issues with Mac OS X 10.4.10 and later. Sadness: I upgraded to Parallels Desktop 3 and found it incredibly unstable. What to do?
Fortunately VMware’s Fusion has shipped and it seems even snappier than Parallels 2 and completely stable. But how to migrate my mail server VM from Parallels to Fusion?
Unfortunately there’s no official migration path if the guest OS isn’t Windows. I really didn’t want to spend the time building up a brand-new Debian mail server with its the associated configuration headaches, so I decided to dig a little and see if I could migrate the disk image itself. Sure enough, you can. Here’s how you do it:
Let’s call the original Parallels virtual machine “MyVM”. First thing, open ~/Library/Parallels/MyVM/MyVM.pvs in a text editor and take note of the cylinders+heads+sectors settings for your disk image. Mine looked like this:
Disk 0:0 cylinders = 16254
Disk 0:0 heads = 16
Disk 0:0 sectors = 63
We’re going to multiply all the numbers together to get a total sector count: 16384032 (16254 * 16 * 63). We’ll need this number a little later on.
Both Parallels and Fusion utilize sparse disk images by default, but I highly doubt their implementations are on-disk compatible. So convert the sparse image into a plain image using Parallels Image Tool. Your input file will be something like MyVM.hdd, while your output file will be MyVM-plain.hdd. Note: this step will temporarily burn disk space.
We’re done on the Parallels side — we now have an unadorned file that’s a block-for-block realization of the virtual machine’s hard drive. Our next trick is to convince Fusion to play with this image file. I found a neat command-line tool stashed in Fusion’s app package: VMware Fusion.app/Contents/MacOS/diskCreate. We’ll use it to create a new nonsparse blank image like so:
diskCreate -t monoFlat -s 16384032 MyVM-plain.vmdk
Except substitute 16384032 with the total sector count you calculated from step 1. Note: again, this step will temporarily burn disk space.
This command yields two files in your working directory: a small textual MyVM-plain.vmdk and a large MyVM-plain-flat.vmdk. The big file is also an unadorned nonsparse disk image: the same format as our converted Parallels image. Now we just need to switcheroo the new empty file with the previously converted image:
rm MyVM-plain-flat.vmdk
mv /path/to/MyVM-plain.hdd MyVM-plain-flat.vmdk
At this point, Fusion is ready to play with your Parallels image. Just create a new VM and “use existing disk image” and point it at MyVM-plain.vmdk.
One drawback is that the disk image is no longer sparse and thus wastes lots of disk space. I like to archive off my entire mail server image and a sparse image is the difference between ~600MB and ~8GB. Fortunately it’s easy to convert the image back to a sparse image that works with Fusion. Again we’ll use diskCreate:
diskCreate -C /path/to/MyVM-plain.vmdk MyVM.vmdk
The -C option clones from an existing disk image, and diskCreate by defaults creates a sparse image that houses both the image metadata and image itself in a single file. Once the tool completes, you can create a new Fusion VM and point at MyVM.vmdk.
This technique isn’t limited to just Debian or other Linuxes — this should also work (or not) with any guest operating system that works with both Parallels and Fusion and should be lossless. I do recommend you uninstall Parallels guest tools from your guest OS before attempting the transition to Fusion. Once you’re up and running on Fusion, you can install VMware’s guest integration tools.
Saturday, October 06, 2007
12:00 AM
|
Focus of this site
Contact Me
Topics
RSS Feed
Linkblog
Twitter
Andy Finnell
Bill Bumgarner
Brent Simmons
Daniel Jalkut
Dave Dribin
Eric Albert
Eric Rescorla
Eric Sink
Greg Miller
Gus Mueller
Jeremy Zawodny
John Gruber
Mark Dalrymple
Michael Tsai
Peter Ammon
Raymond Chen
Ryan Wilcox
Scott Stevenson
Steven Frank
The Daily WTF
we hates software
Wil Shipley
|