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

Minikube fails to start on Windows 10 because it can't select an IP #754

Closed
ereOn opened this issue Oct 26, 2016 · 26 comments
Closed

Minikube fails to start on Windows 10 because it can't select an IP #754

ereOn opened this issue Oct 26, 2016 · 26 comments
Labels
co/hyperv HyperV related issues kind/bug Categorizes issue or PR as related to a bug. os/windows

Comments

@ereOn
Copy link

ereOn commented Oct 26, 2016

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 <==
@RaeesBhatti
Copy link
Contributor

Having same issue with Windows 10 Pro x64 14393.321 and minikube version: v0.11.0

C:\>minikube logs
==> /var/lib/localkube/localkube.err <==
I1026 05:13:43.659658    3029 server.go:203] Using iptables Proxier.
W1026 05:13:43.660053    3029 server.go:417] 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 05:13:43.660756    3029 proxier.go:226] invalid nodeIP, initialize kube-proxy with 127.0.0.1 as nodeIP
I1026 05:13:43.660787    3029 server.go:215] Tearing down userspace rules.
panic: Unable to select an IP.

goroutine 1 [running]:
panic(0x3052920, 0xc420630f30)
        /usr/local/go/src/runtime/panic.go:500 +0x1a1
k8s.io/minikube/cmd/localkube/cmd.SetupServer(0xc420406b40)
        /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(0x522ec00, 0xc420568c60, 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(0x522ec00, 0xc42000c190, 0x3, 0x3, 0x522ec00, 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(0x522ec00, 0x4, 0x3716866, 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(0x522ec00, 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 <==

@r2d4 r2d4 added kind/bug Categorizes issue or PR as related to a bug. os/windows co/hyperv HyperV related issues labels Oct 26, 2016
@aaron-prindle
Copy link
Contributor

Thanks for the detailed report. Can you check that the Hyper V VM has access to the internet? Could you attempt to ping google.com from the VM? Also how is your Hyper V virtual switch configured?

@vamerike
Copy link

neither ping google.com nor ping 8.8.8.8 work
"ping: sendto: Network is unreachable"

@ereOn
Copy link
Author

ereOn commented Oct 28, 2016

@aaron-prindle The VM is using the DockerNAT virtual switch which is "internal" so I guess that's the issue. I have no other virtual switch device defined.

I did not specify anything while creating my minikube VM and I was expecting it to create it's own virtual switch with the appropriate settings. Did I do something wrong or is it some side effect due to the prior presence of Docker For Windows on my machine ?

I tried to add an "external" virtual switch and to recreate the VM but it's still using DockerNAT. If I change it manually in the HyperV console, minikube start completes but I still can't display the Kubernetes dashboard with minikube dashboard.

Let me know if I can do anything to help solve this.

@jebbench
Copy link

jebbench commented Nov 3, 2016

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.

@aaron-prindle
Copy link
Contributor

@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.

@aaron-prindle
Copy link
Contributor

Closing, reopen if you are still having trouble.

@ereOn
Copy link
Author

ereOn commented Nov 10, 2016

@aaron-prindle Great thanks ! I'm gonna try that.

@ereOn
Copy link
Author

ereOn commented Nov 10, 2016

@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

@tomh-faber
Copy link

tomh-faber commented Nov 17, 2016

Still a problem for us:-

Docker Version: 1.12.3
Minikube Version: v0.12.2

==> /var/lib/localkube/localkube.err <==
I1117 15:12:02.827563 3218 server.go:203] Using iptables Proxier.
W1117 15:12:02.827890 3218 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
W1117 15:12:02.827944 3218 proxier.go:226] invalid nodeIP, initialize kube-proxy with 127.0.0.1 as nodeIP
I1117 15:12:02.827960 3218 server.go:215] Tearing down userspace rules.
E1117 15:12:02.841634 3218 reflector.go:203] pkg/proxy/config/api.go:30: Failed to list *api.Service: Get http://127.0.0.1:8080/api/v1/services?resourceVersion=0: dial tcp 127.0.0.1:8080: getsockopt: connection refused
E1117 15:12:02.841681 3218 reflector.go:203] pkg/proxy/config/api.go:33: Failed to list *api.Endpoints: Get http://127.0.0.1:8080/api/v1/endpoints?resourceVersion=0: dial tcp 127.0.0.1:8080: getsockopt: connection refused
2016-11-17 15:12:02.845016 I | etcdserver: name = kubeetcd
2016-11-17 15:12:02.845034 I | etcdserver: data dir = /var/lib/localkube/etcd
2016-11-17 15:12:02.845042 I | etcdserver: member dir = /var/lib/localkube/etcd/member
2016-11-17 15:12:02.845048 I | etcdserver: heartbeat = 100ms
2016-11-17 15:12:02.845052 I | etcdserver: election = 1000ms
2016-11-17 15:12:02.845057 I | etcdserver: snapshot count = 10000
2016-11-17 15:12:02.845069 I | etcdserver: advertise client URLs = http://localhost:2379
2016-11-17 15:12:02.845075 I | etcdserver: initial advertise peer URLs = http://localhost:2380
2016-11-17 15:12:02.845083 I | etcdserver: initial cluster = kubeetcd=http://localhost:2380
2016-11-17 15:12:02.848494 I | etcdserver: starting member 37807cb0bf7500f6 in cluster 2c833ae9c7555b5e
2016-11-17 15:12:02.848529 I | raft: 37807cb0bf7500f6 became follower at term 0
2016-11-17 15:12:02.848537 I | raft: newRaft 37807cb0bf7500f6 [peers: [], term: 0, commit: 0, applied: 0, lastindex: 0, lastterm: 0]
2016-11-17 15:12:02.848541 I | raft: 37807cb0bf7500f6 became follower at term 1
2016-11-17 15:12:02.863922 I | etcdserver: starting server... [version: 3.0.6, cluster version: to_be_decided]
F1117 15:12:02.864469 3218 genericapiserver.go:625] Unable to find suitable network address.error='Unable to select an IP.' . Try to set the AdvertiseAddress directly or provide a valid BindAddress to fix this.

@tomh-faber
Copy link

Tried with latest minikube... still getting this error:-

Docker Version: 1.12.3
Minikube Version: v0.13.0

==> /var/lib/localkube/localkube.err <==
I1205 09:47:31.661377 3208 server.go:203] Using iptables Proxier.
W1205 09:47:31.661719 3208 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
W1205 09:47:31.661799 3208 proxier.go:226] invalid nodeIP, initialize kube-proxy with 127.0.0.1 as nodeIP
I1205 09:47:31.661826 3208 server.go:215] Tearing down userspace rules.
E1205 09:47:31.682940 3208 reflector.go:203] pkg/proxy/config/api.go:30: Failed to list *api.Service: Get http://127.0.0.1:8080/api/v1/services?resourceVersion=0: dial tcp 127.0.0.1:8080: getsockopt: connection refused
E1205 09:47:31.683136 3208 reflector.go:203] pkg/proxy/config/api.go:33: Failed to list *api.Endpoints: Get http://127.0.0.1:8080/api/v1/endpoints?resourceVersion=0: dial tcp 127.0.0.1:8080: getsockopt: connection refused
2016-12-05 09:47:31.686244 I | etcdserver: name = kubeetcd
2016-12-05 09:47:31.686260 I | etcdserver: data dir = /var/lib/localkube/etcd
2016-12-05 09:47:31.686265 I | etcdserver: member dir = /var/lib/localkube/etcd/member
2016-12-05 09:47:31.686268 I | etcdserver: heartbeat = 100ms
2016-12-05 09:47:31.686271 I | etcdserver: election = 1000ms
2016-12-05 09:47:31.686274 I | etcdserver: snapshot count = 10000
2016-12-05 09:47:31.686283 I | etcdserver: advertise client URLs = http://localhost:2379
2016-12-05 09:47:31.686287 I | etcdserver: initial advertise peer URLs = http://localhost:2380
2016-12-05 09:47:31.686294 I | etcdserver: initial cluster = kubeetcd=http://localhost:2380
2016-12-05 09:47:31.705382 I | etcdserver: starting member 37807cb0bf7500f6 in cluster 2c833ae9c7555b5e
2016-12-05 09:47:31.705424 I | raft: 37807cb0bf7500f6 became follower at term 0
2016-12-05 09:47:31.705433 I | raft: newRaft 37807cb0bf7500f6 [peers: [], term: 0, commit: 0, applied: 0, lastindex: 0, lastterm: 0]
2016-12-05 09:47:31.705437 I | raft: 37807cb0bf7500f6 became follower at term 1
2016-12-05 09:47:31.744665 I | etcdserver: starting server... [version: 3.0.12, cluster version: to_be_decided]
F1205 09:47:31.745565 3208 genericapiserver.go:625] Unable to find suitable network address.error='Unable to select an IP.' . Try to set the AdvertiseAddress directly or provide a valid BindAddress to fix this.

@christianhuening
Copy link

I have the same error with Minikube 0.14.0. The strange thing is that it worked yesterday but does not today. Seems to be a bit random...

@VenkateshSrini
Copy link

I tried the exact same steps. I'm using minikube version 0.22.2. I could get the VM started but when I type the command
.\minikube status
I see the cluster is stopped. When I try accessing the same using .\kubectl cluster-info I get an error

Unable to connect to the server: dial tcp 192.168.137.128:8443: connectex: No connection could be made because the targe
t machine actively refused it.

Please help

@briansmith
Copy link

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.

@edhemphill
Copy link

edhemphill commented Dec 20, 2017

I was able to use my existing NAT switch as such:

minikube start --kubernetes-version v1.8.0 --vm-driver="hyperv" --memory 4096 --cpus 2 --disk-size 40g  --hyperv-virtual-switch="NATSwitch" --v=7 --alsologtostderr

and since I happen to have an Ubuntu VM already on this switch, which was using a static IP (no DHCP servers on Hyper-V built-ins. yeap.) I was able to just install isc-dhcp-server there, run it on the main interface, and solved this issue. I run Unbind DNS server on my windows host for all VMs.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 20, 2018
@vecchp
Copy link

vecchp commented Apr 8, 2018

I tried following the directions in the Medium article which disabled the ipv6 stack on each adapter. Sadly minikube still appears to find an ipv6 address when trying to ssh for the first time. The only way I was able to force this to stop was disabling ipv6 support complete through the Windows Registry following these steps: https://techjourney.net/disable-turn-off-ipv6-support-in-windows-10-8-1-8-7-vista/

Hopefully this is remedied in the near future as this a non-ideal situation.

@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten
/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels May 8, 2018
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@chrisxaustin
Copy link

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.

@nyetwurk
Copy link

nyetwurk commented Dec 7, 2018

/remove-lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Dec 7, 2018
@nyetwurk
Copy link

nyetwurk commented Dec 7, 2018

/reopen

This bug just bit me.

@k8s-ci-robot
Copy link
Contributor

@nyetwurk: You can't reopen an issue/PR unless you authored it or you are a collaborator.

In response to this:

/reopen

This bug just bit me.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@scrossan-crown
Copy link

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

@sentinel09
Copy link

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

I just had the same issue after system sleep. Resolved by recreating virtual switch (disabling ipv6 and doing jebbench solution) and minikube machine.

@martinKindall
Copy link

@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

This command worked for me in an admin power shell, windows 10 build 18363.1316

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/hyperv HyperV related issues kind/bug Categorizes issue or PR as related to a bug. os/windows
Projects
None yet
Development

No branches or pull requests