<p>I was playing around with <a href="https://kubernetes.io/docs/setup/learning-environment/minikube/" rel="nofollow noreferrer">Minikube</a> and <a href="https://www.docker.com/products/docker-desktop" rel="nofollow noreferrer">Docker Desktop</a> and I used the <code>minikube stop</code> &amp; <code>minikube delete</code> commands. After this I was unable to start minikube again resulting in the following error:</p>

<pre><code>* minikube v1.11.0 on Microsoft Windows 10 Pro 10.0.18363 Build 18363
* Using the docker driver based on existing profile
* Starting control plane node minikube in cluster minikube
* Restarting existing docker container for "minikube" ...
! StartHost failed, but will try again: provision: get ssh host-port: get port 22 for "minikube": docker container inspect -f "'{{(index (index .NetworkSettings.Ports "22/tcp") 0).HostPort}}'" minikube: exit status 1
stdout:


stderr:
Template parsing error: template: :1:4: executing "" at &lt;index (index .NetworkSettings.Ports "22/tcp") 0&gt;: error calling index: index of untyped nil

* Restarting existing docker container for "minikube" ...
* Failed to start docker container. "minikube start" may fix it: driver start: expected container state be running but got "Stopped"
*
X error provisioning host: Failed to start host: driver start: expected container state be running but got "Stopped"
*
* minikube is exiting due to an error. If the above message is not useful, open an issue:
  - https://github.com/kubernetes/minikube/issues/new/choose
</code></pre>

<p>I tried starting Minikube again with both <code>minikube start</code> and <code>minikube start --driver=docker</code>. It resulted in the same error. So I tried to remove the Minikube docker image, but Docker wasn't working out anymore as well, it gave me the following error with <em>every</em> docker command:</p>

<pre><code>An error occurred trying to connect: Get http://127.0.0.1:2375/v1.40/containers/json: dial tcp 127.0.0.1:2375: connectex: No connection could be made because the target machine actively refused it.
</code></pre>

<p>What to do?</p>

<p>I stumbled upon <a href="https://github.com/docker/for-win/issues/1651#issuecomment-363777629" rel="nofollow noreferrer">this</a> answer which solved the Docker related error , open <a href="https://gitforwindows.org/" rel="nofollow noreferrer">Git Bash</a> and execute:</p>

<p><code>KUBECONFIG=~/.kube/config</code></p>

<p>This will tell Minikube to look at that folder for the configuration. <strong>Note</strong> that this environment variable is an extention of the <code>$HOME</code> environment variable. Check if this variable is correctly pointing towards <code>%USERPROFILE%</code>, check in Git Bash via <code>echo $HOME</code>. </p>

<p>After these both variables are set correctly my docker commands were working again.</p>

<p>Then I ran the following commands as advised <a href="https://github.com/kubernetes/minikube/issues/8163#issuecomment-636382949" rel="nofollow noreferrer">here</a> to start the minikube cluster again without any problems:</p>

<ol>
<li><code>docker system prune</code></li>
<li><code>minikube delete</code></li>
<li><code>minikube start --driver=docker</code></li>
</ol>
