diff --git a/pkg/minikube/cluster/ip.go b/pkg/minikube/cluster/ip.go index 5b5c7c22c4d7..5042494984d2 100644 --- a/pkg/minikube/cluster/ip.go +++ b/pkg/minikube/cluster/ip.go @@ -67,8 +67,12 @@ func HostIP(host *host.Host, clusterName string) (net.IP, error) { // user network case return net.ParseIP("10.0.2.2"), nil } - // "socket_vmnet" and "vmnet-*" network case - return net.ParseIP(ipString), nil + // "socket_vmnet" and "vmnet-*" network case: host ip should be start address of subnet + vmIP := net.ParseIP(ipString).To4() + if vmIP == nil { + return []byte{}, errors.Wrap(err, "Error converting VM IP address to IPv4 address") + } + return net.IPv4(vmIP[0], vmIP[1], vmIP[2], byte(1)), nil case driver.HyperV: v := reflect.ValueOf(host.Driver).Elem() var hypervVirtualSwitch string