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:
[Window Title]
Virtual Hard Disk Properties
[Main Instruction]
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.
[Content]
Property ‘MaxInternalSize’ does not exist in class ‘Msvm_VirtualHardDiskSettingData’.
[Close]
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…
Hello, isn’t this procedure a recipe for data corruption from checkpoint point of view? Checkpoint are block based, Only new writes are written to checkpoint. But if you change original VHD – The contents of the blocks will change – so some files can now have different HASH. My first thought was MTF NTFS table…
Do I understand it wrong? Thanks:)
Yes this procedure risks data corruption. However I made no changes to the mounted vhd, I had just simply mounted it, and unmounted it, that was enough to break it….I haven’t noticed any data loss
Thanks for the post, I needed this today!
Thank you! Why is this so broken?
Dude Thanks for this.. It works with me. Your made my day!
Worked for me too!! Thanks !!
You are the best bro i had months of work on that vm and i erased all copies due to space issue
you made my day too!
Thanks, thanks, thanks :D