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.”

28 comments

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.

 

28 comments on “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.””

  1. So, tried your solution… (running as administrator) got this:
    Windows PowerShell
    Copyright (C) Microsoft Corporation. All rights reserved.

    PS C:\WINDOWS\system32> MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof
    Microsoft (R) MOF Compiler Version 10.0.17134.1
    Copyright (c) Microsoft Corp. 1997-2006. All rights reserved.
    Parsing MOF file: C:\WINDOWS\System32\WindowsVirtualization.V2.mof
    MOF file has been successfully parsed
    Storing data in the repository…
    An error occurred while opening the namespace for object 1:
    0X80041002 Class, instance, or property ” was not found.
    Compiler returned error 0x80041002
    PS C:\WINDOWS\system32>

    Like

      1. Hey Shauncassells !
        Below error occurs, tried all solution including upper one. But still Hyper-V not working.
        Can you please 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

  2. 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

  3. I got this from Dan Hoeger on this thread.. https://social.technet.microsoft.com/Forums/en-US/0a29c671-b640-4c2d-954f-622b25f65ad9/hyperv-encountered-an-error-trying-to-access-an-object-on-computer-object-was-not-found?forum=win10itprovirt

    – Open “Window Security”
    – Open “App & Browser control”
    – Click “Exploit protection settings” at the bottom
    – Switch to “Program settings” tab
    – Locate “C:\WINDOWS\System32\vmcompute.exe” in the list and expand it
    – Click “Edit”
    – Scroll down to “Code flow guard (CFG)” and uncheck “Override system settings”
    – Start vmcompute from powershell “net start vmcompute” or from services app

    Hyper-V manager can now connect to my local server!!! Whoop

    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