From 88e65ef59b90e65d1894390a2c748398a7c7df5f Mon Sep 17 00:00:00 2001 From: Lyndon Washington Date: Wed, 9 Oct 2013 12:59:47 -0400 Subject: [PATCH] Moved the 1 sec timeout to the export step --- builder/virtualbox/step_export.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/builder/virtualbox/step_export.go b/builder/virtualbox/step_export.go index fd7282c67..a8b60ce50 100644 --- a/builder/virtualbox/step_export.go +++ b/builder/virtualbox/step_export.go @@ -5,6 +5,8 @@ import ( "github.com/mitchellh/multistep" "github.com/mitchellh/packer/packer" "path/filepath" + "log" + "time" ) // This step cleans up forwarded ports and exports the VM to an OVF. @@ -21,6 +23,10 @@ func (s *stepExport) Run(state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packer.Ui) vmName := state.Get("vmName").(string) + // Wait a second to ensure VM is really shutdown. + log.Println("1 second timeout to ensure VM is really shutdown") + time.Sleep(1 * time.Second) + // Clear out the Packer-created forwarding rule ui.Say("Preparing to export machine...") ui.Message(fmt.Sprintf("Deleting forwarded port mapping for SSH (host port %d)", state.Get("sshHostPort")))