Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

Cannot connect to non-local host error

📅 2015-Mar-23 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

Problem

I changed the hostname of my computer by editing /etc/hostname and /etc/hosts, as explained here. After this, whenever I ran Vim and some other programs at the terminal, this message was printed:

_IceTransSocketUNIXConnect: Cannot connect to non-local host old-hostname
_IceTransSocketUNIXConnect: Cannot connect to non-local host old-hostname

Solution

After a bit of Googling, I found that this error was originating from ICE, an IPC protocol used by X clients. This was due to the old hostname still being present in the ~/.ICEauthority file.

I deleted this file and restarted the computer. The new ~/.ICEauthority that was automatically generated had the new hostname. Also, the error did not occur after this.

Tried with: Ubuntu 14.04