Q. I created a new virtual machine (VM) and I'm connecting it to the virtual hard disk of a previous VM. I still have the old VM's XML configuration file. Can I change the new VM so it keeps the old one's network configuration?

A. Hyper-V stores configurations in XML files. Part of that configuration file for the network adapter includes the device GUID of the network adapter. This GUID is unique for each VM, so if I create a new VM with the exact same configuration for an existing VHD, the network adapter will have a new device ID and therefore be treated as a new piece of hardware, losing any static IP configuration.

It isn't supported, but you can copy the device GUID from the network adapter in the old configuration file into the new configuration file. Doing so makes the VM think it's the same network device and thus maintains any configuration related to the adapter, such as IP address.

Open the old configuration file and locate the network adapter section. It will look like the following:

Network Adapter

Note the FriendlyName, which tells us it's the Network Adapter. The device ID is the ChannelInstanceGUID. Copy the value in the curly brackets (\{\}) and paste over the ChannelInstanceGUID in the new VM's configuration file.

Related Reading:

Check out hundreds more useful Q&As like this in John Savill's FAQ for Windows. Also, watch instructional videos made by John at ITTV.net.
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.