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

error getting ssh client: No connection could be made because the target machine actively refused it. #2866

Closed
pmaheshgupta opened this issue Jun 4, 2018 · 16 comments
Labels
area/networking networking issues cause/firewall-or-proxy When firewalls or proxies seem to be interfering co/hyperv HyperV related issues co/sshd ssh related issues failed/local-networking startup failures due to networking issues lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. os/windows

Comments

@pmaheshgupta
Copy link

I am trying to set up minikube on windows10 pro 64bit and hyper-v

Downloaded minikube from here.

later trying to start using the following command

minikube start --vm-driver hyperv --hyperv-virtual-switch "vSwitchKubernetes"

vSwitchKubernetes is an external vswitch created in hyper v.

I am unable to connect to minikube and getting the following errors

minikube : E0601 15:41:56.250187   13560 start.go:159] Error starting host: Error creating host: Error executing step: Provisioning VM.
At line:1 char:1
+ minikube start --vm-driver hyperv --hyperv-virtual-switch "vSwitchKub ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (E0601 15:41:56....rovisioning VM.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
: Temporary Error: provisioning: error getting ssh client: Error dialing tcp via ssh client: dial tcp 172.16.49.99:22: connectex: No connection could be made 
because the target machine actively refused it.
Temporary Error: provisioning: error getting ssh client: Error dialing tcp via ssh client: dial tcp 172.16.49.99:22: connectex: No connection could be made 
because the target machine actively refused it.
Temporary Error: provisioning: error getting ssh client: Error dialing tcp via ssh client: dial tcp 172.16.49.99:22: connectex: No connection could be made 
because the target machine actively refused it.
Temporary Error: provisioning: error getting ssh client: Error dialing tcp via ssh client: dial tcp 172.16.49.99:22: connectex: No connection could be made 
because the target machine actively refused it.
Temporary Error: provisioning: error getting ssh client: Error dialing tcp via ssh client: dial tcp 172.16.49.99:22: connectex: No connection could be made 
because the target machine actively refused it..
 Retrying.
E0601 15:41:58.120926   13560 start.go:165] Error starting host:  Error creating host: Error executing step: Provisioning VM.
: Temporary Error: provisioning: error getting ssh client: Error dialing tcp via ssh client: dial tcp 172.16.49.99:22: connectex: No connection could be made 
because the target machine actively refused it.
Temporary Error: provisioning: error getting ssh client: Error dialing tcp via ssh client: dial tcp 172.16.49.99:22: connectex: No connection could be made 
because the target machine actively refused it.
Temporary Error: provisioning: error getting ssh client: Error dialing tcp via ssh client: dial tcp 172.16.49.99:22: connectex: No connection could be made 
because the target machine actively refused it.
Temporary Error: provisioning: error getting ssh client: Error dialing tcp via ssh client: dial tcp 172.16.49.99:22: connectex: No connection could be made 
because the target machine actively refused it.
Temporary Error: provisioning: error getting ssh client: Error dialing tcp via ssh client: dial tcp 172.16.49.99:22: connectex: No connection could be made 
because the target machine actively refused it. 
 

Tried different options like deleting minikube and starting again, disabling ipv6 etc..
VT support in bios is enabled.

Any suggestions on how to make it work would be greatly helpful.

Thanks..

@dlorenc
Copy link
Contributor

dlorenc commented Jun 4, 2018

Are you running some kind of firewall?

@pmaheshgupta
Copy link
Author

I have firewall enabled in my local. But I have 2 more VM's on hyper-v running with windows server image..
I was able to connect to internet in them.

@suineglive13
Copy link

suineglive13 commented Jun 10, 2018

I have exactly the same issue on Win 10 Enterprise build 1709 and the latest minikube(0.27).
I've tried to reinstall minikube several times using different ways: minikube-install, chocolatey etc. Also I've tried it with win 10 openssh(with it the error differs).
I've found some advices to play around with hyperv VM settings, such as RAM and NIC parameters and when I tried'em I just got another errors. So reverted all values to default but still get "refused" at 22 port

@pmaheshgupta
Copy link
Author

pmaheshgupta commented Jun 12, 2018

after taking the help of admin dept found that I am getting same ip address for both host machine and minikube VM, they said that might be the issue and minikube doesnt have wifi resolving capability.

So tried with LAN, surprisingly it worked.
Now I get different IP address for host and VM.

@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 Sep 10, 2018
@tstromberg tstromberg changed the title Cant connect to minikube on windows10 -- No connection could be made because the target machine actively refused it.. connectex: No connection could be made because the target machine actively refused it. Sep 19, 2018
@tstromberg tstromberg added co/hyperv HyperV related issues area/networking networking issues labels Sep 19, 2018
@tstromberg tstromberg changed the title connectex: No connection could be made because the target machine actively refused it. error getting ssh client: No connection could be made because the target machine actively refused it. Sep 19, 2018
@tstromberg tstromberg added failed/local-networking startup failures due to networking issues co/sshd ssh related issues labels Sep 19, 2018
@tstromberg tstromberg changed the title error getting ssh client: No connection could be made because the target machine actively refused it. error getting ssh client: No connection could be made because the target machine actively refused it. (wifi) Sep 19, 2018
@tstromberg
Copy link
Contributor

There are indeed some quirks around getting hyperv to a virtual switch on a wifi adapter: https://giritharan.com/configure-hyper-v-to-use-the-wireless-in-a-windows-10-computer/

@tstromberg tstromberg changed the title error getting ssh client: No connection could be made because the target machine actively refused it. (wifi) hyperv: error getting ssh client: No connection could be made (virtual switch on wifi adapter) Sep 19, 2018
@gbraad
Copy link
Contributor

gbraad commented Sep 19, 2018

@tstromberg Wireless does not have to be the problem. We are using this to great success with Minishift... so it is likely a different problem. (Note: especially as you refer to using a doc that uses an internal switch instead and NAT, which leads to other issues that need to be solved if using with Minikube as you can not do a static IP).

Active refused most likely means it got blocked... and this can be local system policies if in a corporate environment, but also an application firewall (like antivirus).

@tstromberg tstromberg changed the title hyperv: error getting ssh client: No connection could be made (virtual switch on wifi adapter) error getting ssh client: No connection could be made because the target machine actively refused it. Sep 20, 2018
@tstromberg tstromberg added os/windows cause/firewall-or-proxy When firewalls or proxies seem to be interfering labels Sep 20, 2018
@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

@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 Oct 20, 2018
@francisapel
Copy link

Same issue as everyone else. Has anyone found a resolution?

@gerryg80
Copy link

I got this same error. I have a surface tablet / wifi all the time. I have an Ubuntu 18.04 server running in Hyper-V that I can access from other machines on my network so there's no general Hyper-V issue with wifi.

First time trying minikube I got "connection actively refused" and it was trying 192.168.1.16. I suspected IP address conflict so I shutdown the minikube VM and 192.168.1.16 was still responding to pings. 192.168.1.16 was actually the IP assigned to my surface / the Hyper-V host. I started back up the minikube vm and used connect in the Hyper-V admin and confirmed the VM was also attempting to run on 192.168.1.16. So the "connection actively refused" was probably coming from my Surface itself.

A little snooping in the file system and I found this file:

C:\Users\gerry.minikube\machines\minikube\config.json

With this content near the top:

{
"ConfigVersion": 3,
"Driver": {
"IPAddress": "",

All I had to do was add an IP address here that is within my network but outside my dhcp range so there's no chance of conflict. I used 192.168.1.102.

That solved it for me at least -- minikube started with no issues after that.

@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

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

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

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.

@epgeroy
Copy link

epgeroy commented Jan 6, 2019

Restarting the vEthernet "Switch" will make that DHCP assigns a new IP address and it won't be same. This worked for me.

@cloudmustafa
Copy link

Any resolution of this? I keep getting Error dialing TCP: dial tcp 192.168.34.60:22: connectex: No connection could be made because the target machine actively refused it. I am starting the Minikube with the Hyper-v virtual switch on Windows 10

@Diggsey
Copy link

Diggsey commented Mar 5, 2020

I believe this happens with the OOM killer runs. Because the kubernetes supervisor gets killed it doesn't restart, and often the SSH daemon is killed too.

@dayyehm
Copy link

dayyehm commented Jun 12, 2020

After switching to my wireless connection which is active ,I was connected to VPN and once I disconnected ( I stopped getting forbidden tcp socket messages and the error dialing TCP, of course I disabled ipv6)

[stderr =====>] :
[executing ==>] : C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive (( Hyper-V\Get-VM minikube ).networkadapters[0]).ipaddresses[0]
[stdout =====>] : 192.168.0.103

[stderr =====>] :
[executing ==>] : C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive ( Hyper-V\Get-VM minikube ).state
[stdout =====>] : Running

[stderr =====>] :
[executing ==>] : C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive (( Hyper-V\Get-VM minikube ).networkadapters[0]).ipaddresses[0]
[stdout =====>] : 192.168.0.103

[stderr =====>] :
Moving files into cluster...
I0612 22:33:25.637011 51884 kubeadm.go:220] Container runtime flag provided with no value, using defaults.
Downloading kubelet v1.10.2
Downloading kubeadm v1.10.2

10000 years later ....

I0612 22:36:33.979541 51884 kubernetes.go:119] error getting Pods with label selector "k8s-app=kube-proxy" [Get https://192.168.0.103:8443/api/v1/namespaces/kube-system/pods?labelSelector=k8s-app%3Dkube-proxy: dial tcp 192.168.0.103:8443: connectex: No connection could be made because the target machine actively refused it.]
I0612 22:36:34.471537 51884 round_trippers.go:383] GET https://192.168.0.103:8443/api/v1/namespaces/kube-system/pods?labelSelector=k8s-app%3Dkube-proxy
I0612 22:36:34.471537 51884 round_trippers.go:390] Request Headers:
I0612 22:36:34.476541 51884 round_trippers.go:393] Accept: application/json, /
I0612 22:36:34.477541 51884 round_trippers.go:393] User-Agent: minikube.exe/v0.0.0 (windows/amd64) kubernetes/$Format
I0612 22:36:44.479691 51884 round_trippers.go:408] Response Status: in 10002 milliseconds
I0612 22:36:44.479691 51884 kubernetes.go:119] error getting Pods with label selector "k8s-app=kube-proxy" [Get https://192.168.0.103:8443/api/v1/namespaces/kube-system/pods?labelSelector=k8s-app%3Dkube-proxy: net/http: TLS handshake timeout]
I0612 22:36:44.972693 51884 round_trippers.go:383] GET https://192.168.0.103:8443/api/v1/namespaces/kube-system/pods?labelSelector=k8s-app%3Dkube-proxy
I0612 22:36:44.972693 51884 round_trippers.go:390] Request Headers:
I0612 22:36:44.974701 51884 round_trippers.go:393] Accept: application/json, /
I0612 22:36:44.976703 51884 round_trippers.go:393] User-Agent: minikube.exe/v0.0.0 (windows/amd64) kubernetes/$Format
I0612 22:36:54.979435 51884 round_trippers.go:408] Response Status: in 10002 milliseconds
I0612 22:36:54.979435 51884 kubernetes.go:119] error getting Pods with label selector "k8s-app=kube-proxy" [Get https://192.168.0.103:8443/api/v1/namespaces/kube-system/pods?labelSelector=k8s-app%3Dkube-proxy: net/http: TLS handshake timeout]
I0612 22:36:55.488804 51884 round_trippers.go:383] GET https://192.168.0.103:8443/api/v1/namespaces/kube-system/pods?labelSelector=k8s-app%3Dkube-proxy
I0612 22:36:55.506804 51884 round_trippers.go:390] Request Headers:
I0612 22:36:55.508801 51884 round_trippers.go:393] Accept: application/json, /
I0612 22:36:55.540803 51884 round_trippers.go:393] User-Agent: minikube.exe/v0.0.0 (windows/amd64) kubernetes/$For

I0612 22:37:05.570090 51884 round_trippers.go:408] Response Status: in 10017 milliseconds
I0612 22:37:05.571092 51884 kubernetes.go:119] error getting Pods with label selector "k8s-app=kube-proxy" [Get https://192.168.0.103:8443/api/v1/namespaces/kube-system/pods?labelSelector=k8s-app%3Dkube-proxy: net/http: TLS handshake timeout]
I0612 22:37:05.971738 51884 round_trippers.go:383] GET https://192.168.0.103:8443/api/v1/namespaces/kube-system/pods?labelSelector=k8s-app%3Dkube-proxy
I0612 22:37:05.971738 51884 round_trippers.go:390] Request Headers:
I0612 22:37:05.974740 51884 round_trippers.go:393] Accept: application/json, /
I0612 22:37:05.980738 51884 round_trippers.go:393] User-Agent: minikube.exe/v0.0.0 (windows/amd64) kubernetes/$Format
I0612 22:37:15.998155 51884 round_trippers.go:408] Response Status: in 10012 milliseconds
I0612 22:37:15.999154 51884 kubernetes.go:119] error getting Pods with label selector "k8s-app=kube-proxy" [Get https://192.168.0.103:8443/api/v1/namespaces/kube-system/pods?labelSelector=k8s-app%3Dkube-proxy: net/http: TLS handshake timeout]
I0612 22:37:16.473166 51884 round_trippers.go:383] GET https://192.168.0.103:8443/api/v1/namespaces/kube-system/pods?labelSelector=k8s-app%3Dkube-proxy
I0612 22:37:16.473166 51884 round_trippers.go:390] Request Headers:
I0612 22:37:16.474153 51884 round_trippers.go:393] Accept: application/json, /
I0612 22:37:16.476157 51884 round_trippers.go:393] User-Agent: minikube.exe/v0.0.0 (windows/amd64) kubernetes/$For

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/networking networking issues cause/firewall-or-proxy When firewalls or proxies seem to be interfering co/hyperv HyperV related issues co/sshd ssh related issues failed/local-networking startup failures due to networking issues lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. os/windows
Projects
None yet
Development

No branches or pull requests