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:
- 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.
- Open HyperV and right click on your virtual machine and click on Turn Off.
- 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".
- Double click on "ListenerPort" and click on "Decimal" and change the value to 21791 and click OK.
- Now close registry editor and open PowerShell as administrator.
- Type the following commands in powershell to stop and start vmmc service:
Stop-Service vmms
Start-Service vmms - 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.
- 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.
That's all for today. Keep visiting PC Tricks Guru for more tips and tricks.