úterý 21. května 2013

Migrating Virtualbox image to VMWare

Well... time from time one gets to a situation when he/she has an image in Oracle VirtualBox and needs to use it in VMWare, or other virtualization tools. So did I, trying to migrate my machine set up on VirtualBox to VMWare.

Sounds easy at the beginning:
1] Go to your VirtualBox and select File -> Export Appliance
2] Export the machine as .OVF (not .ova, explained below)
3] wait few hundreds minutes for the export to finish
4] Go to your VMWare Player click Open Virual Machine and select the OVF you created.
5] It tells you "The import failed because *.ovf did not pass OVF specification conformance or virtual hardware compliance checks". Don't worry and hit retry.


Life would be nice if this worked right? But it quite does not. OVF being Open Virtualization Format is described to be a standard. VirtualBox and VMWare can interpret different formats of the file. So you need to do the following:

  1. Open the <yourfile>.ovf in your favorite XML editor
  2. Find ovf:format parameter in a Disk tag and change it to "http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized"
  3. Find any elements describing a SATA disk and change it to SCSI. 
    • remember to have instanceId unique within the document
    • set lsilogic as resourceSubType
  4. make sure all elements called Item under the Section tag have the order of tags:
    • Caption
    • Description
    • InstanceId
    • ResourceType
    • ResourceSubType
    • Address (optional)
    • BusNumber(optional)
    • example:


  5. open command prompt (Start -> cmd.exe) 
    • navigate to your VMWare folder 
      • usually this way: cd "C:\Program Files (x86)\VMware\VMware Player"
    • navigate to OVFTool folder (cd OVFTool)
    • run ovftool to generate a VMX file: ovftool your-ovf-file.ovf  new-appliance-vmx
  6. if you made the order of tags in the OVF file correct, the process starts running (and it takes some time)
    • It might give you some errors... for instance:
      • Unsupported element 'ResourceType'
      • Missing child element 'InstanceId'
      • These errors are caused by a wrong order of tags.
        • in such case go to the line with the error and check the order of tags as described in step #4.
    • You may also get "OVF hardware element ResourceType with instance ID 5: No support for the virtual hardware device type 20"
      • that means you still have a SATA disk specified somehwre in the OVF file
      • go back to the OVF file and find all lines containing SATA, change that as described in step #3.
  7. Now it should generate a VMX file that you can open in VMWare.

Good luck everybody!




2 komentáře:

  1. Your post put me on the right track but Step 4 is not quite right. I found the following, which finally resolved this issue for me:

    "The DMTF RASD specifies a set of fields that can be set. We only a subset of those fields in an OVF descriptor. The fields in a RASD must be ordered alphabetically."[1]

    [1] http://blogs.vmware.com/vapp/2009/11/virtual-hardware-in-ovf-part-1.html

    OdpovědětVymazat