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

14 Comments Add yours

  1. Dwayne Dunn says:

    Worked great. What a life saver.

    Like

  2. Matt says:

    Thank you!

    Like

  3. Howel says:

    It does not work for me, tried all the ways found in Internet, run above command, resinstall HyperV component, change hostname

    Like

    1. What was the exact error you were getting? Fun Fact: if you have the error popup dialog selected you can use the keyboard shortcut Ctrl+C to copy all the text.

      Like

  4. Saqib Khalil says:

    Below error occurs, tried all solution including upper one. But still Hyper-V not working.
    Is there anyone who can help me out.

    Hyper-V Manager

    [Main Instruction]
    An error occurred while attempting to connect to server “DESKTOP-J9DEPHB”. Check that the Virtual Machine Management service is running and that you are authorized to connect to the server.

    [Content]
    Hyper-V encountered an error trying to access an object on computer ‘DESKTOP-J9DEPHB’ because the object was not found. The object might have been deleted. Verify that the Virtual Machine Management service on the computer is running.

    Like

    1. Did you run the Mofcomp? What output did you get?
      Also, I am guessing you checked to ensure the Hyper-V service is started.

      Like

  5. sunil bhaskarla says:

    Worked for me on Windows 10 Version 1703.

    Like

  6. CW Stal says:

    Worked! Thank you!

    Like

  7. Tariq says:

    great work

    Like

  8. FastFngrz says:

    curiously, I could manage my upgraded Server 19 from another host, but not itself – not until I ran your lifesaver. Fixed it right up – thank you!!!

    Like

  9. Jeff says:

    Thank you so much

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s