<p>I installed Kubernetes in virtual BOX  previously it was working properly but not it is showing <strong>The connection to the server 192.168.42.141:6443 was refused - did you specify the right host or port?</strong>, Please help.</p>

Dewa
<p>kubectl on any machine reads the current context from kubeconfig file. The file is located at the path <code>$USER_HOME/.kube/config</code></p>
<p>There are clusters configured inside this file alongwith the IP or domain name of the cluster. If the IP is invalid or not reachable OR the domain name can not be resolved and is unreachable OR the config file is corrupted or the config file is empty, then this error occurs.</p>
<p>In brief, you need to check your config file. It will save you a lot of effort.</p>
