diff --git a/drivers/virtualbox/virtualbox.go b/drivers/virtualbox/virtualbox.go index 9982344c8a..15d89e2615 100644 --- a/drivers/virtualbox/virtualbox.go +++ b/drivers/virtualbox/virtualbox.go @@ -38,6 +38,7 @@ const ( var ( ErrUnableToGenerateRandomIP = errors.New("unable to generate random IP") ErrMustEnableVTX = errors.New("This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory") + ErrNotCompatibleWithHyperV = errors.New("This computer has Hyper-V installed. VirtualBox refuses to boot a 64bits VM when Hyper-V is installed. See https://www.virtualbox.org/ticket/12350") ErrNetworkAddrCidr = errors.New("host-only cidr must be specified with a host address, not a network address") ) @@ -213,6 +214,9 @@ func (d *Driver) PreCreateCheck() error { } if !d.NoVTXCheck && d.IsVTXDisabled() { + if isHyperVInstalled() { + return ErrNotCompatibleWithHyperV + } return ErrMustEnableVTX } diff --git a/drivers/virtualbox/virtualbox_darwin.go b/drivers/virtualbox/virtualbox_darwin.go index 2c411dd3af..6c100e1635 100644 --- a/drivers/virtualbox/virtualbox_darwin.go +++ b/drivers/virtualbox/virtualbox_darwin.go @@ -29,3 +29,7 @@ func detectVBoxManageCmd() string { func getShareDriveAndName() (string, string) { return "Users", "/Users" } + +func isHyperVInstalled() bool { + return false +} diff --git a/drivers/virtualbox/virtualbox_linux.go b/drivers/virtualbox/virtualbox_linux.go index eb2e89449f..0631ed5123 100644 --- a/drivers/virtualbox/virtualbox_linux.go +++ b/drivers/virtualbox/virtualbox_linux.go @@ -39,3 +39,7 @@ func detectVBoxManageCmd() string { func getShareDriveAndName() (string, string) { return "hosthome", "/home" } + +func isHyperVInstalled() bool { + return false +} diff --git a/drivers/virtualbox/virtualbox_windows.go b/drivers/virtualbox/virtualbox_windows.go index 3cb395d235..493cde46f2 100644 --- a/drivers/virtualbox/virtualbox_windows.go +++ b/drivers/virtualbox/virtualbox_windows.go @@ -93,3 +93,8 @@ func findVBoxInstallDirInRegistry() (string, error) { func getShareDriveAndName() (string, string) { return "c/Users", "c:\\Users" } + +func isHyperVInstalled() bool { + _, err := exec.LookPath("vmms.exe") + return err == nil +}