Home > Uncategorized > Raw dd image to Virtual Machine disk

Raw dd image to Virtual Machine disk

Whilst toying with an HP Thin Client, I took a copy of the internal 1GB flash drive using dd onto a USB flash drive I’d booted (using ubcd 5.0 b12) the device with.

Once you have such a raw dd image of a disk, you have a few ways to convert it into a format usable with VirtualBox,  VMware or Parallels.
Firstly, I discovered that Qemu (there’s a nice Mac port here http://www.kju-app.org/) has a utility called qemu-img.
To convert to the VMware format :
$ /Applications/Q.app/Contents/MacOS/qemu-img convert -f raw -O vmdk sda.dump sda.vmdk
To convert to the Parallels format :
$ /Applications/Q.app/Contents/MacOS/qemu-img convert -f raw -O parallels sda.dump sda.hdd
Or use VirtualBox to convert to it’s format :
/Applications/VirtualBox.app/Contents/MacOS/VBoxManage convertfromraw sda.dump sda.vdi --format vdi

Once you have the preferred type of file, it is simple enough to boot a virtual machine from the image, or firstly you’ll probably like to use your VM software to compress the image if at all possible :
/Applications/VirtualBox.app/Contents/MacOS/VBoxManage modifyhd sda.vdi --compact

NB. The ANSI standardised Open Virtualization Format (OVF) will commonly include disk images in the compressed VMDK format.

NB. Download the VMware Virtual Disk Development Kit, which allows you to mount and tinker with the files in VMDK disk images outside of VMware :
vmware-mount sda.vmdk /mnt/loop/

Tags: ,
  1. Harald Von Der Osten
    June 4, 2014 at 07:14

    Thanks a lot for this hint. Before I found your lines, I was spending hours trying and searching for utilities to import SuSE 12.2 to Parallels. Unfortunately, Parallel’s help like http://kb.parallels.com/de/6880 is out of date (no more any Image Tools (step 6) and so on). Hope that your hint helps also other users, Great job!! Harald

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: