From d820bef6f43d8a958c38362a5e5e29693b91251b Mon Sep 17 00:00:00 2001 From: Matt Wrock Date: Fri, 8 Aug 2014 21:18:16 -0700 Subject: [PATCH] filter host IPs to those that resolve on guest when finding addresable IPs on a windows guest --- plugins/guests/windows/cap/choose_addressable_ip_addr.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/guests/windows/cap/choose_addressable_ip_addr.rb b/plugins/guests/windows/cap/choose_addressable_ip_addr.rb index 0403fc86c..2304246ce 100644 --- a/plugins/guests/windows/cap/choose_addressable_ip_addr.rb +++ b/plugins/guests/windows/cap/choose_addressable_ip_addr.rb @@ -5,7 +5,10 @@ module VagrantPlugins def self.choose_addressable_ip_addr(machine, possible) machine.communicate.tap do |comm| possible.each do |ip| - return ip + command = "ping -n 1 -w 1 #{ip}" + if comm.test(command) + return ip + end end end