Whilst Virtualbox can access virtual disks in .vdi, .vhd and .vmdk format, VMware player or workstation supports only .vhd- and .vmdk file format. From time to time people asking me, how to convert a Virtualbox .vdi file to a .vhd or VMware .vmdk.
There are a couple of web sites describing how to use Virtualbox VBoxManage.exe to convert a .vdi file to a .vhd disk. It requires invoking a command prompt window, navigate to Virtualbox install folder and enter a command like this:
vboxmanage clonehd d:\android\android4.vdi
d:\android\android4.vhd --format VHD
The two lines above are one command. The resulting file android.vhd can be used in VMware Player/Workstation.
Note: This approach comes with two problems. First of all, it’s complicated to fiddle with command prompt window and spelling the right paths. And second I prefer to use Virtualbox portable beside my VMware Workstation installation. If Virtualbox portable is used, VBoxManage.exe won’t work – some Class isn’t recognized. Therefore I was looking for an alternative way, and I found the approach drawn below.
A smarter way to convert .vdi files
In this Q&A somebody mentioned, that Virtualbox comes with a tool that works well under Windows. And someone else mentioned a graphical tool will do the conversion. After a bit of experimenting, I found out, how to convert Virtualbox .vdi files in a comfortable manner. It requires Virtualbox or VMLite workstation.
- Launch Oracle VM Virtualbox Manager (or VMLite workstation – also Virtualbox portable fits).
- Press Ctrl+D or open the Machine menu and select Manager for virtual media (see above in background).
- In virtual media manager select the .vdi file to be converted. After selecting a file, press Ctrl+C or click the Copy button.
- In the conversion wizard’s dialog box confirm the media to copy and click Next.
- Select the target disk output format and click Next.
- If you selected .vmdk for a virtual machine file, the next dialog box allows you to set the parameter for the target file.
- After confirming the disk type using the Next button, select the target folder and adjust the target file name.
- Click the Next button and confirm the Copy button in the next dialog box.
Virtualbox copy wizard creates a new target disk and convert the source content to the required target disk format.
Afterward, the target folder contains the converted virtual disk, that may be associated to a VMware Workstation or Virtual PC VM (depending on output format).
Attention: Converting .vdi disks containing VMs with Linux or Android should be no major problem. Only Android may causes trouble, because the Linux kernel just supports IDE disk controller. A Windows guest OS in a converted VM raises serious trouble, because booting in the new environment forces Windows to install other drivers for the hardware environment found in the VM. Windows XP fails with blue screens, if the disk controller changes. Whilst Virtualbox uses SATA- or IDE-controller, VMware connects always a virtual disk via SCSI controller.
Change the disk controller type in VMware
In some cases it’s sufficient to change the type of disk controller for VMware player or workstation. This change must be done manually, editing VMware .vmx configuration file with a text editor. In most cases something like this will be present in the .vmx config file:
scsi0.present = “TRUE”
scsi0.virtualDev = “lsilogic”
scsi0:0.fileName = “I:\VMs\Android3.2\Android-v4.vhd”
The command lines shown above must be changed to something like the commands below:
ide0:0.present = “TRUE”
ide0:0.fileName = “I:\VMs\Android3.2\Android-v4.vhd”
After modifying the configuration settings, the VM can bee bootet, to see, if it went well.
Note: For Windows I prefer tools like VMLite`s MyOldPC or Paragon Go Virtual. These tools not only converting the disk formats. Both tools supporting driver injection in Windows guests, so booting the converted VM should be not a painful job – only Windows activation can be a “pain in the as” – if Microsoft decides to block the license key.