Start minikube dashboard in remote computer through ssh

11/19/2020

I installed minikube in a remote computer. The service is up and the configuration looks ok:

$ kubectl cluster-info
Kubernetes master is running at https://192.168.49.2:8443
KubeDNS is running at https://192.168.49.2:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.

I am connected to this computer through SSH and am able to launch all graphic applications. Sanity check, confirming X11 forwarding is allowed:

$ grep X11Forwarding /etc/ssh/sshd_config
X11Forwarding yes

But when I try to start the dashboard I get an X11 error:

$ minikube dashboard
* Verifying dashboard health ...
* Launching proxy ...
* Verifying proxy health ...
* Opening http://127.0.0.1:39571/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/ in your default browser...
X11 connection rejected because of wrong authentication.
[61559:61559:1119/114641.640444:ERROR:browser_main_loop.cc(1434)] Unable to open X display.

What could be the cause?

Update: replying to larks below, the ForwardX11Trusted parameter is set to yes on the SSH client:

$ cat /etc/ssh/ssh_config | grep ForwardX11Trusted
   ForwardX11Trusted yes
-- Luís de Sousa
kubernetes
minikube
ssh

1 Answer

11/20/2020

There could be plenty of reasons for that. You may just need to:

export XAUTHORITY=$HOME/.Xauthority

Also make sure ~/.Xauthority is owned by you.

In order to verify it, run:

ls -l ~/.Xauthority

And then, depending on the result, you may need to fix ownership and permissions on that file with:

chown user:group ~/.Xauthority

and

chmod 0600 ~/.Xauthority
-- mario
Source: StackOverflow