"No protocol specified" when starting X programs from a script

Alan Coopersmith alan.coopersmith at oracle.com
Thu Apr 28 11:11:23 PDT 2011


On 04/28/11 12:27 AM, Tino Keitel wrote:
> Hi,
> 
> I try to start an X application from a script, which is not called from
> X. This works with the Xfce desktop, but does not with Gnome3.
> 
> The script sets DISPLAY=:0 and HOME to the user that owns the X
> session. The application is started with user and group permissions for
> the user that owns the X session.
> 
> Here is the strace output that causes the error:
> 
> socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC, 0) = 3
> connect(3, {sa_family=AF_FILE, path=@"/tmp/.X11-unix/X0"}, 20) = 0
> getpeername(3, {sa_family=AF_FILE, path=@"/tmp/.X11-unix/X0"}, [20]) =
> 0
> uname({sys="Linux", node="mac", ...})   = 0
> access("/home/scorpion/.Xauthority", R_OK) = 0
> open("/home/scorpion/.Xauthority", O_RDONLY) = 4
> 
> Any hints what I'm doing wrong?

You're using GNOME 3, specifically the new gdm, which doesn't put the xauth
cookie into $HOME/.Xauthority, so that programs outside your session can't
connect to it.

You could run 'xhost +si:localuser:scorpion' in your gnome session, so that
the xauth cookie isn't required for local connections from your uid.

-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System




More information about the xorg mailing list