Friday, August 31, 2012

Infamous _X11TransSocketINETConnect() can't get address for localhost

I use the Xming as an Xserver
In Windows, look for the shortcut to start Xming. 
Right click to go to properties.
add -ac to your XMing shortcut:
"C:\Program Files\Xming\Xming.exe" :0 -clipboard -multiwindow -ac 
The -ac parameter allows everyone to connect, like ‘xhost +’

Start Xming
Open putty -> connection -> SSH -> check Enable X11 forwarding -> put the actual hostname:0.0
go back to session and login.
You can check in /etc/ssh/ssh_config if X11 forwarding is enabled


  1. Stephen CarpenterMay 28, 2014 at 11:36 PM

    This is really not a very good solution because it doesn't solve the underlying problem. Localhost should always resolve!

    Things to check:
    does /etc/hosts have an entry for named "localhost" ? It should.
    does /etc/nsswitch.conf have an entry like this:
    "hosts: files dns"

    I ran into this very issue today and fixing /etc/nsswitch.conf is what fixed it for us.

    1. This comment has been removed by the author.

  2. Many thanks Stephen for your comment and for the resolution you provided.