FIX: “Hyper-V encountered an error trying to access an object on computer ‘localhost’ because the object was not found. The object might have been deleted. Verify that the Virtual Machine Management service on the computer is running. If the service is running, try to perform the task again by using Run as Administrator.”

Opened up Hyper-V today and all of my VMs where missing… umm what?

HyperV missing 1

So I tried to connect to a server (button far right)

HyperV missing 2

POPUP ERROR

 HyperV missing 3

Error Text

“Hyper-V encountered an error trying to access an object on computer ‘localhost’ because the object was not found. The object might have been deleted. Verify that the Virtual Machine Management service on the computer is running. If the service is running, try to perform the task again by using Run as Administrator.”

Troubleshooting

Checked Services they are running

Checked optional components they are running

Tried to run PowerShell Get-VM… ERRORS!

Long story short it turns out that a recent uninstall had deleted a MOF

Fix

Run the following command from an Elevated (Administrator) command prompt or PowerShell.  Winkey+X >> Windows PowerShell (Admin)

MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof

Summary

Sometimes an uninstaller for an application has unintended consequences!  Good news it was an easy fix of just recompiling the MOF (Microsoft Object Format).  WMI is awesome but so touchy.

 

Advertisements