Xen VM exported to Hyper-V has no internet connectivity

This weekend I began migrating some servers from a Xen Server to a Hyper-V server.

The process was pretty straight forward, as I had tested this, the week before, in the lab environment.

  1. using Xen Center, Power off the VM and export the server. Ensure to not select the 'one file' option.
  2. Open the export folder when complete, and copy (and rename) the vhd file
  3. Create the new VM on the Hyper-V server and attach the exported disk
  4. Power up
  5. Uninstall Xen Tools
  6. Reboot
  7. Install Hyper-V Guest tools
  8. Rub hands gleefully.

It was during the last phase that I ran into a roadblock. Obviously there was a change of hardware, requiring a reboot. The problem was, that once it was up, there was no internet connectivity. I was able to do anything on the LAN. I was also able to get dns lookups for external addresses, but I couldnt get traffic out of the LAN from this server.

The issue, it turned out, was that during the addition of the Hyper-V NIC, a persistent Route was added for 0.0.0.0 using the NIC as the gateway.

In a command window, use ROUTE PRINT to see your routing table.

the solution, was to remove this persistent route;

route delete 0.0.0.0

and re-add it with the correct gateway;

route add 0.0.0.0 mask 0.0.0.0 <gateway ip>