Thursday, January 05, 2012

VMware Player to Oracle VirtualBox

Getting into the world of virtualization is pretty easy now a days with Oracle VM VirtualBox or VMware Player. From a licensing point of view, both are free for home use.

Key features as they pertain to me:

VMware Player:
  • One can eventually move to workstation or to other VMware products with more capabilities
  • Can use another free product called “VMware vCenter Converter Standalone Client” to convert a physical (most presumably your own) to a virtual one. This saves a lot of time from having to create one from scratch with all the windows updates and hundreds of applications/tools/customizations that one normally does on their main machine. It also serves as a convenient backup.
  • Does not allow clones or snapshots
  • Ability to import pre-configured appliances
Oracle VM Virtualbox:

  • Allows full clones, linked clones and snapshots
  • No converter to make a VM out of your physcial machine
  • Ability to import pre-configured appliances
I wanted to utilize VirtualBox’s snapshots and clone features but at the same time play with VM Player and especially utilize the vCenter Converter to create my base image. After researching online, I found out it is possible to move a VM from VMware to VirtualBox. Against better advice and headaches, I decided to pursue this. If it worked, I would have saved time in installing all the windows 7 add-ons. If not, at least I would have had some hands on experience playing with these tools. All answers were gleamed from reading up various forums and blogs. I compiled them in one article for my own reference as well as for others who might find it useful.

Step 1. Creating a base image and a copy
  • Fired up VMware vCenter Converter and followed the steps in converting my physical machine into a VM. This is pretty straighforward and there are resources available online. This is a time consuming process based on the size of your main drive.
  • Since I didn’t know how my base image would be affected from here on, I decided to make a copy. Early research showed my complicated steps in achieving this without having the VMware Workstation tool.
  • I just copied the entire folder containing my VM and renamed it. I fired up VM Player and opened the copied VM. I was prompted to answer if the image was “moved” or “copied”. I chose “copied” and it went about it’s merry way loading up windows. In later on readings I found other people recommending the same. Possibly earlier solutions were based on older versions of VM Player. Choosing “Copied” option will automatically create new MAC addresses for network so that the old and new VM can run simultaneously if needed.
Step 2. Intermediary step. Converting to Open Virtualization Format (OVF)

cd C:\Program Files\VMware\VMware OVF Tool\
ovftool "D:\Virtual Machines\Machine1\Machine1.vmx" "D:\Virtual Machines\Machine2\Machine2.ovf"
This process took about 45 minutes or so

Step 3. Finally import into Oracle VirtualBox
  • Following the blog article listed above, I started the import into VirtualBox. Unfortunately it failed. Error pertained to “Config” elements on line 106 (This will differ based on machine).
  • I edited the ovf file in a text editor and removed these 3 entries. I figured they were optional and explicitly referenced VMware related settings.

< vmw:Config ovf:required="false" vmw:key="videoRamSizeInKB" vmw:value="131072" / >
< vmw:Config ovf:required="false" vmw:key="enable3DSupport" vmw:value="true"/ >
< vmw:Config ovf:required="false" vmw:key="numDisplays" vmw:value="1"/ >

  • The above change worked and I had a successful VirtualBox VM.
  • For another image, I had other problems related to the Disk. It seems like VirtualBox didn’t like the SCSI controller. It was mistake in hindsight for me to create the image on VMware Player using a SCSI disk type. VMware Player actually offers both IDE and SCSI but recommends SCSI for performance. This naturally set me off in finding how to go about from here onwards as opposed to starting all over again. My best bet was to change the virtual hard disk to IDE.
  • Tried to do as suggested as by http://communities.vmware.com/thread/146659 . I already had a copy of ultimate boot cd and again it was something new, so I was game for it. I unfortunately couldn’t see both the drives in the Linux based tools. I traced it down to the BIOS in the VM and it was not picking up the SCSI. So I had to try something else.
  • Using a combination of http://permalink.gmane.org/gmane.comp.emulators.virtualbox.user/618 and http://blog.tpv.dk/?p=53, I was finally able to convert a SCSI to IDE virtual disk. This had to done in VMware Player. In my case I was able to really do only a few steps. I removed the SCSI drive edited the “VMDK” file to change the ddb.adapterType = “ide”. Restarted the VM, reconfigured the BIOS to pick the right disk and voila, the virtual disk was fine and let get into windows (showing IDE as opposed to SCSI).
  • Completed Steps 2 and 3 again to successfully import this VM as well.

2 comments:

  1. Hi Dharmesh. I wanted to follow your steps because I am haing the same SCSI Contriller Disk error when attempting to convert my VMWare Player to VBox.
    The link you have is broken, however.. perhaps the link is down. Can you post what info I need from the link? (http://blog.tpv.dk/?p=53)

    Many thanks.

    ReplyDelete
  2. Thanks in advance Dharmesh...

    ReplyDelete