Launching programs after hostname change returns error _IceTransSocketUNIXConnect: could not connect to local-host
After changing the hostname on 14.04 I cannot launch unetbootin, attempting to launch the application from bash returns:
_IceTransSocketUNIXConnect: Cannot connect to non-local host OLDHOSTNAME
_IceTransSocketUNIXConnect: Cannot connect to non-local host OLDHOSTNAME
Qt: Session management error: Could not open network socket
Output from hostname
cat /etc/hostname
and cat /etc/hosts
all confirm that the hostname is correct. I've also rebooted the system since making the change to confirm everything loaded with the new settings.
I am at a loss, any help is greatly appreciated! Also, could anyone provide some background on what IceTransSocketUNIXConnect is and how it works? Is it anything like Winsock?
It appears this error stems from the ~/.ICEauthority file. You can use the command iceauth list
list your entries. In my case the old hostname included localhost
, replace this with your old hostname.
e.g. iceauth list | grep localhost
:
XSMP "" unix/localhost@localdomain:/tmp/.ICE-unix/2640 MIT-MAGIC-COOKIE-1 7035f3aebe650bd72315b76819267a9d
XSMP "" local/localhost@localdomain:@/tmp/.ICE-unix/2640 MIT-MAGIC-COOKIE-1 abe16eba34a1cf69087aff88bdd14a1a
ICE "" local/localhost@localdomain:@/tmp/.ICE-unix/2640 MIT-MAGIC-COOKIE-1 1e69a0d48b1f1375167c79bffbbfa06e
ICE "" unix/localhost@localdomain:/tmp/.ICE-unix/2640 MIT-MAGIC-COOKIE-1 f91ab2525bf0000159161db41df1aa0c
2 options:
- Simple - Delete the ~/.ICEauthority file and restart machine or display manager. ~/.ICEauthority will be regenerated with your new hostname.
- Advanced - Use
iceauth remove
to remove the bad entries and then restart your display manager (14.04 default = lightdm). Just copy paste the line from your grep above into the examples below, it removes both XSMP and ICE protocol entries.iceauth -v remove netid=unix/localhost@localdomain:/tmp/.ICE-unix/2640
iceauth -v remove netid=local/localhost@localdomain:@/tmp/.ICE-unix/2640
-
iceauth list | grep localhost
# Confirm they are removed. -
sudo restart lightdm
# @see this answer for more details or if this doesn't work for you
Further reading from man iceauth
:
list
List (print) entries in the authority file. You may specify optional modifiers as below to specify which entries are listed.
list [ protocol_name ] [ protocol_data ] [ netid ] [ authname ]
remove
Remove entries from the authority file.
remove [ protocol_name ] [ protocol_data ] [ netid ] [ authname ]
sources:
https://superuser.com/questions/714015/accidentally-deleted-iceauthority-and-xauthority-files
https://codeyarns.com/2015/03/23/cannot-connect-to-non-local-host-error/
https://linux.die.net/man/1/iceauth
How to restart X Window Server from command line?