Cool Solution - Convert and migrate VMware images to UVMM

From Univention Wiki

Jump to: navigation, search
Produktlogo UCS Version 4.1

Note: Cool Solutions are articles documenting additional functionality based on Univention products. Not all of the shown steps in the article are covered by Univention Support. For questions about your support coverage contact your contact person at Univention before you want to implement one of the shown steps.

Also regard the legal notes at Terms of Service.

This article describes how to convert a VMware disk image file (vmdk files) to KVM image file.

VMware preparation

Use the VMware disk manager tool vmware-vdiskmanager to convert the image. The tool is included in every VMware workstation installation. If running the VMware workstation player (stand-alone tool), the tool can be downloaded from the VMware Knowledge base (section "Attachments"). When downloaded, the tool needs OpenSSL for Windows installed.

Change to the directory of the tool and run it:

vmware-vdiskmanager -r <diskfile>.vmdk -t 0 <diskfile>_copy.vmdk

This copies the virtual hard drive into one single file which then can be converted into a KVM image file.

Converting the image

Copy the image file to a server which has the component KVM virtualization server installed and run the following command:

qemu-img convert <diskfile>_copy.vmdk -O qcow2 /var/lib/libvirt/images/<new diskfile name>.qcow2

Attention: Make sure the server has double the size of the VMware disk file of free space available as the KVM image file will be a copy. The VMware disk image file can be deleted afterwards.

Create a new instance (with the correct profile) and select the converted image file as existing file for a new hard drive.

Attention: If the converted image contains a system other than a Linux distribution (like UCS, Debian or Ubuntu), make sure the hard disk is not paravirtualized! The system will be unable to boot!

Network configuration

If the system is set to obtain an IP address via DHCP, add the new MAC address to the object in the LDAP and adapt the DHCP service for the computer object.

Paravirtualizing a Microsoft Windows

Add a new device, type "CD/DVD-ROM drive", to the instance and select the "KVM Windows drivers" ISO-file as image.

System hard drive

Add a new, small-sized hard drive (eg. 10 MiB) and set the flag to paravirtualize it. Start the instance and install the KVM virtio drivers from the provided ISO file. After installing the driver, shut down Windows, remove the small-sized hard drive and edit the system hard drive and enable the paravirtualization.

When starting the instance, the Windows kernel loads the correct drivers and runs the hard drive paravirtualized.


The network adapter can be set to use the "Paravirtual device (virtio)" driver straight ahead. After Windows is booted, install the KVM virtio drivers and the network adapter is ready to use.

Personal tools