Can't convert a VHDX with Convert-VHD in PowerShell (or in Hyper-V Manager)

A

aturnbul

I have a VHDX file that is an image of the system drive in a new laptop, created with Diskpart (version 10.0.19041.1):


create vdisk file="D:\PC_Original.vhdx" type=expandable source="\\.\physicaldrive0"


If this is successful (it was), I should be able to store and work with the VHDX on another system. The file PC_Original.vhdx mounts just fine on another Windows 10 Enterprise (v20H2) system. There are 5 partitions on the original drive, and each shows up under Diskpart list partitions, as expected. If I dismount the VHDX and try to convert it in PowerShell (v5.1.19041.610), I get:


PS E:\> test-vhd -path e:\PC_Original.vhdx

True


PS E:\> convert-vhd -path e:\PC_Original.vhdx -destinationpath e:\new.vhd

convert-vhd : Failed to convert the virtual disk.

The system failed to convert 'e:\PC_Original.vhdx'.

Failed to convert the virtual disk.

The system failed to convert 'e:\PC_Original.vhdx': The parameter is incorrect. (0x80070057).

At line:1 char:1

+ convert-vhd -path e:\PC_Original.vhdx -destinationpath e:\new.vhd

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : InvalidArgument: :)) [Convert-VHD], VirtualizationException

+ FullyQualifiedErrorId : InvalidParameter,Microsoft.Vhd.PowerShell.Cmdlets.ConvertVhd



The VHDX passes validation, but I get the cryptic error: 0x80070057.


Can anyone explain what's wrong here or how to fix it, please? I've found many explanations for the 0x80070057 error code online, but none seem to apply to my situation.


Thanks in advance for any help.

Continue reading...
 
Back
Top Bottom