Nathan Evans' Nemesis of the Moment

Solved: Hyper-V’s VMConnect tool sporadically losing connection to VM

Posted in Windows Environment by Nathan B. Evans on March 5, 2011

Last night we performed a big switch over in our data centre. We moved everything onto a new managed switch and Sonicwall firewall, re-pointed and re-addressed lots and lots of servers, and well basically just done a bunch of stuff we should have done yonks ago! Everything seemed to go really well except for one thing: our Hyper-V hosts were now throwing really annoying and random disconnection errors when connected straight into a VM using its “Connect…” menu item, or otherwise known as VMConnect.exe. The connection would work for at least a couple seconds, sometimes for as long as a minute or two. But then it would barf up and the following error message dialog would be displayed.

Hyper-V's VMConnect tool displaying the disconnection error message

The full description of the error was as follows:

The connection to the virtual machine was lost. This can occur when a virtual machine stops unexpectedly, or when network problems occur. Try to connect again. If the problem persists, contact your system administator.

Would you like to try to reconnnect?

This was really annoying because we were connecting to local VMs that were present on the exact same VM host from which we were connecting. So presumably there wouldn’t be any packets hitting the network, and thus ruling out any of the new hardware and network changes we had just made.

After racking my brains on it for a bit (which included firing up Wireshark to perform a sanity check), I loaded up TCPView. This is a really great little tool from Mark Russinovich‘s stable called Windows Sysinternals. With this tool running I then retried the VMConnect, so that I could see what socket activities it was performing.

TCPView shows the VMConnect appearing to use TCP/IP V6 even for localhost

What this showed is that even when connecting to the local VM host using “localhost” or “127.0.0.1” as the address (i.e. IPv4) the VMConnect tool was seemingly transforming this into a IPV6 address and then forming a TCPV6 connection. This was interesting.

I immediately went to check whether IPV6 was actually enabled on the VM host’s network adapters. Low and behold, it was not. Turns out that when we flicked over the Gateway IP to point to the new firewall, we also subconciously turned off the IPV6 protocol on the list! A fairly innocuous thing to do, one would think, especially on an internal LAN!

Hyper-V's virtual network adapter TCP/IP settings

So there you have it. If you come across this problem with Hyper-V, I would recommend you immediately check to ensure that you have not inadvertently disabled the IPV6 protocol on your virtual network adapter for Hyper-V.

The very moment we re-enabled IPV6, the problem with VMConnect constantly disconnecting every few seconds totally went away!

Not many problems get more obscure than this.

Tagged with:

16 Responses

Subscribe to comments with RSS.

  1. Eric Skaggs said, on May 26, 2011 at 5:51 PM

    Hi Nathan,

    Just wanted to send you a quick “Thank You!” because this post solved the same problem for me. I found that my Network Adapter’s IPV6 option was disabled. Once I reenabled it, my VMs have been up and running without issue.

    I hope you don’t mind, but I’ve written about it and referenced this post. Please let me know if that’s an issue and I can remove the reference. Here’s the link to my post that references yours: http://www.sharepointnerd.com/blog/Lists/Posts/Post.aspx?ID=31.

    Thank you,

    Eric Skaggs

    • nbevans said, on May 27, 2011 at 7:59 AM

      Hi Eric,

      Glad it helped you out! When it happened to me I was completely flummoxed and had to dig out my development/debug tools to find out the solution. There was nothing on the web about it at the time!

      No problem with the link back, that’s what blogs are for🙂

      Thanks.

  2. Neo said, on December 14, 2011 at 5:45 AM

    Nathan,

    I had the exact same situation as yours. We just moved one of our Hyper-V hosts to a Datacenter and I was really annoyed by this vmconnect disconnections. I also had TCPv6 unchecked on the Hyper-V host. After checking, the issue just disappeared.

    THANKS A LOT SIR.

  3. Samuel Beck said, on December 17, 2011 at 9:37 PM

    Thanks once again! So much!
    Obviously I had the exact same issue!

    • michael said, on August 11, 2012 at 11:15 AM

      i really really needed this post ; first post on google after bringing over my vm’s from a different server. i did not think it would be this causing the problem but hey ! its the last place you would check.

      thank you very much for you time and effort to investigate this

  4. Dan said, on September 28, 2012 at 12:27 AM

    Thanks! Ran into this issue as well. You saved me a lot of brain work. Cheers.

  5. Barahbasti said, on December 1, 2012 at 11:34 AM

    what if we even enable IPV6 on guest also ??

  6. Barahbasti said, on December 1, 2012 at 11:39 AM

    Great Thanks BTW..🙂

  7. Todd said, on February 22, 2013 at 6:38 PM

    So far so good!!! Thank you very much!!

  8. Shawn Butt said, on March 4, 2013 at 9:50 PM

    Right on brother.
    Re-enabling IPv6 that one of our Techs had disabled, DID THE TRICK!

  9. Sathish said, on March 27, 2013 at 7:11 AM

    Thankyou so much

  10. Bidehalaxmi Panda said, on May 14, 2013 at 9:49 AM

    Hi Nathan,

    Thank you so much. I was facing the same issue and it just got solved..

  11. Jithin said, on December 17, 2014 at 9:38 AM

    I strongly guess this has something to do with “Enhanced Session” feature on Hyper V.

  12. Jithin said, on December 17, 2014 at 9:40 AM

    I strongly guess this has something to do with “Enhanced Session” feature on Hyper V.

  13. Richard said, on January 9, 2015 at 4:55 PM

    This just solved a 4 year nagging problem for my company. Thanks so much for documenting this.

  14. Ralf said, on February 25, 2015 at 3:16 PM

    Many thanks for posting this issue! Spent hours working out what it was. No german document was found. Yours saved my day!


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 )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: