Tuesday, September 27, 2011

Cannot connect to X server localhost:11.0 error

Today when I try to install a program that has a GUI via SSH client, I received the following error:

_X11TransSocketINETConnect: Can't get address for localhost
egs_install_Linux_self.exe: cannot connect to X server localhost:11.0

I checked the X11 forward setting of sshd server and client and both are correct.

cat /etc/ssh/sshd_config | grep X11Forward
X11Forwarding yes

set | grep DISPLAY

It seems from the error message the program has difficulty resolving the address localhost therefore I also checked /etc/hosts file and ping localhost also works fine.

cat /etc/hosts | grep localhost               localhost.localdomain localhost
Now the problem seems to be that the program to be installed doesn't understand the DISPLAY env set as localhost:11.0. Therefore I ran the following after I sshed to the host
export DISPLAY=
and the program now works

No comments: