mirror of https://github.com/docker/docs.git
Detect VBox/HyperV incompatibility
Signed-off-by: David Gageot <david@gageot.net>
This commit is contained in:
parent
3988b5fabf
commit
c36a2711af
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,3 +29,7 @@ func detectVBoxManageCmd() string {
|
|||
func getShareDriveAndName() (string, string) {
|
||||
return "Users", "/Users"
|
||||
}
|
||||
|
||||
func isHyperVInstalled() bool {
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,3 +39,7 @@ func detectVBoxManageCmd() string {
|
|||
func getShareDriveAndName() (string, string) {
|
||||
return "hosthome", "/home"
|
||||
}
|
||||
|
||||
func isHyperVInstalled() bool {
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue