Thursday, August 15, 2013

xhost command hangs

Problem : On a unix system LinuxSystem below xhost command hangs forever.
   
         LinuxSystem # xhost +


Situation : You have already exported DISPLAY variable and some Xservers is already running on RemoteSystem
 
   LinuxSystem# export DISPLAY=RemoteSystem:0.0


Solution : xhost use outgoing tcp port 6000 to connect to RemoteSystem. Your firewall is blocking is. Run strace to confirm.

LinuxSystem# strace xhost + | tail -10
socket(PF_NETLINK, SOCK_RAW, 0)         = 3
bind(3, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 0
getsockname(3, {sa_family=AF_NETLINK, pid=33705, groups=00000000}, [12]) = 0
sendto(3, "\24\0\0\0\26\0\1\3\361\256\rR\0\0\0\0\0\0\0\0", 20, 0, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 20
recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"\24\0\0\0\3\0\2\0\361\256\rR\251\203\0\0\0\0\0\0\1\0\0\0\24\0\1\0\0\0\0\0"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 20
close(3)                                = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 3
setsockopt(3, SOL_TCP, TCP_NODELAY, [1], 4) = 0
setsockopt(3, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0

connect(3, {sa_family=AF_INET, sin_port=htons(6000), sin_addr=inet_addr("RemoteSystem")}, 16 <unfinished ...>

No comments:

Post a Comment