The connection to the server <host>:6443 was refused - did you specify the right host or port?

Please try
strace -eopenat kubectl version
either using sudo or root.

the above command worked for me. i too banged head a lot
i have deployed Kubernetes on Ubuntu16.04 on Virtualbox