mirror of https://github.com/docker/docs.git
				
				
				
			Merge pull request #2695 from dgageot/hyperv-vbox-incompatibility
Detect VBox/HyperV incompatibility
This commit is contained in:
		
						commit
						01cc4af89e
					
				|  | @ -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