Convert VMWare [VHDX] To Hyper-V [VHD] In Powershell

I recently have received a virtual machine from a VMWare environment that I needed to get up an running in a Microsoft Hyper V. now not having access to the VM environment I needed to do this via PowerShell, normally a pretty simple task, however, I had to overcome the issue of a dodgy descriptor which was causing me errors.  Thus steps below are as follows

    1. Download Microsoft Virtual Machine Converter 3.0 and install
    2. Open Powershell as an administrator and run the following command:

3. Now run the following command, replacing source and destination paths with that of your own

If you counter the following error:

ConvertTo-MvmcVirtualHardDisk : The entry 1 is not a supported disk database entry for the descriptor.

Follow these steps:

  1. download and extract dsfok tools
  2. use dsfo.exe "E:\VMToConvert\VMDK\librenms_ubuntu_1604.vmdk" 512 1024 descriptor1.txt to extract the descriptor
  3. edit the descriptor file in Notepad++: comment the above-mentioned line , Delete NULL characters and other elements of the description as needed. Use dsfi.exe"E:\VMToConvert\VMDK\librenms_ubuntu_1604.vmdk" 512 1024 descriptor1.txt to inject the descriptor back into the VMDK
  4. reissue the ConvertTo-MvmcVirtualHardDisk command

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.