From 992c148169ec1881868933aa8448e1198dcfeabf Mon Sep 17 00:00:00 2001 From: Ben Jansen Date: Fri, 13 Mar 2015 11:42:55 -0700 Subject: [PATCH] Ignore Windows NICs with nil :net_connection_id When upping a Win XP box, vagrant found a lot of "virtual" network connections that did not have DHCP enabled, and tried to configure them for DHCP. This did not work because their :net_connection_id is nil. Ignoring these network connections enabled the XP box to be upped. --- plugins/guests/windows/cap/configure_networks.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/guests/windows/cap/configure_networks.rb b/plugins/guests/windows/cap/configure_networks.rb index 8130cef77..8e766a319 100644 --- a/plugins/guests/windows/cap/configure_networks.rb +++ b/plugins/guests/windows/cap/configure_networks.rb @@ -64,7 +64,9 @@ module VagrantPlugins guest_network.network_adapters.each do |nic| @@logger.debug("nic: #{nic.inspect}") naked_mac = nic[:mac_address].gsub(':','') - if driver_mac_address[naked_mac] + # If the :net_connection_id entry is nil then it is probably a virtual connection + # and should be ignored. + if driver_mac_address[naked_mac] && !nic[:net_connection_id].nil? vm_interface_map[driver_mac_address[naked_mac]] = { net_connection_id: nic[:net_connection_id], mac_address: naked_mac,