From b441348ba4ad50364be33ce73c163d140730d63a Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 8 Jun 2015 20:25:21 -0700 Subject: [PATCH] virtualbox/common: remove devices should delete floppy controller GH-1879 --- builder/virtualbox/common/step_remove_devices.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/builder/virtualbox/common/step_remove_devices.go b/builder/virtualbox/common/step_remove_devices.go index 8f06b1a61..c184c7c4f 100644 --- a/builder/virtualbox/common/step_remove_devices.go +++ b/builder/virtualbox/common/step_remove_devices.go @@ -38,6 +38,19 @@ func (s *StepRemoveDevices) Run(state multistep.StateBag) multistep.StepAction { ui.Error(err.Error()) return multistep.ActionHalt } + + // Don't forget to remove the floppy controller as well + command = []string{ + "storagectl", vmName, + "--name", "Floppy Controller", + "--remove", + } + if err := driver.VBoxManage(command...); err != nil { + err := fmt.Errorf("Error removing floppy controller: %s", err) + state.Put("error", err) + ui.Error(err.Error()) + return multistep.ActionHalt + } } if _, ok := state.GetOk("attachedIso"); ok {