Converting VirtualBox to VMWare ESXi

Oracle(former Sun) VirtualBox provides virtualization solution without much hassle and requires almost no initial knowledge about virtualization technologies, but it isn’t designed for an enterprise usage. It just lacks the same flexibility and the features of VMWare. Sadly, migration from one application to the other isn’t straightforward. I stumbled upon two good resources on this subject. First guide is somewhat outdated, but it outlines the parts which need to be changed. Second link gave me an insight into the problem and I was able to solve everything else.

First, virtual machine needs to be exported into OVF format. You can easily do this with Export Appliance wizard(“File”->”Export Appliance” in the VirtualBox Manager). Be sure to select the “Write legacy OVF” checkbox. You don’t need a manifest file. Anyway, exportation will take a while. In the end, you will have two files: your_appliance.ovf and your_appliance.vmdk. You need to open OVF file in your text editor of choice and change OVF format:

ovf:format="http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized"

Now you need to change the Virtual System Type parameter to vmx-7.

<vssd:VirtualSystemType>vmx-7</vssd:VirtualSystemType>

Now you will need to rearrange the elements, because VirtualBox writes them in somewhat random order and VMWare is very strict on this subject. In all the cases, elements should be arranged in the following order:

  • Caption
  • Description
  • InstanceId
  • ResourceType
  • ResourceSubType (if applicable)

CPU and memory both have VirtualQuantity parameter. It should be the last. Memory has also AllocationUnits element; it goes before VirtualQuantity. Address goes before BusNumber for the ide/scsi/usb controllers. AutomaticAllocation, Connection go in this order for Ethernet adapter(s). HostResource goes before Parent for a disk. Parent first, AddressOnParent second for the disks and cdroms. I know, it looks complicated, but you can always do this by trial and error.

Next step is to change sound card’s ovf settings:

<Item ovf:required="false">
     <rasd:Caption>sound</rasd:Caption>
     <rasd:Description>Sound Card</rasd:Description>
     <rasd:InstanceId>9</rasd:InstanceId>
     <rasd:ResourceType>35</rasd:ResourceType>
     <rasd:ResourceSubType>ensoniq1371</rasd:ResourceSubType>
     <rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
     <rasd:AddressOnParent>3</rasd:AddressOnParent>
 </Item>

VMWare dislikes SATA controllers. Convert SATA to SCSI(Instance Id needs to be unique for all the elements):

<Item>
     <rasd:Caption>scsiController0</rasd:Caption>
     <rasd:Description>SCSI Controller</rasd:Description>
     <rasd:InstanceId>12</rasd:InstanceId>
     <rasd:ResourceType>6</rasd:ResourceType>
     <rasd:ResourceSubType>lsilogic</rasd:ResourceSubType>
     <rasd:Address>1</rasd:Address>
     <rasd:BusNumber>1</rasd:BusNumber>
 </Item>

Now change your disk’s parent element to ID of SCSI controller:

<Item>
     <rasd:Caption>disk1</rasd:Caption>
     <rasd:Description>Disk Image</rasd:Description>
     <rasd:InstanceId>11</rasd:InstanceId>
     <rasd:ResourceType>17</rasd:ResourceType>
     <rasd:HostResource>/disk/vmdisk1</rasd:HostResource>
     <rasd:Parent>12</rasd:Parent>
     <rasd:AddressOnParent>0</rasd:AddressOnParent>
 </Item>

Now you are ready for the final step. Download and install OVF Tool . Registration is required for this, but you should have it already anyway. Now simply run in the command line:

ovftool Your_appliance.ovf vi://username@host:443/

Where username is your vSphere login and host is the hostname. You will be asked for password and after that the final conversion will start shortly.

That’s it. You should be able to manage your new virtual machine via vSphere Client as usual. I hope that this step by step guide was useful.

P.S. I tested everything with VirtualBox version 4.1.8 and VMWare ESXi 5.0.0.

31 thoughts on “Converting VirtualBox to VMWare ESXi”

  1. Thanks a lot for this post, it was very useful !
    I try with Virtualbox 4.1.16 and ESXi 5.0 : I did not choose ovf 0.9 format (“Legacy”?) but only ovf rather than ova. I connect the disk on IDE instead of SATA and the only thing to change in ovf file was the virtual system type. Anything works well. Changing sata to scsi creates problems with linux disk uuid on boot (failure “can’t find disk”). Using IDE avoid this.

    1. This is on the path of what I may need to do.

      We need to convert two production Oracle Virtual Box VMs to VMware VMs. One Oracle Virtual Box VM is running RedHat Linux 5.5 the other Oracle Virtual Box VM is Windows 2003 Server.

      We are looking at using vSphere 5 Essentials as the software.
      I have read that VMware Standalone Converter may be able to convert the Vbox Vms.

      Are the above steps still required?

      Does anyone have an example of before (vbox) elements and after (vbox) elements?

      1. I have experience with VMWare Conventer only on physical machines and I wasn’t been able to find any mention of VBox in vCenter Converter’s documentation. You could try to run Converter inside virtual environment, just to check if you will be able to fool it, but I doubt it, because the list of all source types in the documentation(http://www.vmware.com/pdf/convsa_50_guide.pdf) looks kinda extensive.

  2. Can you upload a sample ovf file you have changed?
    Some of the descriptions you give differ from what I am seeing…
    My ovf file has other references to IDE… I need to see a converted one to be sure I have it right.

    Thanks.

    1. I would like to, but it was something I did at my previous job. Currently I have no access to those files. However I can see that this post is the most visited one and maybe I’ll download VBox tomorrow, just to recreate everything step by step for everybody who is interested.

      But maybe I can help you anyway. What did you mean by another references? Another InstanceId? Completely different parameters?

    2. I understand that I’m probably too late with this reply, but here are files you have asked for. Maybe they will be useful for someone else too.
      Original file
      Edited file

      I did everything as I wrote few months before, but this time I used the most recent VBox version. Compared to the version I have used before, it adds lots of additional crap, which can be safely deleted. Also I removed Ethernet Adapter’s entry as it can be re-added later in VMWare.

      I was able to import this VM setup to VMWare ESXi, so I can guarantee you that it works.

  3. Great post, and thank you very much for the information — it is really appreciated and got me pointed in the right direction.

    I’m not sure if it was something I did or if it is specific to Windows 2008 R2 (64-bit), but in addition to your instructions for my conversion from an original VirtualBox VM, I had to do two more things:

    1. I had to select “Windows 2008 R2 64-bit” as the operating system in the vSphere Client (This resolved a BSOD STOP error which seemed to be related to 32-bit vs 64-bit instruction execution — I don’t recall the code though now).
    2. My vSphere VM would still not boot (BSOD — w/ a new code — STOP 0x0000007b), so I tried converting the image again, but this time using VMware vCenter Converter in order to install any potential drivers (and also I went ahead and installed VMware tools). Once this conversion was complete, I was finally able to boot the VM!!

  4. Hi Tad;

    I’m following the step of your tuto and I got this error:

    Error: vmodl.fault.InvalidRequest
    Warning:
    – No manifest file found.
    Completed with errors

    Any Idea, the Virtual Box Machine that I need convert is a Debian and the destination is a VMWare ESXi 4.

    Thanks a lot in advanced.

      1. I’m converting a Debian 6 virtual machine. I export it from VirtualBox 4.2.10 to ESXi 5.1 using ovftool 3.1

        The example files that you posted before were very useful. The only line that i need to add is that you must delete the SCSI controller on the ovf file to export it properly to VMware. I’m not sure if this a Linux VM requirement or applies to every VM.

        But it works 🙂

        Don’t forget to add a new network device

        1. Tried everything in the example, but still shows me the “no manifest” error, I’m using esxi 3.5, any pointers?

          Thanks in advance.

          1. That’s just a warning. If it really bothers you, tick the box for a manifest when exporting the VM from VirtualBox.

  5. First off, a very well put together & concise guide. I stumbled across this and many others out there for this very same issue but they do not do it with such clarity (being a VMware beginner but knowledgeable with Vbox). Unfortunately, i also came across so many hurdles that it took me much longer than i thought to complete the task and even so, it wasn’t eventually via this method. In retrospect, i cannot understand why VMware and Oracle do not collaborate more on their free products.

    Perhaps more recent updates to both software from Oracle and VMware has changed the way this is done but i found that after using OVF Tool, it would crash at a point in the conversion yet still say the process completed successfully. No surprise, but i ended up with a corrupt VMDK.

    The source image file was fine so to my surprise i discovered that uploading only the exported appliance VMDK file to ESXi and attaching it as a new disk showed that it was recognised and went ahead and attached it to an IDE host adaptor. Configuring the rest of the system as it was meant it booted up correctly. Trouble is, it was using the IDE bus and not SCSI so performance was severely hindered.

    I then went about converting the VMDK to use the SCSI bus but this needed jumping into the image files themselves. I found this excellent site which detailed the changes needed to the relevant files within ESXi: –

    http://sanbarrow.com/vmdk-basics.html#calcgeo

    But, changing the disk descriptor and the VMX file was only half the job as the file system was still in the Virtualbox format. So, i used VMware Converter to connect to the ESXi server and import the virtual machine which also included the newly edited VMDK & VMX files. Ordinarily, the Converter will not recognise and import VirtualBox VMDK files so it had to be part of a VM for it to begin the process. After a few hours conversion, it read the entire contents of the source disk image and rewrote it as a flat file that ESXi would accept. VMware Converter would then create a new VM on the infrastructure server and attach the new disk to a SCSI host adaptor.

    Suffice to say that the improvements to the speed are very noticeable. So much so that doing a simple ATTO disk performance test between the before and after tests for both a Win2k8 & Win2k3 guest server running on a Dell R610 Raid6 10k SAS array gave the following results: –

    Win2k3 on IDE (before) – http://i41.tinypic.com/mm6dcl.png
    Win2k3 on SCSI (after) – http://i43.tinypic.com/mvp9jd.png

    Win2k8 on IDE (before) – http://i41.tinypic.com/kd1sno.png
    Win2k8 on SCSI (after) – http://i42.tinypic.com/2ypkw3c.png

    So now with the fun over, i best get back to the original P2V project i was looking to do!

    Thanks again.

  6. Awesome article! Saved me some much time in getting Citrix’s EVA6 vhd converted to run in ESXi. I wish VMware and Citrix would play nicer together – it would be good for both of them in the end. But it’s people like you who enable the rest of us to use the technology – not fight about vendors. Thanks. I’m sure I’ll be back here checking out more tips!

    Cheers,
    Alex

  7. Perfect! This worked nicely for me! I was almost ready to give up and re-install my VirtualBox OpenFire VM, when I stumbled across this post, and I was able to import it.
    Thanks!

  8. Thank you so much for the hints on converting the virtual machine!
    With these I was able to migrate my machine to esxi 5.1

  9. Excellent Post! Worked as described. I loaded Linux VMs wihtout having to change the SATA to IDE format as suggested in one of the comments. Simply straight conversation as recomended here.

    Very much appreciated.

  10. I converted one VM with success scrolling through the diff of .ovf (before and after edit in your comment above.

    I did have some XML mistakes due to accidental manual edit, but after inspection and trying to export with reduced items first just to see whether the XML passed (cancelled it once it seemed to work), I soon knew that it worked.

    VirtualBox version: 4.2.2
    OVF Tool: 3.5.0-1274719
    ESX VMvisor:5.5.0-1331820

  11. I decided to run it under virtualbox but then noticed that the .vmdk was available after being imported. So, I setup a new Redhat Linux 5 (64 bit) guest in vmware and used the disk from the virtualbox and it worked just fine. I did not have to do any manipulation of anything but just used existing disk on the new guest. Hope this helps someone.

Leave a Reply to Edgar Espinoza Cancel reply

Your email address will not be published. Required fields are marked *

Are you human? *