Convert Virtualbox 4.0.8 appliance to VMware esxi

This is for discussing general topics about how to use VirtualBox.
Post Reply
vboxmoo
Posts: 3
Joined: 14. Jun 2011, 05:35
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: linux and win

Convert Virtualbox 4.0.8 appliance to VMware esxi

Post by vboxmoo »

Hey Guys,

Virtualbox is just awesome, thanks for creating it, I often prototype systems (including entire labs) in virtualbox and then migrate it over to production running VMware ESXI, but I have had real trouble importing appliances exported from VirtualBox.

As a work around for getting the Vbox virtual machine into ESX I have used VMware Converter and told it to "Convert a physical machine", which has worked well, but this is time consuming and not ideal.

I have experimented with various methods using ovftool, legacy 0.9, editing the .ovf file and a few other creative ideas, but no success :-(

Is anybody on the forums importing appliances created from VirtualBox into ESXi successfully ?

Using ovftool would be excellent for deploying multiple appliances to ESXi in a scripted fashion.

Can somebody whack me with a cluebat ?
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Convert Virtualbox 4.0.8 appliance to VMware esxi

Post by Sasquatch »

Your profile states that you use Linux and Windows as Guest OSes. For Linux, it's pretty easy: use VBoxManage clonehd <VDI file> <output file> --format VMDK --variant ESX and tell ESX to use the existing VMDK as hard drive. Linux is very tolerant for hardware changes, so this gives you the least amount of problems.
For Windows, it's a bit harder. You have to prepare it for a hardware move. I haven't done that much, so I can't really tell you how to do that. You might want to check the sysprep utility.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
vboxmoo
Posts: 3
Joined: 14. Jun 2011, 05:35
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: linux and win

Re: Convert Virtualbox 4.0.8 appliance to VMware esxi

Post by vboxmoo »

Hey thanks for your post Sasquatch, I use linux more than anything, particularly when taking projects to ESX, windows mainly runs as a guest OS in VBox due to the office environment i'm in, and for running vsphere client.

Will try the VBoxManage clonehd method and report back.

ovftool deployment would be the most ideal solution though, especially using things like turnkey linux appliances etc.

Cheers.
vboxmoo
Posts: 3
Joined: 14. Jun 2011, 05:35
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: linux and win

Re: Convert Virtualbox 4.0.8 appliance to VMware esxi

Post by vboxmoo »

Just thought i'd follow up and say that the conversion has been a success, thanks for the tip ;-)
crash0veride
Posts: 43
Joined: 23. Apr 2009, 22:29
Primary OS: Linux other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: WinXP, Win 7, Windows Server 2008 R2, SL 6, OEL 6, FC 15
Location: ThE MaTriX

Re: Convert Virtualbox 4.0.8 appliance to VMware esxi

Post by crash0veride »

You can easily import a VBox exported OVF into an ESXi server via the VI client or via VMware OVFtool.
When exporting the VM keep it's devices neutral. That is to say don't use the VBox SATA controller, or virtio net devices for example. Instead use things like the SAS controller or Intel NIC cards which are both inherently native to VMware as VM devices. The SAS controller in VMWare is the preferred device performance wise only next to the pvscsi controller anyways. Linux is easy to switch these devices out, side for boot for which you may have to rebuild your boot image (initrd, See: mkinitrd or dracut) to include the necessary driver at boot time. For windows boot devices simply install the LSI SAS driver for example and reboot at least once with the new disk controller to make sure windows is made aware of the new controller and respective device driver.
Also be sure to elminate, shared folders, USB mapped devices and sound controllers (anything VBox specific that VMware will not like at the time it parses the OVF XML)
Additionally uninstall the VBox paravirtual drivers (VBoxGuestAdditions).

Now you can simply export the VM using the VBox OVF export.
Choose to export the VM and when you get to "Appliance Export Settings" choose a location and choose to export .ovf instead of OVA. Make sure to feed the dialog "/path/to/nameofvm.ovf" for example.
After the VM has exported simply edit the .ovf XML and find the tag <vssd:VirtualSystemType>virtualbox-2.2</vssd:VirtualSystemType>
and change it to
<vssd:VirtualSystemType>vmx-07</vssd:VirtualSystemType> (Assuming you are using vSphere 4.x)

Save the changes to the file.

Now simply use the VI client to login into your vCenter or ESXi server and import the OVF you just created. Remember such things as to tell VMWare to import the disk as thin for example if the original VBox VDI was dynamic.
Same thing applies to using the vmware OVF tool to import the VM to an esxi server or vCenter wherever you are choosing to send it to.
blair
Posts: 4
Joined: 24. Sep 2011, 02:01
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu, CentOS

Re: Convert Virtualbox 4.0.8 appliance to VMware esxi

Post by blair »

crash0veride wrote:You can easily import a VBox exported OVF into an ESXi server via the VI client or via VMware OVFtool.
When exporting the VM keep it's devices neutral.
<SNIP>
Now you can simply export the VM using the VBox OVF export.
Choose to export the VM and when you get to "Appliance Export Settings" choose a location and choose to export .ovf instead of OVA. Make sure to feed the dialog "/path/to/nameofvm.ovf" for example.
After the VM has exported simply edit the .ovf XML and find the tag <vssd:VirtualSystemType>virtualbox-2.2</vssd:VirtualSystemType>
and change it to
<vssd:VirtualSystemType>vmx-07</vssd:VirtualSystemType> (Assuming you are using vSphere 4.x)
I've been attempting this with a Windows Server 2008 VM, and found it isn't quite so simple. VMware ovftool seems to be picky about the order of Item sub-elements. I had to edit my VirtualBox (4.1.6) generated legacy OVF according to this suggestion on the VMware communities page: http://communities.vmware.com/message/1892628#1892628 .

This worked, though hand editing xml to get this working seems pretty ridiculous given how mature both of these products are... Presumably the OVF spec covers this and either the VirtualBox or VMware tools are not compliant.
Post Reply