From 57d41928a02fb2a1cf6f60b921e747562edd7de9 Mon Sep 17 00:00:00 2001 From: Matt Morrissette Date: Thu, 27 Jun 2019 19:47:11 -0700 Subject: [PATCH] Fixed auto location of vpnkit socket Fixes https://github.com/moby/hyperkit/issues/253 Signed-off-by: Matt Morrissette --- go/hyperkit.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/go/hyperkit.go b/go/hyperkit.go index 83dde528..10263374 100644 --- a/go/hyperkit.go +++ b/go/hyperkit.go @@ -47,7 +47,8 @@ const ( // ConsoleLog configures console to a tty and sends its contents to the logs ConsoleLog - defaultVPNKitSock = "Library/Containers/com.docker.docker/Data/s50" + legacyVPNKitSock = "Library/Containers/com.docker.docker/Data/s50" + defaultVPNKitSock = "Library/Containers/com.docker.docker/Data/vpnkit.eth.sock" defaultCPUs = 1 defaultMemory = 1024 // 1G @@ -591,6 +592,9 @@ func checkHyperKit(hyperkit string) (string, error) { func checkVPNKitSock(vpnkitsock string) (string, error) { if vpnkitsock == "auto" { vpnkitsock = filepath.Join(getHome(), defaultVPNKitSock) + if _, err := os.Stat(vpnkitsock); err != nil { + vpnkitsock = filepath.Join(getHome(), legacyVPNKitSock) + } } if vpnkitsock == "" { return "", nil