Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default location of Hyperkit, fix connectPath value #61

Merged
merged 2 commits into from
Mar 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pkg/vsock/hyperkit_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,17 @@ 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:") {
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)
}

connectPath = filepath.Join(socketPath, "connect")
}

// Dial creates a connection to the VM with the given client ID and port
Expand Down