Mac – Create a VM from DMG disk image created from Windows XP Boot Camp Partition

boot-campdisk-imagevirtual machinevmware-fusion

I had Windows XP installed on a Boot Camp partition, and wanted to replace it with Windows 7, so I used Disk Utility to create a .DMG image from the partition, reformatted and installed Windows 7 on the Boot Camp partition.

Now I'd like to create a virtual machine from that DMG image. I'd like the VM to be compatible with VMware Fusion, my VM client of choice, but would settle for another format if it'll work.

I've googled, and tried a few things, but nothing seems to be panning out. I know you can create a VM from an ISO installer, but this is a backup of an already-installed Windows instance, so that approach doesn't seem to apply.

Any ideas?

Best Answer

Okay, so, first off: mount your .DMG image as a volume. You can do this by just double-clicking the image. The Finder window should come up with the image contents.

You can then make a virtual disk from the mounted image by following this guide. If you're having a hard figuring out the device path (like /dev/disk1) then you can simply open Disk Utility once the image is mounted. If you right-click on the .DMG (shown on the left-hand side), you can go to "Information" and it should have the disk number ("disk1", for example.)

From there, following the guide (and assuming "disk1"), do:

/Library/Application Support/VMware Fusion/vmware-rawdiskCreator print /dev/disk1
# Here you make sure partition 1 is the one you want...
/Library/Application Support/VMware Fusion/vmware-rawdiskCreator create /dev/disk1 1 boot-camp-link ide
/Library/Application Support/VMware Fusion/vmware-vdiskmanager -r boot-camp-link.vmdk -t 0 boot-camp.vmdk

Now you should wind up with a "boot-camp.vmdk" that you can use as a disk in a Fusion VM.

Related Question