Converting virtual disks between VMware, Virtual PC, bochs, and any other emulators is always an interesting problem. If the disk structures are known or can be reverse engineered, it’s possible to write a conversion utility. A much more generic way uses your favorite floppy-based or run-on-CD Linux version (like Knoppix) and a network connection for each real or virtual machine.
Assuming you’ve booted a small-footprint Linux on either machine (real or virtual) and there is network connectivity between them, you can transfer a disk image with a simple command pipe like:
source# dd if=/dev/hda | ssh user@target dd of=/dev/hda
where source and target are the source and target (V)Ms and user is the remote account on the target host. For this to work, you’ll either have to allow ssh root logins or grant user write permissions to /dev/hda. It’s not pretty either way, but we’re not talking about making dangerous permanent changes on a production box.
If you find that you do this a lot, there are certainly ways to automate this procedure. It’s also possible to copy the images to a central file server. Another possible improvement would be a transfer protocol that transfers a sparse image, i.e. it skips disk sectors that are zeroed out.
Posted by markus on Friday, September 12, 2003