Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is it possible to take the contents of a VM disk and write them directly to a hard drive, so that I can boot off of it and essentially turn the VM to a regular OS installation?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Yes, it is possible to write the contains from a virtual harddisk to a physical harddisk.

There are several V2P (virtual to physical migration) tools available, depending on your virtual machine software (and thus VM disk format).

For virtual box:

  1. Prepare the VM disk with vboxmanage internalcommands converttoraw vm_disk.vdi vm_disk.raw
  2. Copy it to the disk. dd if=vmdisk.raw of=/dev/sda bs=1M
    Make sure you select the right destination disk.

Depending on your OS that might just work (e.g. for most BSD and Linux VMs), or you can run into a lot of driver problems. The latter is likely with windows where a driver model is selected during installation and used from that point onward. That model now has the wrong drivers, namely the ones for the virtualbox 'hardware' while it now is on the bare metal hardware.. Linux usually (re)detects the hardware on boot. That makes it a bit slower to boot but it usually copes well with these kind of changes.

(You did not specify any OS in the VM, so I just try a broad answer here).

Should the OS be windows and should it fail to boot read one of the many posts on sysprep. Those will show you how to make a backup of the VM (just in case), run generalise with sysprep and then start the V2P conversion.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.