Starting minikube on Windows 7 fails to start with - Error getting state for host: machine does not exist - windows

Have been trying to setup Kubernetes for local development on my Windows 7 machine with a VirtualBox VM Driver. Installing and running minikube fails each time with the below error:
D:\minikube>minikube start --vm-driver=virtualbox
Starting local Kubernetes v1.9.0 cluster...
Starting VM...
E0219 09:47:24.441727 4220 start.go:159] Error starting host: Error getting state for host: machine does not exist.
Retrying.
E0219 09:47:24.448727 4220 start.go:165] Error starting host: Error getting state for host: machine does not exist
E0219 09:47:54.448727 4220 util.go:151] Error uploading error message: :
Post https://clouderrorreporting.googleapis.com/v1beta1/projects/k8s-minikube/events:report?key=AIzaSyACUwzG0dEPcl-eOgpDKnyKoUFgHdfoFuA: dial tcp 172.217.25.138:443: i/o timeout
I suspected this may be happening due to minikube cache downloading at a network drive folder (N:) due to enterprise configurations in my laptop, however, copying the .minikube folder from N:\.minikube to C:\Users\abc123\.minikube has not abated the problem.
Do let me know if someone has managed to solve it.

I ran into the same error on osx after re-installing minikube. Simply deleting the minikube VM and restarting fixed everything:
$ minikube delete
$ minikube start

Go to C:\Users\\
Delete the .minikube folder
Start minikube (minikube.exe start --kubernetes-version="v1.10.0" --vm-driver="virtualbox")

Try using powershell/cygwin instead of cmd.
Also delete .minikube folder
do minikube delete
then minikube start

In certain scenarios, it may be an issue with your VM driver. If you don't specify one, it may default to VirtualBox. But if you have HyperV instead (due to installing docker on windows, for example) then it won't start. You may have to start it like so:
minikube start --vm-driver hyperv
Or whatever is appropriate.

Related

Unable to create new docker instances with docker-machine

I am using AWS with docker-machine to create and provision my instances. I would use this command to create a new instance:
docker-machine create --driver amazonec2 --amazonec2-instance-type "t2.micro" --amazonec2-security-group zhxw-production-sg zhxw-production-3
About a month ago, that worked fine. I just went to create a fresh machine, and I can no longer connect to it. When I run the above command, it gets stuck on "waiting for SSH to be available..."
Running pre-create checks...
Creating machine...
(zhxw-production-3) Launching instance...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
It just hangs at that point. If I cancel the command, and check the AWS EC2 console, it suggests that it's running:
When I run docker-machine ls, it also suggests that it's running, but with errors:
$-> docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
zhxw-production-2 - amazonec2 Running tcp://3.86.xxx.xxx:2376 v19.03.12
zhxw-production-3 - amazonec2 Running tcp://54.167.xxx.xxx:2376 Unknown Unable to query docker version: Cannot connect to the docker engine endpoint
I'm able to connect to the zhxw-production-2 machine (which has been running for a month). Just not the new one zhxw-production-3 one I just launched.
$-> docker-machine env zhxw-production-3
Error checking TLS connection: Error checking and/or regenerating the certs: There was an error validating certificates for host "54.167.123.108:2376": dial tcp 54.167.123.108:2376: connect: connection refused
You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'.
Be advised that this will trigger a Docker daemon restart which might stop running containers.
The regenerate-certs command doesn't help either. I'm not really sure where to start debugging, because as far as I can tell, the docker-machine create command is the very beginning.
Turned out to be a problem with SSH to my AWS environment. I had my public IP address whitelisted, but it had changed.
I came across a problem like this and I found out that the AWS EC2 AMI did not have SSH installed, so I had to use different AMI, eg. Ubuntu.
I went through the same problem recently and found that the cause was the public ip change when I enabled elastic ip on the machine. I don't know if this is your case. Maybe my solution will help you or help others. He follows:
usually the file path is: /User/<name_your_user>/.docker/machine/<name_machine_ploblem>
edit parameter value: "IPAdress"
After making the change, run the command: docker-machine regenerate-certs <name_instance_ec2>
With these procedures, my problem was solved. I hope it helps! hug to everyone.

Kubernetes connection error in Mac

OS : OSX (mac)
Docker : 18.06.0-ce (edge)
Kubernetes : 1.10.3
I use Kubernetes for the first time.
I tried Google but could not find the manual for Kubernetes, which operates on the Mac.
Running kubectl version outputs The connection to the
server localhost:8080 was refused - did you specify the right host or port?
I came across this issue when changing from minikube to the Docker Desktop supplied Kubernetes. For me, the issue was caused by a stale .kube configuration. Posting my workaround here as this was the first result I found on google when looking to troubleshoot the issue.
1. Uninstall Minikube
I had originally installed with homebrew: brew uninstall minikube. If installed using other methods, go back to your install source for uninstall info.
After minikube was uninstalled, I restarted my machine which may or may not have been necessary but it is what I did.
2. Disable Kubernetes in docker Desktop
Open Docker Desktop preferences, click Kubernetes menu
De-select 'Enable Kubernetes' checkbox. Click Apply & Restart
3. Remove old kube and minikube config
Open terminal to your home directory.
Check for settings directories: ls -al and look for .kube and .minikube.
Remove .kube settings: rm -rf ./.kube.
Remove .minikube settings: rm -rf ./.minikube.
Confirm: ls -al and make sure the .kube and .minikube directories have been deleted.
If everything looks good, close terminal.
4. Re-enable Kubernetes in Docker Desktop
Open Docker Desktop preferences, click Kubernetes menu
Select 'Enable Kubernetes' checkbox. Click Apply & Restart
Open new terminal window and run kubectl version. You should see info for Client Version and Server Version if everything worked.
When you run kubectl, the .kube/config file is read in your home directory, thus telling which cluster you want to connect to using --context=<cluster-name>
What your error output is telling you is that it is unable to find a listening kubernetes API endpoint upon which to run those commands. It is looking for a cluster at localhost:8080
This endpoint will vary depending on how and where you installed Kubernetes. How are you running Kubernetes?
Are you using the bundled Docker/Kubernetes for Mac as mentioned here? - Docker for Mac Kubernetes or are you using a tool like MiniKube? - MiniKube
You might notice this error The connection to the server localhost:8080 was refused - did you specify the right host or port? because of your local minikube server might be down.
You have to start the existing minikube instance using - minikube start (I'm assuming your local minikube configured with docker driver earlier like: minikube start --driver=docker)
If not working above step then you have to delete the existing minikube then start it again:
minikube delete
minikube start --driver=docker
I had faced the same issue and my user id did not had the admin privileges, once the chown is done, Kubernetes started working.Hope this helps

"minikube start" failed on mac

When I attempt to run minikube on locally, I got this error:
minikube start
Starting local Kubernetes v1.8.0 cluster...
Starting VM...
Getting VM IP address...
Moving files into cluster...
E1229 09:52:55.432296 8935 start.go:223] Error updating cluster: Error updating localkube from uri: Error creating localkube asset from url: Error opening file asset: /Users/user007/.minikube/cache/localkube/localkube-v1.8.0: open /Users/user007/.minikube/cache/localkube/localkube-v1.8.0: no such file or directory
How can I fix this problem? I tried many ways, but no one worked.😢
My system is macOS Sierra.
Looks like this is a recurring issue. Check out the github issues here: https://github.com/kubernetes/minikube/issues/2468
I was having this issue and followed Chris Darby link (https://github.com/kubernetes/minikube/issues/2468).
I managed to fix it with the following workaround (considering the new version 1.9.0):
Download localkube
Rename it to localkube-v1.9.0
Copy the file
in ~/.minikube/cache/localkube/localkube-v1.9.0

Docker Quickstart Terminal fails to start VirtualBox VM in Windows 10

I've tried several times to start the Docker VM via the Docker Quickstart Terminal. After deleting the default virtual machine in VirtualBox I receive the following output
Creating Machine default...
Running pre-create checks...
Creating machine...
(default) OUT | Creating VirtualBox VM...
(default) OUT | Creating SSH key...
(default) OUT | Starting VirtualBox VM...
Error creating machine: Error in driver during machine creation: exit status 1
Looks like something went wrong... Press any key to continue...
To troubleshoot further, I attempted to start the default machine in the VirtualBox GUI directly using Start > Headless Start, as suggested in other Docker issues. The startup failed and I received an error dialog box with the content:
Failed to open/create the internal network 'HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter' (VERR_INTNET_FLT_IF_NOT_FOUND).
Failed to attach the network LUN (VERR_INTNET_FLT_IF_NOT_FOUND).
Result Code:
E_FAIL (0x80004005)
Component:
ConsoleWrap
Interface:
IConsole {872da645-4a9b-1727-bee2-5585105b9eed}
Versions of related components:
VirtualBox Version 5.0.11 r104393
Docker Toolbox 1.9.1a
Windows 10 Version 1511 (OS Build 10586.14)
One of the answers to this question solved my problem. Here it is with a few edits:
I found a solution
Open Windows Network Connections
Right click on VirtualBox Host only adapter that was created
Choose properties
Check "VirtualBox NDIS6 Bridged Networking driver"
Disable and Enable the highlighted item
For me "VirtualBox NDIS6 Bridged Networking Driver" was not checked. I checked it and clicked OK to close the Properties window. After that, the Docker Quickstart Terminal was able to start the VM successfully.
The same thing happened to me. At this moment I am using Windows Home.
At least in my case, what happened was that the environment variables DOCKER_MACHINE and DOCKER_TOOLBOX_INSTALL_PATH were not created for the system.
I just had to add them and it worked.
I tried to follow #chris-hunt answer, but I didn't found the highlighted item. I realized it was due to the fact I didn't installed the VirtualBOX that comes in the Docket Tools installation. I think I was using an older version.
So I uninstalled docker tools AND VitualBOX, both on windows Control Panel. After that, I reinstalled Docker Tools with the VirtualBOX checked, and it finally worked.

Types of errors docker in Windows?

When I began to start docker it stuck and there are so many bad problem with it
System: Windows 8.1 64-bit
I replace virtualbox 5.0.6 to virtualbox 5.0.7 Still, there's an error
Error One:
When Docker Quickstart Terminal want to begin Starting VM... is hanging
Error two
I test my installation with docker run hello-world I get the following:
Post http://127.0.0.1:2375/v1.20/containers/create: dial tcp 127.0.0.1:2375: ConnectEx tcp: No connection could be made because the target machine actively refused it..
* Are you trying to connect to a TLS-enabled daemon without TLS?
* Is your docker daemon up and running?
Error three
Kinematic doesn't work
It work until 99% BUT suddenly it doesn't work
Machine IP could not be fetched. Please retry the setup. If this fails please file a ticket on our GitHub repo.
Best solution I've found after googling for a while:
First check if your Virtualbox version is the latest or at least above 5, then
Run on CMD docker-machine rm -f ##dockerContainerName## (Generally: default)
Delete .docker folder from your user folder
Run docker-machine create --driver virtualbox ##dockerContainerName##
Profit!!!

Resources