diff --git a/builder/vmware/common/step_register.go b/builder/vmware/common/step_register.go index b995828b1..76de180f4 100644 --- a/builder/vmware/common/step_register.go +++ b/builder/vmware/common/step_register.go @@ -54,7 +54,7 @@ func (s *StepRegister) Cleanup(state multistep.StateBag) { } if remoteDriver, ok := driver.(RemoteDriver); ok { - if s.SkipExport { + if s.SkipExport && !cancelled && !halted { ui.Say("Unregistering virtual machine...") if err := remoteDriver.Unregister(s.registeredPath); err != nil { ui.Error(fmt.Sprintf("Error unregistering VM: %s", err))