Post

Convert VM disk format

vm-banner

Convert VHDX To VMDK

Virtual Box to convert

Download

Open Command Prompt as admin and run this command:

1
cd C:\Program Files\Oracle\VirtualBox

Next run the following command with the correct paths to the vhdx file and where you want to store the copy

1
.\VBoxManage.exe clonehd --format vmdk C:\temp\My-VM.vhdx С:\temp\My-VM.vmdk

QEMU-IMG

  • Windows Download

  • Linux

    1
    
    sudo apt-get install qemu-utils
    

Open a Command Prompt as Admin to the location of the program and you can run this command to view the disk info:

1
qemu-img.exe info c:\temp\My-VM.vhd

Here is an example of how to convert a vhdx file:

1
qemu-img.exe convert -p c:\temp\My-VM.vhdx -O vmdk c:\temp\My-VM.vmdk

Converting VMDK to the ESXi format

Upload the converted VMDK file to the datastore of ESXi upload

Enable SSH access on your ESXi host (Manage > Services > TSM-SSH) ssh-enabled

Go to the directory where the VMDK was uploaded cd /vmfs/volumes/SSD2/converted

Use vmkfstools to convert VMDK to ESXi format.

1
vmkfstools -i My-VM.vmdk My-VMthin.vmdk -d thin

As you can see on the directory, the conversion with vmkfstools has completed successfully and two new files have been created:

My-VMthin-flat.vmdk

My-VMthin.vmdk

Importing a VMDK disk to a VM on ESXi

  1. Select Virtual Machines and hit Create/Register VM.

  2. Select creation type > Create a new virtual machine. Click Next on each step to continue.

  3. Select a name and guest OS

  4. Select storage.

  5. Customize settings. Delete the virtual disk that was created by default with the new VM. Then, click Add hard disk > Existing hard disk. customize

  6. Select the converted My-VMthin.vmdk

  7. Start your Virtual Machine now.

Additional

You can download the vCenter Converter to do as well This tool is easy to do P2V and V2V process

This post is licensed under CC BY 4.0 by the author.