builder/virtualbox: sleep when stopping forcefully to allow session

unlock
This commit is contained in:
Mitchell Hashimoto 2013-12-19 08:49:23 -08:00
parent dcae79e67f
commit 3c5c9a6ea3
3 changed files with 7 additions and 3 deletions

View File

@ -33,6 +33,7 @@ IMPROVEMENTS:
[GH-687]
* builder/virtualbox: Nice errors if Packer can't write to
the output directory.
* builder/virtualbox: ISO is ejected prior to export.
* provisioner/puppet-masterless: Can now specify a `manifest_dir` to
upload manifests to the remote machine for imports. [GH-655]

View File

@ -106,6 +106,9 @@ func (d *VBox42Driver) Stop(name string) error {
return err
}
// We sleep here for a little bit to let the session "unlock"
time.Sleep(2 * time.Second)
return nil
}

View File

@ -60,7 +60,7 @@ func (s *stepAttachISO) Cleanup(state multistep.StateBag) {
"--medium", "none",
}
if err := driver.VBoxManage(command...); err != nil {
ui.Error(fmt.Sprintf("Error unregistering ISO: %s", err))
}
// Remove the ISO. Note that this will probably fail since
// stepRemoveDevices does this as well. No big deal.
driver.VBoxManage(command...)
}