Trying to copy a huge file out of a HyperVM late at night I naively went and right clicked “Mount” in Windows Explorer on the VHDX file. Unfortunately my VM had multiple checkpoints, which aren’t visible when browsing the VHDX. Realised my mistake then unmounted the VHDX. Unfortunately now the VM stopped booting…
Can’t access disk, opening the VM properties selecting disk and clicking Inspect I get error:
Virtual Hard Disk Properties
There was a problem with one of the command line parameters. Either ‘DESKTOP-RTTN04O’ could not be found, or ‘C:\Users\Public\Documents\Hyper-V\Virtual hard disks\Win7_31AB2236-D8AC-4CF9-8A75-2DC321590C8C.Avhdx’ is not a valid path.
Property ‘MaxInternalSize’ does not exist in class ‘Msvm_VirtualHardDiskSettingData’.
This VM had the “parent” and two subsequent checkpoints..
- Parent = Win7.vhdx
- 1st checkpoint = Win7_5A0F4E19-3212-4D0A-8A43-83853D468B0B.avhdx
- 2nd checkpoint = Win7_31AB2236-D8AC-4CF9-8A75-2DC321590C8C.avhdx
To fix this I used the PowerShell cmd Set-VHD
Set-VHD "C:\Users\Public\Documents\Hyper-V\Virtual hard disks\Win7_31AB2236-D8AC-4CF9-8A75-2DC321590C8C.Avhdx" -ParentPath "C:\users\public\documents\Hyper-V\Virtual hard disks\Win7_5A0F4E19-3212-4D0A-8A43-83853D468B0B.avhdx" Set-VHD "C:\users\public\documents\Hyper-V\Virtual hard disks\Win7_5A0F4E19-3212-4D0A-8A43-83853D468B0B.avhdx" -ParentPath "C:\users\public\documents\Hyper-V\Virtual hard disks\Win7.vhdx"
Unfortunately the final command failed:
Set-VHD : Failed to set new parent for the virtual disk.
There exists ID mismatch between the differencing virtual hard disk and the parent disk.
To resolve this error I added –ignoreidmismatch
Set-VHD "C:\users\public\documents\Hyper-V\Virtual hard disks\Win7_5A0F4E19-3212-4D0A-8A43-83853D468B0B.avhdx" -ParentPath "C:\users\public\documents\Hyper-V\Virtual hard disks\Win7.vhdx" -ignoreidmismatch
I reset my VM hard disk to use the 2nd checkpoint disk file, I received a warning data loss could occur if I continued, but I risked everything and continued anyway. Clicking “Inspect Disk” now succeeded and my VM now booted fine, and seemed to have the recent data I had added into it…