How to convert a VMware Virtual Machine to KVM or Virtualbox VM


In this post we’ll see all the necessary steps to convert a VMware Virtual Machine to a KVM or Virtualbox VM.

Before to proceed you better backup your VM, I also suggest to execute a VMware disk repair just to make sure you won’t have bad surprises while converting.

Once you’ve backed up  your VM and checked (and eventually repaired) your VMware VM’s disk then proceed as follow:

1) Boot up your VMware VM and UNINSTALL VMware Tools, this because VMware tools will conflict with KVM (or Virtualbox), so you need to uninstall them before converting your VM.

2) If you created your VMware VM disk dividing it in multiple files then you’ll have to merge them into one file before converting your VM, this because KVM and Virtualbox converter uses only one file to convert it into a KVM or Virtualbox image file.

To do so get into your VM directory container and type:

$ vmware-vdiskmanager -r my-vm-disk.vmdk -t 0 my-vm-disk-new.vmdk

3) When your VM is finally ready for to be converted, convert it by executing:

To convert your VM to a KVM VM:

$ qemu-img convert my-vm-disk-new.vmdk -O qcow2 my-vm-disk-kvm.qcow2

To convert your VM to a Virtualbox VM:

$ qemu-img convert my-vm-disk-new.vmdk -O vdi my-vm-disk-vbx.vdi

4) If your VM contains Linux or BSD, it will be ready at this point, if, instead, it contains MS Windows or MAC OS X then you’ll have to proceed to install virtIO drivers.

Thanks for reading and, if you enjoyed this post, please support my blog by visiting my on-line hacking and engineering merchandise shop on redbubble.com by clicking here, thank you! 🙂

Advertisements

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