diff --git a/drivers/virtualbox/virtualbox.go b/drivers/virtualbox/virtualbox.go index dd3ac42389..a47c457098 100644 --- a/drivers/virtualbox/virtualbox.go +++ b/drivers/virtualbox/virtualbox.go @@ -184,7 +184,19 @@ func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error { // PreCreateCheck checks that VBoxManage exists and works func (d *Driver) PreCreateCheck() error { // Check that VBoxManage exists and works - return d.vbm() + if err := d.vbm(); err != nil { + return err + } + + if d.IsVTXDisabled() { + // Let's log a warning to warn the user. When the vm is started, logs + // will be checked for an error anyway. + // We could fail right here but the method to check didn't prove being + // bulletproof. + log.Warn("This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory.") + } + + return nil } // IsVTXDisabledInTheVM checks if VT-X is disabled in the started vm. @@ -218,14 +230,6 @@ func (d *Driver) Create() error { return err } - if d.IsVTXDisabled() { - // Let's log a warning to warn the user. When the vm is started, logs - // will be checked for an error anyway. - // We could fail right here but the method to check didn't prove being - // bulletproof. - log.Warn("This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory.") - } - log.Infof("Creating VirtualBox VM...") // import b2d VM if requested