Convert VMDK to VDI and VDI to VMDK in Windows 10 (or any Windows OS)

In the world of virtualization, VMDK and VDI are two important disk file formats. VMDK is used by VMware Workstation, while VDI is used by Oracle VirtualBox. In this article, we will show how to convert a VMDK file to VDI, and vice versa. This process will come in handy if you want to move a virtual machine from VMware Workstation to VirtualBox (or vice versa). Let’s get started!

I have done the demonstration of converting a working virtual machine from VirtualBox to VMware by changing the file formats.

There are some articles on the internet showing similar steps in Linux or Solaris environments. But in this article, we will focus on how to convert VMDK to VDI file format on Windows 10, 11/8.1 OS by using built-in VirtualBox command. Therefore you should have Oracle VirtualBox on the computer.

P2v In Virtualbox By Disk2vhd

What is VMDK file Format?

The VMDK file format is a disk image format used by VMware Workstation. It is the default disk image format for VMware, and it allows you to create, edit, and delete virtual disks. VMDK files are usually large in size, and they can be used with both VMware Workstation and VMware Player.

What is VDI file Format?

The VDI file format is a disk image format used by Oracle VirtualBox. It is the default disk image format for Oracle VirtualBox, and it allows you to create, edit, and delete virtual disks. VDI files are usually smaller in size than VMDK files.

What is the difference between VDI and VMDK?

The VMDK file format belongs to VMware, while VDI is used by Oracle VirtualBox. VMDK files are usually larger in size, and they can be used with both VMware Workstation and VMware Player. VDI files are usually smaller in size than VMDK files. Both file formats contain the virtual hard disk content for virtual machines in respective software.

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 files can be added to the VirtualBox media manager very easily. Read the earlier guide about attaching and opening the VMDK files in VirtualBox.

After successfully added the VMDK file to the VirtualBox media manager, you can boot the virtual machine OS from the 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 and process the normal steps. Do not worry about the VMX file which is having VMware virtual machine configuration only.

This is the quick solution to use the VMDK file in VirtualBox without converting it to a VDI file format. Let’s go to the second step if you really need to change the disk format from VMDK to VDI.

2)  This step is to convert the .vmdk file to .vdi and get the real output.

As mentioned earlier, this step can be done on a computer that has VirtualBox installed to use a few VirtualBox commands. Also, it is advisable to copy the VMDK file if you really need the original VMDK file intact. Though the conversion command will not affect the original file, it is a good practice to backup 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\.

Sample command:

“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 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

Example:

“C:\Program files\Oracle\Virtualbox\vboxmanage” clonehd windows2019.vdi windows2019.vmdk –format VMDK

I managed to migrate an old Windows XP machine from VirtualBox to VMware by converting the virtual hard disk by the above commands.

VDI to VMDK

Same VM on VMware Player.

Converted VM on desktop virtualization

We hope that this article helped you understand the VMDK and VDI file formats and how to convert them. Please don’t hesitate to leave a comment if you have any queries.

If any of the above solutions did not fix the Windows PC issues, we recommend downloading the below PC repair tool to identify and solve any PC Issues.

Dinesh is the founder of Sysprobs and written more than 400 articles. Enthusiast in Microsoft and cloud technologies with more than 15 years of IT experience.

37 thoughts on “Convert VMDK to VDI and VDI to VMDK in Windows 10 (or any Windows OS)”

  1. Excellent tut, this was exactly what I was looking for.

    Just a small additional note regarding the path settings.
    The method above adds the path to both programs permanently – if you just need this once, you can as well add the paths in your command window, valid for this one cmd session only:
    just use the good old set command
    set path=%path%;full_path_to_qemu-img;full_path_to_vboxmanage
    e.g. set path=%path%;c:\program files\qemumanager\qemu;c:\program files\sun\virtualbox
    When in doubt whether this worked or not, just display the updated path settings with path

  2. Hi Dinesh,

    Good tutorial. I have one problem though.When I start the VM in VirtualBox, I get the error;

    Error Loading Operating System

    Any ideas?

    Thanks

  3. Hi thanks for the tutorial.

    I was wondering, why would i convert from .vmdk to .vdi when VirtualBox can run .vmdk directly? Is it faster, better, saver, more stable? Thanks again.

    • I had problems with VMDK (this was an image made of a Vista laptop that died on me). After Windows updates or using Control Panel’s add/remove programs I’d get registry errors* during restart and the VM wouldn’t boot. After converting the image to VDI, no such problems so far.

      * (c0000218 {Registry File Failure} The registry cannot load the hive (file): \SystemRoot\System32\Config\SOFTWARE or its log or alternate. It is corrupt, absent, or not writable)

  4. Tyvm for the tutorial!

    I use W7 Home Premium and it was a bit of a challenge to get it the commands to work from the command prompt, but after half an hour of moving stuff around using only the keyboard (my mouse batteries died right after I downloaded Qemu): success!! \o/

    Initially, I tried adding the “qemu-img” and “vboxmanage” commands to the path file, as detailed above, but I still had to run them from their respective folders via the command prompt to get them to work. Perhaps I need to restart my computer for it to take effect? *shrug*

    In any case, thanks again for the tutorial! It saved me a few hours of having to recreate a virtual machine from scratch!

  5. After reading the previously posted comments, I feel the need to type more…

    @ Leon –

    As an example:

    I needed to make a few copies of a particular virtual machine (made using VMware Workstation, but running in VirtualBox) for school-related reasons. Let’s call it “vm1”.

    I have a program that provides a GUI (and CLI) for copying virtual machines. (Check it out!)

    However, the aforementioned program could not copy vm1 (due to some sort of compression or something). With the above tutorial though, I was able to quickly (relative to installing 2-3 more operating systems in Vbox) convert the file and beginning the copying process without error.

  6. Thank you for your guide, but in my PC doesn’t work.

    In VirtualBox environment, I run the converted VDI hard disk and nothing happens…….like you run the VDMK hard disk before the conversion.
    Could you help me?

    ps: eventually, sorry for my english

  7. @Dinesh
    Thanks for your reply, but…….it doesn’t work.
    I tried the follow solutions:
    1) VDMK to IDE
    2) VDMK to SATA
    3) converted VDI to IDE
    4) converted VDI to SATA

    I really would like to know, why do they say that VirtualBox is fully compatible with VDMK if it isn’t true?

    I think…..and I hope…..I don’t do anything wrong because the GUI is very simple and clear

    Thank you again!

    • @Domenico,
      VMDK is compatible with VirtualBox, but I’m not sure whether i can add ‘ Fully’ in this sentence.

      Just tell me something clearly, when booting from VMDK what’s happening? are you getting blue screen error in Windows guest OS? Did you manage to add VMDK to Virtual media manager successfully? I meant, is it detecting the correct disk size?

      I’m hoping you are not trying this with any snapshot VMDK files, which will not work.

      If you are doing all correct but still problem in booting, then you have boot from Windows OS CD and repair the disk. ( Overwrite boot sector, MBR..etc)

  8. @Dinesh

    I haven’t got a “blue screen”.
    Yes, it’s detected with his correct size.
    I didn’t use a snapshot, but I use a VM created with the tool “VMware converter” that, naturally, works fine with the “VMware player”(I think that this information it’s not very important).

    Simply…..I start the virtual Machine and I never see anything, only a black screen with a cursor at the upper-left of the screen.

    Another thing……after I close the VM with the click on the X of the window, the second time I start the VM i can see the list that tell me to choice if I want to start windows normally, safe mode, without network, etc…
    But whatever I choice the result is the same.

    I will follow your advice and I will try to fix the problem with the WinXP CD.

    I let you know!

    Many thanks!

    • to fix thw problem of no os found you have to go to setting in the virtualbox ox the win xp remove scsi controller and add the xp pro to the ide . i had the same problem when i used the packaging tool in the vmware to convert vmware disk to ovf file

  9. GREAT work, thanks a LOT !!!

    It works for me, I am experimenting with Vista with the expectation of running my current laptop (virtualised) in a much larger machine when I upgrade (4 times the disk, 4 times the bogomips, etc.).

    My trials have been with a 200 Gig image of the C and D drives, so obviously I haven’t had room to create .vmdk > bin > .vdi files on the same hard drive – and I suspect that an insane loop might appear at some point if I tried to (.image(.image(.image))) etc.
    So I am going out to an external USB 2 terabyte drive for this.
    A few rough numbers;
    Creating the .vmdk file takes about 3 hours.
    Converting the .vmdk to .bin takes about 4 hours.
    Converting .bin to .vdi takes 4 1/2 to 5 hours (unclear, I went to bed).

    Booting Vista in a virtual machine within Vista is painfully slow from USB 2
    Once booted and migrated into physical memory performance is acceptable for most of what I do.

    A couple of minor problems;
    The wall clock lost about 3 hours last night.
    My audio device Conexant couldn’t get set up by the guest additions software.
    On settings > control panel > system there was an indication that Windows Vista was not activated and at some point a comment that said it would be automatically activated in 3 days.
    I am guessing that there is a licensing issue here with the physical hardware not being “seen” by the license management enforcer – or whatever that nonsense is called.

    I should add that working from the converted .vdi file seems to be more stable than the “direct” .vmdk file. This may be coincidental, since I have only done this conversion once and it was from a different .vmdk. Since I still have the .vmdk .bin and .vdi files around I should do some more trials to see if there is performance and stability differences between .vmdk and .vdi

    That is about it for me, thanks again for a GREAT piece of work.

  10. Domenico,
    I only just got into this group, so I’m a bit late in replying to your posts.

    It looks very much like some symptoms I had on my first runs.
    The default in VirtualBox when creating a new virtual machine is ONE processor, but many/most of our newer machines have 2 or more.
    Loading a .vmdk file that was created from a running 2 processor Vista into a VirtualBox virtual machine with ONE processor did cause blue and sometimes black screens for me on a (physical) AMD Turion X2.

    The other thing I have had minor issues with is adding hard disks in virtualbox, it seems I can only add them in the sequence that virtualbox decides, so if I want ONLY the most recently added one I have to add them all until I get that one and then remove all the others.
    That is the other thing that has blown up here, having .vmdk and .vdi files of the same image attached to the same virtual machine when I try to boot it – a VERY BAD IDEA (-:

  11. @ Reg,

    Thank you for your suggestion, but I did it with VmWare player because i spent too much time to try to find a solution.

    However, I can tell you that I converted a one core Celeron PC(4 years old), so…..I think this isn’t the problem.

    Thanks again!

    Domenico

  12. One commenter asked if there is benefit to converting to VDI from VMDK.

    Any comments on if it is, and why?

    Thanx for the tutorial and additional expertise.

    Zeddock

  13. I’m having the same issues as Dinesh notes above. Had installed VMware player just a few days ago and found all the new services it installed bogging down my high end Win 7 (64bit) box. Just found VirtualBox and the install went fine. Selected my working XP .vmdk image and just get the black window error “Error loading operating system”. Added disk controller SATA (default was wrong). Still no joy. Stopped all the active VMware services, no help. The web site link will show my PC configuration (HDW and OS).

    Would like to try this before going the file conversion if I can.
    Help!

    • I just booted my host and now I’m getting the same error on my VMware Player. Can’t load the XP OS. So I guess the image just got corrupted. Great, it only took 3 hours to setup the XP box the way I wanted it.

      • OK, so I figure I would just byte the bullet and create a new native HD for Vbox. It all seems to happen OK until I try to load the XP OS. I can’t get Vbox to boot from the CD. I have the boot sequence right. Any suggestions?

  14. Are you confident in your CD? Perhaps it is not good?

    I created an ISO image of mine (known good) and mapped that image as a drive for the new machine. That worked for me.

    Good luck.
    zeddock

    • OK, so I reinstalled VirtualBOX and created a native HD file. Now I have XP running in it OK. BUT, I’ve not found a good way to transfer files from the host (Win 7) to the virtual client (XP). I tried to create a share on a directory but with no luck. I also tried to use a USB stick but Vbox doesn’t see it. These are odd as my keyboard and mouse are both USB and work but my printer and other USB devices are not. Also I was able to create shares into my big IBM system (AS/400) OK. VMware Player just let me drag and drop from my Win 7 desktop to my virtual desktop. I thought Vbox supported cut and paste, haven’t had that work either. I don’t want to have to do something like install an FTP server on Vbpx to get files over to it.

      • I got it. Had to install guest additions. Now I have a shared folder on my host that the client can see.

        • OK the shared folder is working.

          The clipboard is still not working. I have it set to both ways. When I ‘copy’ on one side I don’t get ‘paste’ on the other.

          BUT I can’t get a USB thumb drive on the host to be seen on the vbox. I have the filter set and the USB when in the virt machine I pulldown and select the USB device to have it checked I get this error: Failed to attach USB device Unknown device to the virtual machine VirtXP. XP should know this this USB stick without a custom driver. I’ve tried a couple of different thumb drivers.

          Result Code:
          E_INVALIDARG (0x80070057)
          Component:
          HostUSBDevice
          Interface:
          IHostUSBDevice {173b4b44-d268-4334-a00d-b6521c9a740a}
          Callee:
          IConsole {515e8e8d-f932-4d8e-9f32-79a52aead882}

  15. I also had difficulty in getting Qemu to work. I’m running Bodhi, so also tried to use remastersys, in order to export my ‘live’ running system to *.iso. I’m not convinced it will work properly as an iso, & I’m also concerned the resultant iso wont boot from DVD media.

    I may just forget about it, because I can’t get the shared folders to work, either. If I create a new iso from my image, at least I can try a proper boot into actual hardware, rather than virtualising the OS. I had spent ages cutomising Bodhi as well.

    Thanks for the information. Great tutorial.

  16. Well, I had to backup my productive system Win7 prof 32bit GERMAN, as there was a need to reinstall that machine.
    I found the ‘VMware vCenter Converter Standalone Client’ which allowed me to create a .vmdk image of the currently running machine (you have to assign an NTFS-formatted drive as the source, as otherwise the target image will be splitted into pices < 2GB related to the restrictions of FAT32)
    The image consists of the hidden Win7-volume, and the system-drive C:\.
    After that, I converted the vmdk-image to .vdi with the vboxmanage.exe, which is part of VIRTUALBOX 4.1.4r74291. I created a file called convert.cmd with that content:

    "drive:\path\vboxmanage.exe" clonehd -format vdi "drive:\path\source.vmdk" "drive:\path\destination.vdi"

    I HAD to include the quotation marks EXACTLY as shown, otherwise the command wouldn't work.

    After creating an new virtual machine, everything worked from scratch.

    On the first run, I had to confirm some driver- and temp-file-location related messages. The second run showed me an nice and smooth running system.

  17. Hi,

    I have used the “vmware center converter standalone client” to create a vmdk from my physical window xp machine. Then I did skip the step with qemu to do directly: “VBoxManage clonehd source.vmdk dest.vdi –format vdi”. It worked no problem, then I created a virtual machine with virtual box using the vdi disk just created (NB it is important to specify “IO APIC” in the motherboard configuration.

    It works very well but I have one problem I can’t pinpoint. I cannot use more than one cpu for the machine. I have an intel core i5 laptop and it has 4 core. If I set more than one cpu, the VM doesn’t start at all and give this error message:


    Unknown error creating VM (VERR_VMX_MSR_LOCKED_OR_DISABLED).

    Code d’erreur :
    NS_ERROR_FAILURE (0x80004005)
    Composant :
    Console
    Interface :
    IConsole {515e8e8d-f932-4d8e-9f32-79a52aead882}

    If I run only one CPU it run ok. And yes I have enabled IO-APIC.

    My laptop is actually dual boot with the physical XP machine and a Linux Mint Debian Edition. I made a physical to virtual with the vmware converter. Is it possible there is a restriction from the vmware utility that allow only one CPU ? I have check hardware driver on the XP virtual machine and it says it is an “Intel COre i5 cpu M520 @2.40GHz.
    The driver is intelppm.sys. Is it possible that vmware installed a modify version of intelppm.sys that would allow only one CPU to work ? I will try to reinstall the driver from my windows CD.

    Anybody had this problem ? Any clues on how to solve this ?

    I would really like to use at least 2 CPU for my vm… With only one it is rather slow.

    Regards,

    Bernard Tremblay
    Quebec city, Qc, Canada

  18. Hi!
    Thanx for the good artcile.

    But if you, like me, get this error while converting from vmdk to raw;
    “qemu-img: error while reading”
    you need to convert it to with the VMWare disk manager first:
    vmware-vdiskmanager -r disk1.vmdk -t 0 disk2.vmdk

    Then use the qemu-img and it should finish without that error.

    BR,
    Markus

Comments are closed.