Q. I recreated my Hyper-V guest configuration and it lost its network configuration. Why?

A. This has happened to me many times. I have a virtual machine (VM) and somehow I lose the configuration XML file, or I simply move the VM to another Hyper-V host. I create an identical VM with the same number of network interfaces, connected to the same networks, but all of my network configuration is gone.

When you think about it, this is how Hyper-V should behave. If you had a physical box and replaced the network card, the new card would have its own globally unique identifier (GUID) and its own MAC. It's exactly the same with VM configurations. The new network interface has its own GUID, which won't match the existing GUID in the OS's configuration, so the OS will see it as a new network card and make you perform the network configuration again.

The GUID and MAC of the network interface are part of the guest's XML configuration file. Look for the section of the file the file that contains the word "MacAddress," as shown here.


Network Adapter

The first line shows the GUID of the VM's network adapter. If you create a new VM, the GUID of the network adapter must match the GUID of the adapter in the old configuration to preserve your network configuration. This means you need to make sure you keep a backup of the configuration files for your VMs, or at least the network adapter GUIDs. If you were really stuck, you could actually boot the VM, configure device manager to show disconnected devices, and get the GUID from the network adapter properties. You could then configure a network adapter and force the GUID in its configuration. I'll discuss accessing disconnected devices in my next FAQ.

I should point out that tampering with the XML configuration files directly isn't really supported by Microsoft. Instead, you should use Windows Management Instrumentation to modify the network adapters. But editing the file worked fine for me.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.