This article explains how to convert VMDK to VDI in Windows OS environment. VMDK is the default disk file format of VMware workstation and VDI belongs to Oracle VirtualBox. Converting the VMDK to VDI will allow using virtual machines in from VMware to VirtualBox. But, we will keep things simple here. Also, we show the vice versa step in converting the VDI file to VMDK and attach VMware. This will help in moving/migrating any virtual machine which is running on VirtualBox to VMware.
There are some articles on the internet about doing the same steps in Linux or Solaris environment. This method explains how to convert VMDK to VDI file format on Windows 10, 8.1 OS by using built-in VirtualBox command, hence you should have Oracle VirtualBox on the computer.
2 Ways to Convert VMDK to VDI
1) Technically it’s not required to convert VMDK to VDI to open VMware virtual machines in VirtualBox, because VirtualBox supports VMDK disk image files natively.
VMDK file can be added to VirtualBox media manager very easily. Read the earlier guide about attaching and opening VMDK file in VirtualBox.
After successfully added the VMDK file to VirtualBox media manager. You can boot the virtual machine OS from VMDK file by following steps;
- Create a new virtual machine in VirtualBox with the correct Operating System which is on the disk file.
- Instead of creating a new hard disk, select the existing VMDK disk file. That’s it, boot the OS. Do not worry about the VMX file which is having VMware virtual machine configuration only.
This is the first step to use the VMDK file in VirtualBox without converting to VDI file format. Let’s go to the second step.
2) This step to convert .vmdk file to .vdi and get the real output.
As mentioned earlier, this step can be done on a computer where VirtualBox installed, because we will be using the VirtualBox command. Also, it is advisable to copy the VMDK file if you really need the original VMDK file intact. Though the conversion command should not affect the original file, this is for backup purpose if the VM on the VMDK file is so important.
We will be using Vboxmanage clonehd command which is located under C:\Program Files\Oracle\VirtualBox\.
“C:\Program files\Oracle\Virtualbox\vboxmanage” clonehd <VMDK file location> <VDI file location> –format VDI
“C:\Program files\Oracle\Virtualbox\vboxmanage” clonehd windows10.vmdk windows10vb.vdi –format VDI
It will provide the output VDI file to the destination you mentioned.
Now the converted VDI file is ready to use in Oracle VirtualBox or VDI virtual disk image supported platforms.
VDI to VMDK in Windows Environment
We can use the same VBoxManage command to convert a VDI file to VMDK. Make sure that the virtual machine doesn’t have any snapshots or child VDI files. If you have the snapshots of the virtual machine, usually the latest virtual machine will run from the child VDI file, not from the original VDI. So, converting the base VDI file will not give the current state of the virtual machine in the VMDK file.
“C:\Program files\Oracle\Virtualbox\vboxmanage” clonehd <VDI file location> <VMDK file location> –format VMDK
“C:\Program files\Oracle\Virtualbox\vboxmanage” clonehd windows2019.vdi windows2019.vmdk –format VMDK
I managed to migrate a old Windows XP machine from VirtualBox to VMware by converting the virtual hard disk by above commands.
Same VM on VMware Player.