vmdk to kvm (qemu)

I finally decided to migrate the last of my vmware-server systems to KVM.

The process is pretty simple and this is what I did.

  1. As my vmdk file was split into many 2Gb chunks I had to firstly convert that into a monolithic file.  This is easily achieved with the vmware-vdiskmanager utility supplied with vmware-server (or at least the version 1.0.x of vmware-server I was running 🙂 )

    vmware-vdiskmanager -r winxp.vmdk -t 2 winxp-full.vmdk

    The -t 2 is the important part taking all the 2Gb chunks *referenced* by the vmdk file and creating an equivalen single pre-allocated vmdk file.

  2. Once you have that file then it’s a simple qemu-img command to convert it to something that KVM is happy with.  In my case I wanted QCOW2 format.

    qemu-img convert winxp-full-flat.vmdk -O qcow2 winxp.img

    You will notice that I said -full.flat.vmdk – this is the pre-allocated file referred to by the new winxp-full.vmdk file.

  3. That’s it 🙂

2 thoughts on “vmdk to kvm (qemu)

  1. Why not use virt-convert?
    – Tex

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