minikube: Minikube fails to start on Windows 10 because it can't select an IP

BUG REPORT

Minikube version v0.12.0

Environment:

  • OS : Windows 10
  • VM Driver : HyperV
  • Docker version: 1.12.1, build 23cf638
  • Install tools:
  • Others:

What happened:

I tried to do minikube start. It said it went fine (except for this but I found a workaround) but then I still could not display the dashboard. minikube ip works and returns an IPv6 address but nothing else.

Here is what minikube logs shows:

C:\>minikube logs
==> /var/lib/localkube/localkube.err <==
I1026 03:08:30.679767    3176 server.go:203] Using iptables Proxier.
W1026 03:08:30.680023    3176 server.go:426] Failed to retrieve node info: Get http://127.0.0.1:8080/api/v1/nodes/minikube: dial tcp 127.0.0.1:8080: getsockopt: connection refused
W1026 03:08:30.680069    3176 proxier.go:226] invalid nodeIP, initialize kube-proxy with 127.0.0.1 as nodeIP
I1026 03:08:30.680085    3176 server.go:215] Tearing down userspace rules.
panic: Unable to select an IP.

goroutine 1 [running]:
panic(0x3053de0, 0xc42078ec70)
        /usr/local/go/src/runtime/panic.go:500 +0x1a1
k8s.io/minikube/cmd/localkube/cmd.SetupServer(0xc4201d68c0)
        /var/lib/jenkins/go2/src/k8s.io/minikube/_gopath/src/k8s.io/minikube/cmd/localkube/cmd/start.go:112 +0x7f0
k8s.io/minikube/cmd/localkube/cmd.StartLocalkube()
        /var/lib/jenkins/go2/src/k8s.io/minikube/_gopath/src/k8s.io/minikube/cmd/localkube/cmd/start.go:48 +0x94
k8s.io/minikube/cmd/localkube/cmd.glob..func1(0x522fc00, 0xc42076cf60, 0x0, 0x3)
        /var/lib/jenkins/go2/src/k8s.io/minikube/_gopath/src/k8s.io/minikube/cmd/localkube/cmd/root.go:31 +0x14
k8s.io/minikube/vendor/github.com/spf13/cobra.(*Command).execute(0x522fc00, 0xc42000c190, 0x3, 0x3, 0x522fc00, 0xc42000c190)
        /var/lib/jenkins/go2/src/k8s.io/minikube/_gopath/src/k8s.io/minikube/vendor/github.com/spf13/cobra/command.go:603 +0x439
k8s.io/minikube/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x522fc00, 0x4, 0x3717be0, 0x2e)
        /var/lib/jenkins/go2/src/k8s.io/minikube/_gopath/src/k8s.io/minikube/vendor/github.com/spf13/cobra/command.go:689 +0x367
k8s.io/minikube/vendor/github.com/spf13/cobra.(*Command).Execute(0x522fc00, 0x0, 0x0)
        /var/lib/jenkins/go2/src/k8s.io/minikube/_gopath/src/k8s.io/minikube/vendor/github.com/spf13/cobra/command.go:648 +0x2b
main.main()
        /var/lib/jenkins/go2/src/k8s.io/minikube/cmd/localkube/main.go:32 +0x5f

==> /var/lib/localkube/localkube.out <==

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 8
  • Comments: 26 (5 by maintainers)

Most upvoted comments

I managed to work around this by using the internet connection sharing feature in Win 10.

  1. Create an Virtual Switch in Hyper-V with the Connect Type set to “Internal network”; I named mine Minikube.
  2. In Network Connections select your actual internet connect (Ethernet for me); right click > Properties.
  3. On the Sharing tab tick “Allow other network users to connect through …” and then select the virtual switch you created in step 1 (“vEthernet (Minikube)” in my case).
  4. Delete any existing Minikube VMs in Hyper-v and delete the .minikube folder in your home folder.
  5. Run (as an administrator) “minikube start --vm-driver=hyperv --hyperv-virtual-switch=Minikube”

This provides an internet connection and DHCP for the minikube VM.

I think there is a race condition. If the VM starts and the first IP address made available is IPv6, then things fail. If the VM starts and the first IP address made available is IPv4, it works. If, in Windows’s Control Panel, you disable IPv6 for the Hyper-V virtual NIC, then it seems to work since you’ll always get a IPv4 address.

This is my guess based on a few attempts.

I’m having the same issue and have disabled ipv6 on all my network adaptors and system wide via the registry and the minikube vm is still getting an ipv6 address. I am stuck, on occasion it gets an ipv4 address and it runs just fine but it’s not reliable

/reopen

This bug just bit me.

@ereOn There is a workaround for this by creating you own Virtual Switch other than DockerNAT and specifiying that virtual switch using the --hyperv-virtual-switch flag.

This step fixed it for me:

On the Sharing tab tick “Allow other network users to connect through …” and then select the virtual switch you created in step 1 (“vEthernet (Minikube)” in my case).

Oddly I need to do this every time I reboot.

@aaron-prindle I can confirm it works with the latest release (v0.12.2) like a charm !

I didn’t even have to specify --hyperv-virtual-switch as it used the right virtual switch right away (by chance ?).

For the record, I used this command in an admin command prompt:

minikube start --cpus 3 --memory 2048 --vm-driver hyperv