Resolve Xlib: connection to “localhost:0.0″ refused by server error when using Xming XServer
It can be frustrating when you try to start xwindow application using Xming XServer on Windows XP/7/Vista but encountering connection refused error. Here is an example of the error:

Xlib: connection to "remotehost:0.0" refused by server
Xlib: No protocol specified

Error: Can't open display: remotehost:0.0

In addition, if you look at Xming log, you will see something like this:

AUDIT: Tue Feb 12 21:49:43 2008: 3868 C:\Program Files\Xming\Xming.exe:
client 4 rejected from IP

Here is a quick tip to fix this issue.