Skip to content

Instantly share code, notes, and snippets.

@mcxiaoke
Forked from rahilwazir/vmdk_vhdx.md
Created December 8, 2022 09:18
Show Gist options
  • Save mcxiaoke/fe48d7c4529efd5b1bf6a30e18e410b6 to your computer and use it in GitHub Desktop.
Save mcxiaoke/fe48d7c4529efd5b1bf6a30e18e410b6 to your computer and use it in GitHub Desktop.

Revisions

  1. @rahilwazir rahilwazir revised this gist Sep 28, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion vmdk_vhdx.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@

    Follow [steps][1]:

    - Download: ~~http://www.microsoft.com/en-us/download/details.aspx?id=42497~~ http://download.microsoft.com/download/9/1/E/91E9F42C-3F1F-4AD9-92B7-8DD65DA3B0C2/mvmc_setup.msi
    - Download: http://download.microsoft.com/download/9/1/E/91E9F42C-3F1F-4AD9-92B7-8DD65DA3B0C2/mvmc_setup.msi (thanks @xavery)
    - Open Powershell as administrator and run
    `Import-Module 'C:\Program Files\Microsoft Virtual Machine Converter\MvmcCmdlet.psd1'`
    - And after
  2. @rahilwazir rahilwazir revised this gist Sep 28, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion vmdk_vhdx.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@

    Follow [steps][1]:

    - Download: http://www.microsoft.com/en-us/download/details.aspx?id=42497
    - Download: ~~http://www.microsoft.com/en-us/download/details.aspx?id=42497~~ http://download.microsoft.com/download/9/1/E/91E9F42C-3F1F-4AD9-92B7-8DD65DA3B0C2/mvmc_setup.msi
    - Open Powershell as administrator and run
    `Import-Module 'C:\Program Files\Microsoft Virtual Machine Converter\MvmcCmdlet.psd1'`
    - And after
  3. Rahil revised this gist Dec 3, 2016. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions vmdk_vhdx.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # VMDK to VHDX

    Follow [steps][2]:
    Follow [steps][1]:

    - Download: http://www.microsoft.com/en-us/download/details.aspx?id=42497
    - Open Powershell as administrator and run
    @@ -14,7 +14,7 @@ If you counter following error:
    In my case it was entry `4`

    Follow these (steps)[1]:
    Follow these [steps][2]:

    1. download and extract dsfok tools
    2. use `dsfo.exe "c:\temp\disk2.vmdk" 512 1024 descriptor1.txt` to extract the descriptor
    @@ -23,5 +23,5 @@ Follow these (steps)[1]:
    5. repeat these steps for the other disk (my VM has two `.vmdk` files)
    6. reissue the `ConvertTo-MvmcVirtualHardDisk` command

    [1]: http://stackoverflow.com/questions/37481737/error-when-converting-vmware-virtual-disk-to-hyperv
    [2]: https://blogs.msdn.microsoft.com/timomta/2015/06/11/how-to-convert-a-vmware-vmdk-to-hyper-v-vhd/
    [1]: https://blogs.msdn.microsoft.com/timomta/2015/06/11/how-to-convert-a-vmware-vmdk-to-hyper-v-vhd/
    [2]: http://stackoverflow.com/questions/37481737/error-when-converting-vmware-virtual-disk-to-hyperv
  4. Rahil revised this gist Dec 3, 2016. No changes.
  5. Rahil created this gist Dec 3, 2016.
    27 changes: 27 additions & 0 deletions vmdk_vhdx.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    # VMDK to VHDX

    Follow [steps][2]:

    - Download: http://www.microsoft.com/en-us/download/details.aspx?id=42497
    - Open Powershell as administrator and run
    `Import-Module 'C:\Program Files\Microsoft Virtual Machine Converter\MvmcCmdlet.psd1'`
    - And after
    `ConvertTo-MvmcVirtualHardDisk -SourceLiteralPath d:\scratch\vmx\VM-disk1.vmdk -VhdType DynamicHardDisk -VhdFormat vhdx -destination c:\vm-disk1`

    If you counter following error:

    > ConvertTo-MvmcVirtualHardDisk : The entry 1 is not a supported disk database entry for the descriptor.
    In my case it was entry `4`

    Follow these (steps)[1]:

    1. download and extract dsfok tools
    2. use `dsfo.exe "c:\temp\disk2.vmdk" 512 1024 descriptor1.txt` to extract the descriptor
    3. edit the descriptor file in Notepad++: comment the above mentioned line (as I added the extra single character (#) I also deleted one NULL character from the end to keep the file size of 1024 bytes (not sure if this is needed).
    4. use `dsfi.exe "c:\temp\disk2.vmdk" 512 1024 descriptor1.txt` to inject the descriptor back into the VMDK
    5. repeat these steps for the other disk (my VM has two `.vmdk` files)
    6. reissue the `ConvertTo-MvmcVirtualHardDisk` command

    [1]: http://stackoverflow.com/questions/37481737/error-when-converting-vmware-virtual-disk-to-hyperv
    [2]: https://blogs.msdn.microsoft.com/timomta/2015/06/11/how-to-convert-a-vmware-vmdk-to-hyper-v-vhd/