From 377b9002771e769e8b687613740bc7f9617e4774 Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Fri, 2 Nov 2018 16:33:36 -0700 Subject: [PATCH] Only execute reboot check if guest communicator is ready --- plugins/guests/windows/cap/reboot.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/guests/windows/cap/reboot.rb b/plugins/guests/windows/cap/reboot.rb index f8354096b..070f4ea80 100644 --- a/plugins/guests/windows/cap/reboot.rb +++ b/plugins/guests/windows/cap/reboot.rb @@ -38,7 +38,8 @@ module VagrantPlugins def self.wait_for_reboot(machine) script = File.expand_path("../../scripts/reboot_detect.ps1", __FILE__) script = File.read(script) - while machine.communicate.execute(script, error_check: false, shell: :powershell) != 0 + + while machine.guest.ready? && machine.communicate.execute(script, error_check: false, shell: :powershell) != 0 sleep 10 end