From d5ff6b21eafec9a56209cc9196dfe2b8c43d8593 Mon Sep 17 00:00:00 2001 From: Jason Hoos Date: Sun, 4 Oct 2015 18:15:28 -0500 Subject: [PATCH] Explicitly set umask before invoking vmrun in vmwarefusion For some reason, invoking vmrun with the nogui option doesn't work right if umask is set to not allow world-readable permissions by default. This seems to be true at least in VMware Fusion 7.0.x through 8.0.1. As a workaround, the driver now explicitly sets the umask to 022 before invoking vmrun. Signed-off-by: Jason Hoos --- drivers/vmwarefusion/vmrun.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/vmwarefusion/vmrun.go b/drivers/vmwarefusion/vmrun.go index 67ad7b90a1..3039ea177c 100644 --- a/drivers/vmwarefusion/vmrun.go +++ b/drivers/vmwarefusion/vmrun.go @@ -12,6 +12,7 @@ import ( "os/exec" "path/filepath" "strings" + "syscall" "github.com/docker/machine/libmachine/log" ) @@ -36,6 +37,9 @@ func setVmwareCmd(cmd string) string { } func vmrun(args ...string) (string, string, error) { + // vmrun with nogui on VMware Fusion through at least 8.0.1 doesn't work right + // if the umask is set to not allow world-readable permissions + _ = syscall.Umask(022) cmd := exec.Command(vmrunbin, args...) if os.Getenv("MACHINE_DEBUG") != "" { cmd.Stdout = os.Stdout