<p>I am using <code>MobaXterm_21.2</code> installed version.
When I run <code>kubectl version</code>, it's working as expected:</p>
<pre><code> kubectl version
Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;14&quot;, GitVersion:&quot;v1.14.3&quot;, GitCommit:&quot;5e53fd6bc17c0dec8434817e69b04a25d8ae0ff0&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2019-06-06T01:44:30Z&quot;, G
oVersion:&quot;go1.12.5&quot;, Compiler:&quot;gc&quot;, Platform:&quot;windows/amd64&quot;}
Unable to connect to the server: dial tcp [::1]:8080: connectex: No connection could be made because the target machine actively refused it.  
</code></pre>
<p>But it is not able to read the <code>.kube/config</code> file or able to pickup the config file given through ENV variable <code>KUBECONFIG</code> or <code>--kubeconfig</code>. See the response below:</p>
<pre><code>  export KUBECONFIG=/drives/path/to/config/file.config
                                                                                                                                                                                        ✔

  kubectl config view
apiVersion: v1
clusters: []
contexts: []
current-context: &quot;&quot;
kind: Config
preferences: {}
users: []

                                                                                                                                                                                    
</code></pre>
<p>Not working either:</p>
<pre><code> kubectl config --kubeconfig=/drives/path/to/config/file.config  view
apiVersion: v1
clusters: []
contexts: []
current-context: &quot;&quot;
kind: Config
preferences: {}
users: []
</code></pre>
<p><strong>This is a kind of blocking issues for me. Can anyone guide me on how to make <code>kubectl</code> work in mobaxterm? Any help will be highly appreciated.</strong></p>
<p><strong>Edit</strong> - like @mikolaj-s pointed. From <code>powershel/cmd/gitbash</code>, I am able to access the k8s cluster with out any problem. I have been accessing the cluster using powershell for several months now and it reads the <code>.kube/config</code> file or <code>KUBECONFIG</code> env var as expected.<br />
I want to shift to mobaxterm for it's multi-tab feature. If there is another tool that provides multi-tab feature I might be ok with it too.</p>
<p>In Mobaxterm -</p>
<pre><code> kubectl cluster-info dump 
Unable to connect to the server: dial tcp [::1]:8080: connectex: No connection could be made because the target machine actively refused it.

 kubectl config get-contexts --kubeconfig /path/to/config/file
CURRENT   NAME   CLUSTER   AUTHINFO   NAMESPACE
</code></pre>
<p>The kubeconfig files i am using are tested and have no issues for sure(100%) as they are working from powershell.</p>
<p><strong>Edit 2 -</strong> Many thanks for @mikolaj-s.<br />
With lot of hope I tried using powershell in mobaxterm as suggest by mikolaj - <a href="https://codetryout.com/mobaxterm-windows-command-prompt/" rel="nofollow noreferrer">mobaxterm-windows-command-prompt</a> and <strong>it worked.</strong></p>

samshers
<p>The solution is to use PowerShell directly in the MobaXterm - steps how to configure that can be <a href="https://codetryout.com/mobaxterm-windows-command-prompt/" rel="nofollow noreferrer">found here</a> (instead of <code>CMD</code> choose <code>Powershell</code>):</p>
<blockquote>
<p>MobaXterm comes with various client tools such as SSH, telnet, WSL, CMD, and so on. It can well handle a Windows command line as well, here is how,</p>
</blockquote>
<blockquote>
<p>How to open Windows command prompt using MobaXterm?</p>
<ul>
<li>Open your MobaXterm</li>
<li>From the top menu, click on Sessions</li>
<li>From the Session settings window, click on the Shell button</li>
<li>Under the Basic Shell settings tab, select Terminal shell CMD</li>
<li>Also select a startup directory of your choice, which the CMD prompt will start it as you startup folder.</li>
<li>Now, Click the OK button to open a windows command window!</li>
</ul>
</blockquote>
<blockquote>
<p>With this, you should be able to use multiple Windows command lines in a tabbed view, or along with your other sessions.</p>
</blockquote>
