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

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

 

50 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

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

  5. I had the same problem, tried this what Shaun wrote but it didn’t solve it. Then I managed to solve it by doing the following:
    1. Open “Window Security”;
    2. Open “App & Browser control”;
    3. Click “Exploit protection settings” at the bottom;
    4. Switch to “Program settings” tab;
    5. Locate “C:\WINDOWS\System32\vmcompute.exe” in the list and expand it;
    6. Click “Edit”;
    7. Scroll down to “Code flow guard (CFG)” and uncheck “Override system settings”;
    8. Start vmcompute from powershell by typing “net start vmcompute”.

    Like

  6. I am running my dev environment in a Windows 10 LTSC VM on corporate given hardware in order to isolate myself as much as possible from bureaucracy while still following company policy, though perhaps blurring lines slightly, and corporate still managed to muck up my dev environment. Your web page keeps on giving, even day after Christmas. Thank you so much!!!

    Like

  7. Boot drive was failing so cloned it onto and SSD. After booting with new drive docker startup was failing with this error. Went into Hyper-V Manager and tried to connect to local server and got the same error. Ran the command to recompile file and it was this fix. Everything is working now, docker starts up no errors. Thanks!

    Like

  8. Wow what an easy solution, I have spent the best part of 4 hours trying to fix this as two or my hosts were having this issue, tried a number of other recommended ways to fix it with no success. You saved the day.
    Thanks

    Like

  9. Thank you so much! Running MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof from elevated command prompt immediately fixed this. Thank you thank you thank you!!!

    Like

Leave a reply to Saqib Khalil Cancel reply