xhost +localhost does not work

Bug #182252 reported by John McCabe-Dansted
2
Affects Status Importance Assigned to Milestone
x11-xserver-utils (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

xp@ubuntu-xp:~$ xhost +localhost
localhost being added to access control list
xp@ubuntu-xp:~$ xhost
access control enabled, only authorized clients can connect
INET:localhost
xp@ubuntu-xp:~$ (DISPLAY=localhost:0.0 xterm )
xterm Xt error: Can't open display: localhost:0.0

I would expect that after running "xhost +localhost", "(DISPLAY=localhost:0.0 xterm )" would succeed.

This bug does not appear to be related to bug #50217.

I am using xserver-xorg-video-intel 2:2.1.1-0ubuntu9 with an i945 integrated graphics chip.

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

X is started with '-nolisten tcp' by default, so inet connections don't work unless you change that.

Changed in x11-xserver-utils:
status: New → Invalid
Revision history for this message
John McCabe-Dansted (gmatht) wrote :

Perhaps xhost should output some error message if you attempt to do a 'xhost +localhost' on a X server that isn't listening to TCP connections? It would be nice if it output an error message that provided information such as the following, or that made it easy to look up.

For the benefit of anyone else who hits this 'bug', I've found it easy to work around:

For the purposes of allowing a chroot jail to communicate to the X server, the following is sufficient:
   xhost +local:
   mount --bind /tmp/.X11-unix /choot_jail/tmp/.X11-unix
This can be tested with the chroot using
   sudo apt-get install xclock
   (DISPLAY=:0.0 xclock)
Using xterm instead of xclock can fail if you haven't run MAKEDEV pty in /chroot_jail/dev

Whenever I've used X over a network, 'ssh -Y' has sufficed.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.