MicrosoftDocs / Virtualization-Documentation

Place to store our documentation, code samples, etc for public consumption.
http://docs.microsoft.com/virtualization/
Creative Commons Attribution 4.0 International
1.79k stars 1.54k forks source link

Hyper-V Manager "An error occurred while attempting to connect to server XX. Check that the Virtual Machine Management service is running and that you are authorized to connect to the server. #887

Open yousufctec opened 5 years ago

yousufctec commented 5 years ago

Unable to access Hyper V Manager after the Windows Update 1809. Getting the following error.

image

Hyper-V Virtual Machine Management service is running properly.

image

User is a part of Hyper-V Administrators.

image

All Hyper-V features are turned on as well.

image

Hardware virtualization is enabled. Desktop is running with high end specifications with 32gb of RAM.

Thanks!

Regards, Yousuf.

alexandrev commented 5 years ago

sames issue here

henkyprayoga commented 5 years ago

Any updates? I'm encountering the very same issue too

shellwhale commented 5 years ago

Same issue

KedarDande commented 5 years ago

Any resolution found for this issue?

henskjold73 commented 4 years ago

Guessing this is still not resolved...

henskjold73 commented 4 years ago

This worked for me.

  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 as administrator net start vmcompute
  9. Restart

Start Hyper-V Manager as administrator

vinothsundararajan commented 4 years ago

@henskjold73 Your solution which is worked for me thanks for the step by step procedure.

happylmnop commented 4 years ago

Worked for me as well. Thank you:)

ttaitt commented 4 years ago

Worked for me too!!! Thank you, Morgan Henskjold

jamiet147 commented 4 years ago

I had to run 'MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof' from Command Prompt to fix this.....

Seemed to happen after I installed the HPE ProLiant Support Pack!

AquinoN commented 4 years ago

I had to run 'MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof' from Command Prompt to fix this.....

Seemed to happen after I installed the HPE ProLiant Support Pack!

Worked for me, too. The code flow guard fix did not. THanks for the mofcomp solution.

Running Windows 10 1809 - not sure what changed since friday, but I come in on Monday and no-go for Hyper-V. I'm back - thanks. Need to get some testing done.
pbolduc commented 4 years ago

I had to run 'MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof' from Command Prompt to fix this.....

I ran into this error today too. I am also not sure what changed on my machine to cause this, but the MOFCOMP command resolved the issue. Code flow guard did not fix it for me.

pbolduc commented 4 years ago

I had to run 'MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof' from Command Prompt to fix this.....

I ran into this error today too. I am also not sure what changed on my machine to cause this, but the MOFCOMP command resolved the issue. Code flow guard did not fix it for me.

Not sure if it is related or not. But once my Hyper-V was working, my docker in my WSL2 distro stopped working. Even though it is configured in docker desktop settings it says it is not activated any more. It was working fine yesterday,

$ docker images

The command 'docker' could not be found in this WSL 2 distro.
We recommend to activate the WSL integration in Docker Desktop settings.

See https://docs.docker.com/docker-for-windows/wsl/ for details.

I have tried cycling the enable integration in for the distro to no avail.

pbolduc commented 4 years ago

I had to run 'MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof' from Command Prompt to fix this.....

I ran into this error today too. I am also not sure what changed on my machine to cause this, but the MOFCOMP command resolved the issue. Code flow guard did not fix it for me.

Not sure if it is related or not. But once my Hyper-V was working, my docker in my WSL2 distro stopped working. Even though it is configured in docker desktop settings it says it is not activated any more. It was working fine yesterday,

$ docker images

The command 'docker' could not be found in this WSL 2 distro.
We recommend to activate the WSL integration in Docker Desktop settings.

See https://docs.docker.com/docker-for-windows/wsl/ for details.

I have tried cycling the enable integration in for the distro to no avail.

Finally what worked for me is I had to disable the WSL 2 based engine, wait for docker desktop to recreate/mount the DockerDesktopVM. Once what was done, I re-enabled the WSL 2 based engine, and enabled in my distro and I am back to normal.

Hopefully this helps anyone else that runs into this issue.

pkarakal commented 4 years ago

None of the above solutions work for me. I haven't been able to use Hyper-V since an inside build from summer 2019. How can this still be an issue? Is anyone working on it on Microsoft or have any official roadmap to fixing this?

gwata commented 3 years ago

@pkarakal

TL;DR In Hyper-V manager, connect to 'server.local' instead of 'server'

Verbose Randomly this problem pops up on me after updates, and the same fix rarely seems to fix it.

I'm running Hyper-V manager on Win10 1607, connecting to Hyper-V Core 1607 without a domain, with a configured workgroup.

It used to work fine but as of an update, many months ago, on every workstation it has stopped connecting to the server.

After reading through the MS Support document section related to my setup I decided to confirm connectivity, you know Layer-1 foils and all.

While pinging the hyper-v server, for no particular reason I pinged both 'server' and 'server.local'. I noticed that 'server' returned an IPv4 response and 'server.local' returned an IPv6 response.

After modifying the power shell commands with every combination, the Hyper-V manager still wouldn't connect.

For kicks and grins, I tried connecting to 'server.local' and, why look at that, it comes right up.

Final config: power shell commands use 'server' Hyper-v connects to 'server.local'

If anyone has any insight as to why hyper-v requires ipv6 all of a sudden, I'd love to read about it.

giggio commented 3 years ago

@gwata Thanks for the insight! I had just enabled an IPv6 network at home, and did not connect that to the Hyper-v problem.

I'm not sure if that was the problem (or the only problem), because I also have another one: a long hostname. I named the machine a long hostname when it was first created, and Windows also created another one, truncated at 15 characters. I'm not sure why Windows sometimes uses one, and sometimes the other. Probably some legacy stuff.

In my case, it would not connect. My hostname, returned by the hostname command, was resolving to an ipv6 address. And localhost also was. Hyper-v was trying to connect to the hostname that was truncated when I named the machine. So, I added an entry to my hosts file (C:\Windows\System32\drivers\etc\hosts), pointing to 127.0.0.1. After I did that it was working again.

This also solved the issue on PowerShell. I was getting Get-VM: The computer '<REDACTED>' could not be resolved. Make sure you typed the machine name correctly and that you have network access.. The redacted part was the truncated hostname.

Docker was working fine before, and is still working fine now. But I was already using WSL2.

I hope this helps someone.

Isaurio07 commented 3 years ago

I had to run 'MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof' from Command Prompt to fix this.....

Seemed to happen after I installed the HPE ProLiant Support Pack!

This worked for me from upgrading from server 2012 R2 to 2019. I guess best option is to upgrade to 2016 them to 2019 so it wont break hyperv management

Rae1991 commented 3 years ago

This worked for me.

  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 as administrator net start vmcompute
  9. Restart

Start Hyper-V Manager as administrator

Thank you! Worked for me!

whiletrue57 commented 3 years ago

This worked for me.

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 as administrator `net start vmcompute`

9. Restart

Start Hyper-V Manager as administrator

谢谢,非常管用。

ghost commented 2 years ago

This worked for me.

  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 as administrator net start vmcompute
  9. Restart

Start Hyper-V Manager as administrator

Thanks you You just save my day of i3 gen 1 laptop

RefriZaddo commented 2 years ago

This worked for me.

  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 as administrator net start vmcompute
  9. Restart

Start Hyper-V Manager as administrator

did not work for me :(

jacimo commented 2 years ago

I tried everything under the sun. What finally worked was restoring WINRM to default - Type -> winrm invoke Restore winrm/config

mfld-fr commented 2 years ago

I had to run 'MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof' from Command Prompt to fix this.....

Seemed to happen after I installed the HPE ProLiant Support Pack!

Worked for me after the broken KB5009624. Thanks @jamiet147 !

tvongsaly4592 commented 1 year ago

I had to run 'MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof' from Command Prompt to fix this..... Seemed to happen after I installed the HPE ProLiant Support Pack!

Worked for me after the broken KB5009624. Thanks @jamiet147 !

did not work for me :(

JorgeCarousel commented 1 year ago

I'm having the same problem, only I'm trying to connect o a Hyper-V Server 2019 from a Windows 11 22H2, the first solution didn't work because there is no vmcompute in the list and for the second solution I get WindowsVirtualization.V2.mof doesn't exist, it was working properly before I updated Windows 11 to version 22H2, I even re-installed the Hyper-V Management Tools, but the service to manage Hyper-V Servers is not in services anymore.

Any ideas?

ParveenKumar87 commented 1 year ago

Worked for me as well :) 👍

Vazelin117 commented 1 year ago

Thanks from 2023

henskjold73 commented 1 year ago

@Vazelin117 you from the future?

cacafaca commented 11 months ago

I had to run 'MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof' from Command Prompt to fix this.....

Seemed to happen after I installed the HPE ProLiant Support Pack!

Confirming cause and solution! 👏👏👏 Fixed on HP ProLiant DL385p Gen8 / Windows Server 2022. 👍

DanATX commented 9 months ago

Appreciate this thread for a puzzling issue. The same happened in my case after running Dell Command Update (some video drivers were updated). The MOFCOMP command string fixed Hyper-V Manager in my case.

mouravitor4 commented 6 months ago

I had to run 'MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof' from Command Prompt to fix this.....

Seemed to happen after I installed the HPE ProLiant Support Pack!

I would like to thank you, after 3 months of trying, your tip worked for me, thank you very much!

WebDiez1989 commented 1 month ago

Connection occurs when the login/password is the same on two servers.

robinharwood commented 1 week ago

We hugely appreciate your contribution, feedback, and support to our technical documentation.

We’ve phased out GitHub Issues on this repository as the feedback mechanism for content and have replaced it with a new feedback system. For more information see, Content User Feedback. As part of this rollout, we are migrating your issue where our team will use your comments to improve the documentation experience. Unfortunately, this does mean you won't be able to access this issue after the migration is complete.

All issues will be migrated by Thursday 29th August 2024.

Once again, thank you for your valuable feedback, we hope you’ll continue to contribute using our new feedback system.