From b95cf8069993e3819d6cd7fbafb57d62702a75f9 Mon Sep 17 00:00:00 2001 From: Guillaume Rose Date: Fri, 23 Mar 2018 12:06:30 +0100 Subject: [PATCH 1/2] Change default Hyperkit files location when using Docker for Mac Signed-off-by: Guillaume Rose --- pkg/vsock/hyperkit_darwin.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/vsock/hyperkit_darwin.go b/pkg/vsock/hyperkit_darwin.go index 48ad084..376498d 100644 --- a/pkg/vsock/hyperkit_darwin.go +++ b/pkg/vsock/hyperkit_darwin.go @@ -35,7 +35,7 @@ func SocketMode(socketMode string) { if strings.HasPrefix(socketMode, "hyperkit:") { socketPath = socketMode[len("hyperkit:"):] } else if socketMode == "docker" { - socketPath = filepath.Join(os.Getenv("HOME"), "/Library/Containers/com.docker.docker/Data") + socketPath = filepath.Join(os.Getenv("HOME"), "/Library/Containers/com.docker.docker/Data/vms/0") } else { log.Fatalln("Unknown socket mode: ", socketMode) } From fa1a5e35648ace24403149db1682c31e651a206c Mon Sep 17 00:00:00 2001 From: Guillaume Rose Date: Fri, 23 Mar 2018 12:07:54 +0100 Subject: [PATCH 2/2] connectPath was set before socketPath. Signed-off-by: Guillaume Rose --- pkg/vsock/hyperkit_darwin.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/vsock/hyperkit_darwin.go b/pkg/vsock/hyperkit_darwin.go index 376498d..02eeb90 100644 --- a/pkg/vsock/hyperkit_darwin.go +++ b/pkg/vsock/hyperkit_darwin.go @@ -29,7 +29,6 @@ var ( // ("hyperkit:/path") or Docker for Mac mode ("docker"). This function // must be called before using the vsock bindings. func SocketMode(socketMode string) { - connectPath = filepath.Join(socketPath, "connect") socketFmt = "%08x.%08x" if strings.HasPrefix(socketMode, "hyperkit:") { @@ -39,6 +38,8 @@ func SocketMode(socketMode string) { } else { log.Fatalln("Unknown socket mode: ", socketMode) } + + connectPath = filepath.Join(socketPath, "connect") } // Dial creates a connection to the VM with the given client ID and port