Saturday, 22 May 2021

Cannot connect to the virtual machine, try to connect again : Fix error with HyperV

Cannot connect to the virtual machine, try to connect again : Fix error with HyperV
If you are a network engineer or an instructor who uses Virtual machine to run several ISOs, you might face issues in creating virtual machine using HyperV in Windows 10. You may get the error "Cannot connect to the virtual machine. Try to connect again. If the problem persists, contact your system administrator. Would you like to try connecting again?"

There are so many suggestions available online which suggest to change the date and time of the system, reinstall HyperV, delete the existing virtual machine and re-setup it, clear the DNS cache of the system etc but none of the would work. This issue is actually because of an old bug in Windows 10 and just a minor change can fix the issue easily. Let me guide you through the steps to easily resolve the problem:

  1. Open cmd with admin and run the command netstat -ano | find "2179" and check if the virtual machine management service is listening to this port, I'm sure you would not get any result after running the command.
    not listening to port
  2. Open HyperV and right click on your virtual machine and click on Turn Off.
  3. Now open registry editor by running regedit command in RUN and then navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization and look for the DWORD "ListenerPort".
  4. Double click on "ListenerPort" and click on "Decimal" and change the value to 21791 and click OK.
    modify registry
  5. Now close registry editor and open PowerShell as administrator.
  6. Type the following commands in powershell to stop and start vmmc service:
    Stop-Service vmms
    Start-Service vmms
  7. Now close powershell and open cmd with admin and run the following command again: netstat -ano | find "21791" and this time, you would see that vmmc is listening to the port number 21791.
    listening to port
  8. Now close cmd and then try connecting to your virtual machine through HyperV, it would get connected and you would be able to run your virtual machine without any errors.
    hyperv connecting

That's all for today. Keep visiting PC Tricks Guru for more tips and tricks.

Share:

1 comment:

  1. Claire Littleton22 May 2021 at 12:03

    Awesome, this is the only tutorial that actually works!! Thanks mate.

    ReplyDelete

Custom Search Box

Offers and Deals

Subscribe Our Newsletter