From 42f1dbb9643dd681a1de9c58b49c2dc1056a450e Mon Sep 17 00:00:00 2001 From: Emmanuel Bretelle Date: Tue, 27 Oct 2015 22:13:30 -0700 Subject: [PATCH] virtualbox: support linux host Fixes #2110 Signed-off-by: Emmanuel Bretelle --- drivers/virtualbox/virtualbox.go | 4 +++- drivers/virtualbox/virtualbox_linux.go | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/virtualbox/virtualbox.go b/drivers/virtualbox/virtualbox.go index 50f372e192..2eb59d9432 100644 --- a/drivers/virtualbox/virtualbox.go +++ b/drivers/virtualbox/virtualbox.go @@ -376,7 +376,9 @@ func (d *Driver) Create() error { case "darwin": shareName = "Users" shareDir = "/Users" - // TODO "linux" + case "linux": + shareName = "hosthome" + shareDir = "/home" } if shareDir != "" && !d.NoShare { diff --git a/drivers/virtualbox/virtualbox_linux.go b/drivers/virtualbox/virtualbox_linux.go index f5892d6fb4..55aeeef760 100644 --- a/drivers/virtualbox/virtualbox_linux.go +++ b/drivers/virtualbox/virtualbox_linux.go @@ -1,7 +1,21 @@ package virtualbox +import ( + "strings" + + "github.com/docker/machine/libmachine/log" +) + // IsVTXDisabled checks if VT-X is disabled in the BIOS. If it is, the vm will fail to start. // If we can't be sure it is disabled, we carry on and will check the vm logs after it's started. func (d *Driver) IsVTXDisabled() bool { - return false + errmsg := "Couldn't check that VT-X/AMD-v is enabled. Will check that the vm is properly created: %v" + output, err := cmdOutput("grep", "vmx", "/proc/cpuinfo") + if err != nil { + log.Debugf(errmsg, err) + return false + } + + disabled := !strings.Contains(output, "vmx") + return disabled }