Today, we had to migrate a virtialbox VM to VMware, and i had to deal with a lot of issues. Hence i thought about documenting it here since it may help someone.
Convert QCOW2 to VMDK
If you are migrating from a KVM, use the below additional steps to convert the Disk to vmdk and load the VM to VirtualBox.
We have used the below command to convert the qcow2 image to vmdk.
qemu-img convert -f qcow2 myvm.qcow2 -O vmdk myvm.vmdk
Then created a new VM on the VirtualBox and used this Disk instead of a new one.
Convert the VirtualBox VM to OVF
Once the VM is available on VirtualBox, ran the below command to export the VM to OVF. You can also use the VirtualBox “Export Appliance” if you prefer to.
VBoxManage export centos-import -o jmyvm.ova
Convert the OVA to OVF
For this, you have to use the ovftool which is freely available from VMWware, but you just need to signup there with your email address.
Download Link : https://www.vmware.com/support/developer/ovf/
Once it is installed, We have used the below command to convert the ova to ovf
ovftool --lax myvm.ova myvm.ovf
Prepare the OVF file for VMware import.
- Delete the .mf file which was created by the OVF tool.
rm myvm.mf
Modifications to the myvm.ovf file
Change the VirtualSystemType to vmx-07.
From:
To:
Change the SATA controller to a SCSI controller.
Below change should be done to avoid getting the below error
“The specified operating system identifier ‘RedHat_64’ (id: 80) is not supported on the selected host. It will be mapped to the following OS identifier: ‘Other (32-bit)’.”
From
To
Remove the “Sound Card” section to avoid getting the below error message later.
Line 83: OVF hardware element ‘ResourceType’ with instance ID ‘7’: No support for the virtual hardware device type ’35’.
Upload the OVF to the ESXi
We have used the below command to upload the OVF to the ESXi Server.
192.168.10.25 is the IP of my ESXi Server
ovftool --net:"NAT=VM Network" -ds=datastore1 myvm.ovf vi://[email protected]
Opening OVF source: jenkins-hq.ovf
Enter login information for target vi://192.168.10.25/
Username: root
Password: ********************
Opening VI target: vi://[email protected]:443/
Deploying to VI: vi://[email protected]:443/
Disk progress: 13%
Once the process is completed, You will be able to start the VM from the ESXi server.