Migrate VMWare Linux Virtual Machine to Virtualbox – Convert VMware .VMX to .OVF (Open Virtual Format)

Monday, 2nd June 2014

migrate_vmware-virtual-machine-toto-virtualbox-vmx-to-ovf-migration

VMWare Virtual Machines are usually stored in OVA Format  which is bundle of OVF(Open Virtualization Format) and in multiple *.VMDK files.
Though other Virtual Machines are supposed to also support these "open virtualization format", different VM vendors implement and support it differently, therefore though in theory VirtualBox and QEMU are said to support OVA Format. Attempts to import such usually will fail. In this little article I will explain how VMWare stored (exported) VirtualMachine machine can be succesfully imported to VirtualBox.
 

1. Locate where is Virtualbox .vmx files from Window search or via dir command

I'm a console guy, so I prefer looking for VMWare's .vmx from command line:
 

C:UsersGGEORGI7> cd c: C:> dir /s *.vmx

 

Volume in drive C is PC COE
Volume Serial Number is XXXX-XXXX

Directory of C:Usersggeorgi7DocumentsVirtual MachinesDebian 7

06/02/14 11:06 AM 2,687 Debian 7.vmx
05/28/14 15:44 PM 370 Debian 7.vmxf
2 File(s) 3,057 bytes


2. Switch to wherever the VMWare virtualmachine .vmx file is located

 

C:> cd Usersggeorgi7DocumentsVirtual MachinesDebian 7
 

N.B. !Make sure the VMWare Virtualmachine is Shutdown (if it is Suspended converted file will not be properly implemented inside VirtualBox!). Whether the migrated virtualhost is suspended, launch VMWare, restore its state and Shut it down properly before starting migration with ovftool.
 

3. Remove Vmware-tools, Reset Display settings and Input D (before exporting to OVF) in VMWare

a) Remove vmware-tools

Vmware-tools kernel modules and stuff compiled specific for VMWare are no longer needed and might pose issues, thus it is always a good idea if previously installed in VMWare to wipe them out with cmd:

vmware-uninstall-tools.pl

uninstall-vmware-tools-linux-screenshot-migrating-vmware-to-virtualbox
b) Reset Display Device and Input Devices

Inside VMWare virtual machine Linux host, before shutting it down run:

mv /etc/X11/xorg.conf /etc/X11/xorg.conf.vmware

c) Remove Incomptable devices

To prevent issues with sound – its necessary to remove VMWare device created for soundcard, in order to let VirtualBox create its soundcard device on 1st boot after migration. To do so click on Virtual Machine and from context menu click Settings then in  Hardware tab select Sound Card and Remove:
 

Settings -> Hardware -> Sound Card (Click Remove)

vmware-migration-remove-soundcard-to-make-work-sound-work-in-virtualbox


4. Make a Clone (Backup) of Virtual Machine

Its always a good idea to create backup of VMWare VM to be migrated just in case something goes wrong during migration, so you have a way to step back to the already working one. Once files are copied it might be a good idea to use use some archiver like PeaZip or 7-Zip to save some disk space.
 

mkdir SomeFolder
copy Path_To_Virtual_Machine Folder_for_Backup_Virtual_Machine

 


In my case this was

 

 

mkdir TempVMWare-machine-backup
C:>copy "C:Usersggeorgi7DocumentsVirtual MachinesDebian 7" c:TempVM
ware-machine-backup

Restoring later VMWare VirtualMachines in case of some failure is done by simply copying backuped files to VMWare Working Directory folder

In case if Wondering

Where is stored VMWare Virtual Machines?

 

Check in:
 

VM -> Settings -> Options


vmware-working-directory-folder-where-are-stored-vmware-virtualmachines

5. Use VMWare ovftool.exe to convert .VMX to Open Virtualization Format (.OVF)

 

Though export from .VMX to .OVF it can be also done from VMWare GUI from:
 

File -> Export to OVF

Anyways I think it is better to do it via OVFTool console tool:

The most common location for  VMWare Workstation is:
 

C:Program Files (x86)VmwareVmware WorkstationOVFTool


For VMware Player it is:

C:Program Files (x86)VmwareVmware PlayerOVFTool

Very important thing to mention here is you have to be cautious, Never to run together VMWare and VirtualBox.
!! Before proceeding to next OVTool .vmx to .ovf migration Shutdown the VirtualMachine and as a best practice close VMware completely.

cd Location-directory-ofOVFTool
ovftool.exe Path-folder-to_VMVM_file.vmx Path-folder_to_VM_exportVM_file_export.ovf

C:> cd "Program Files (x86)VMwareVMware Workstation"OVFTool
C:Program Files (x86)VMwareVMware WorkstationOVFTool>ovftool.exe "Usersggeorgi7DocumentsVirtual MachinesDebian 7Debian 7.vmx" C:Usersggeorg i7vmware-debian-export.ovf

 

vmware-ovftool-convert-vmware-linux-virtual-machine-to-virtualbox


Convertion will take about 30 minutes on a normal computer hardware lets say (Dual Core PC 2Ghz with 4 Gb of RAM).
If you get a “failed to open disk” error during convertion, its likely that the virtual machine is still running or wasn’t shut down properly – boot the virtual machine and perform a shut down.

6. Launch VirtualBox, Install Guest Additions to enable Copy / Paste and USB support in Virtual Machine

After the process completes, you can boot the virtual machine. If you haven't earlier uninstalled vmware-tools  uninstall VMware Tools, and install VirtualBox’s Guest Additions (in order to allow Copy / Paste between VirtualBox and guess OS).
 

7. Launch VirtualBox and Import exported .OVF

Once Virtual Machine is exported, to import it into VirtualBox, launch VirtualBox and choose:
 

File -> Import Appliance


virtualbox-import-vmware-old-virtual-machine-to-new-linux import vmware appliance

virtualbox-import-vmware-previously-installed-virtual-machine-linux import appliance virtualbox
 

Share this on:

Download PDFDownload PDF

Tags: , , , , , , , , , , , , ,

3 Responses to “Migrate VMWare Linux Virtual Machine to Virtualbox – Convert VMware .VMX to .OVF (Open Virtual Format)”

  1. hip0 says:
    Firefox 29.0 Firefox 29.0 Windows 7 x64 Edition Windows 7 x64 Edition
    Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0

    After converting to VirtualBox and importing whether you get an error:

    Failed to open session for the virtual machine vm

    VT-x is disabled in the BIOS (VERR_VMX_MSR_VMXON_DISABLED)

    You will need to enter BIOS on boot time with DEL button / F2 / F10 etc.
     

    in BIOS inside the Virtualization tab enable the Virtualization technique

    restart your PC and you will have your Virtual Box up and running.

    Cheers 🙂

    View CommentView Comment
  2. admin says:
    Firefox 29.0 Firefox 29.0 Windows 7 x64 Edition Windows 7 x64 Edition
    Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0

    There is one more advantage of using Virtualbox, my USB HP Mouse does not hang occasionally as it used to hang while using VMWare. Thanks to Virtualbox 🙂

    View CommentView Comment
  3. Eric Scism says:
    Google Chrome 4.0.221.7 Google Chrome 4.0.221.7 Windows 7 Windows 7
    Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.2 (KHTML, like Gecko) Chrome/4.0.221.7 Safari/532.2

    Manual

    View CommentView Comment

Leave a Reply

CommentLuv badge