|
|
|
|
@ -56,6 +56,7 @@ func (s *StepAttachGuestAdditions) Run(state multistep.StateBag) multistep.StepA
|
|
|
|
|
|
|
|
|
|
// Track the path so that we can unregister it from VirtualBox later
|
|
|
|
|
s.attachedPath = guestAdditionsPath
|
|
|
|
|
state.Put("guest_additions_attached", true)
|
|
|
|
|
|
|
|
|
|
return multistep.ActionContinue
|
|
|
|
|
}
|
|
|
|
|
@ -66,7 +67,6 @@ func (s *StepAttachGuestAdditions) Cleanup(state multistep.StateBag) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
driver := state.Get("driver").(Driver)
|
|
|
|
|
ui := state.Get("ui").(packer.Ui)
|
|
|
|
|
vmName := state.Get("vmName").(string)
|
|
|
|
|
|
|
|
|
|
command := []string{
|
|
|
|
|
@ -77,7 +77,7 @@ func (s *StepAttachGuestAdditions) Cleanup(state multistep.StateBag) {
|
|
|
|
|
"--medium", "none",
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if err := driver.VBoxManage(command...); err != nil {
|
|
|
|
|
ui.Error(fmt.Sprintf("Error unregistering guest additions: %s", err))
|
|
|
|
|
}
|
|
|
|
|
// Remove the ISO. Note that this will probably fail since
|
|
|
|
|
// stepRemoveDevices does this as well. No big deal.
|
|
|
|
|
driver.VBoxManage(command...)
|
|
|
|
|
}
|
|
|
|
|
|