Merge-VHD Question and vmgs non bootable vm question

merrittr

Active Member
Joined
Jan 4, 2026
Messages
17
I have a vm where the main disk is defined in Hyperv management as disk0-snapshot.vhdx and there is another disk0.vhdx in that folder that is larger in size , when I try and boot the vm I get a message <random charachters>.vmgs does not exist message. but there is a
<random charachters>.vmgs.<morechars>. How do I rehabilitate this into a bootable vm?
 

Hi merrittr — this sounds like two separate Hyper‑V issues:
  1. The VM is trying to resume from a missing .vmgs guest state file.
  2. The VM disk currently points to disk0-snapshot.vhdx, which is likely a differencing/checkpoint child disk whose parent is disk0.vhdx.
Do not simply attach disk0.vhdx and boot it yet. If disk0-snapshot.vhdx contains newer writes, booting from the parent may appear to “roll back” the VM.

Recommended recovery path​

1. Power off the VM and make a full folder backup​

Before merging or changing anything:
  1. Shut down/turn off the VM if possible.
  2. Stop any backup software that may be touching the VM.
  3. Copy the entire VM folder somewhere safe, including:
    • disk0.vhdx
    • disk0-snapshot.vhdx
    • any .avhdx, .vhdx, .vmcx, .vmrs, .vmgs files
This is important because a bad merge can make the chain unrecoverable.

2. Delete the broken saved state​

The missing .vmgs message usually means Hyper‑V is trying to restore a saved/running state that no longer exists.
Try this first:
  1. Open Hyper‑V Manager.
  2. Right-click the VM.
  3. If available, choose Delete Saved State.
  4. Try starting the VM again.
If Hyper‑V Manager will not do it, use elevated PowerShell:
Remove-VMSavedState -VMName "Your VM Name"
Then try starting the VM.
Do not rename the existing <random>.vmgs.<morechars> file to match the missing .vmgs unless you have no other choice and have a backup. It may be a stale/temp/state-related file and not valid for this VM state.

3. Inspect the VHDX chain​

Run this from an elevated PowerShell window on the Hyper‑V host:
Get-VHD -Path "C:\Path\To\disk0-snapshot.vhdx" | Select-Object Path,VhdType,ParentPath
Expected result if it is a checkpoint/differencing disk:
Code:
VhdType    : Differencing
ParentPath : C:\Path\To\disk0.vhdx
Also check the parent:
Get-VHD -Path "C:\Path\To\disk0.vhdx" | Select-Object Path,VhdType,ParentPath
If disk0-snapshot.vhdx has disk0.vhdx as its parent, then the active boot disk is probably the snapshot child.

4. If the disk chain is healthy, keep the VM pointed at the child disk​

If disk0-snapshot.vhdx is healthy and points to disk0.vhdx, the quickest recovery may be:
  1. Delete the saved state.
  2. Leave the VM attached to disk0-snapshot.vhdx.
  3. Start the VM cold.
If it boots, you can later clean up/merge the checkpoint properly.

5. If you want to merge the snapshot into the parent​

Only do this after the VM is off and backed up.
If disk0-snapshot.vhdx is a differencing disk and disk0.vhdx is its parent, run:
Merge-VHD -Path "C:\Path\To\disk0-snapshot.vhdx" -DestinationPath "C:\Path\To\disk0.vhdx"
After the merge completes:
  1. Open the VM settings.
  2. Change the hard drive path from:
disk0-snapshot.vhdx
to:
disk0.vhdx
  1. Start the VM.
Warning: After a successful merge, the child snapshot disk is no longer useful as an independent disk.

6. If Hyper‑V still refuses the VM config, create a new VM shell​

If the VM configuration is damaged because of the missing .vmgs/state files, the cleanest option is often to create a new VM and attach the recovered disk.
  1. Create a new VM with the same generation as the old one.
  2. Do not create a new virtual disk.
  3. Attach the correct recovered disk:
    • Use disk0-snapshot.vhdx if you did not merge.
    • Use disk0.vhdx if you successfully merged.
  4. Match the old VM settings as closely as possible:
    • Generation 1 vs Generation 2
    • Memory
    • vCPU count
    • Network switch
    • Secure Boot setting if Gen 2
  5. Boot the new VM.
If it is a Generation 2 Windows VM and fails to boot, check:
  1. VM Settings > Firmware
  2. Make sure the VHDX is first in boot order.
  3. If needed, temporarily disable Secure Boot to test.

My suggested order for your case​

  1. Back up the whole VM folder.
  2. Run:
Remove-VMSavedState -VMName "Your VM Name"
  1. Check the disk chain:
Get-VHD -Path "C:\Path\To\disk0-snapshot.vhdx" | Select Path,VhdType,ParentPath
  1. If the chain is valid, try booting again while still attached to disk0-snapshot.vhdx.
  2. If it boots, then decide whether to leave it or merge it.
  3. If the config remains broken, create a new VM and attach the correct VHDX.
If you can paste the output of:
Code:
Get-VMHardDiskDrive -VMName "Your VM Name" | Select VMName,Path

Get-VHD -Path "C:\Path\To\disk0-snapshot.vhdx" | Select Path,VhdType,ParentPath
I can tell you exactly whether you should boot from the snapshot, merge it, or rebuild the VM config.
 

Back
Top