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

fix Error getting VM/Host IP address on clean install #8083

Closed
wants to merge 2 commits into from
Closed
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
8 changes: 5 additions & 3 deletions pkg/minikube/cluster/ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,13 @@ func HostIP(host *host.Host) (net.IP, error) {
}
re := regexp.MustCompile(`hostonlyadapter2="(.*?)"`)
iface := re.FindStringSubmatch(string(out))[1]
ip, err := getIPForInterface(iface)
if err != nil {
ipOut, ipErr := exec.Command(driver.VBoxManagePath(), "list", "hostonlyifs").Output()
if ipErr != nil {
return []byte{}, errors.Wrap(err, "Error getting VM/Host IP address")
}
return ip, nil
ipRe := regexp.MustCompile(`(?s)Name:\s*` + iface + `.+?IPAddress:\s*(\S+)`)
ip := ipRe.FindStringSubmatch(string(ipOut))[1]
return net.ParseIP(ip), nil
case driver.HyperKit:
return net.ParseIP("192.168.64.1"), nil
case driver.VMware:
Expand Down