X11 can't open display:localhost: 0.0 after start up

Hey All,

I have a strange problem that wasn't happening a week or two ago...X11 can't open new xterms, or any app that needs the $display (localhost 0.0). For example,

[wireless-152:~] jeevan% xterm
<<hangs for a second or two>>>
xterm Xt error: Can't open display: localhost:0.0

What's weird is that when X11 first starts up, it fires up an xterm just fine. I edited .xinitrc and had it fire up two xterms:

...
xterm &
xterm &
...

And two xterms load up. But once X11 is up and running, I can't access my display. Other (fink) apps also have display errors:

[wireless-152:~] jeevan% ethereal

(ethereal:646): Gtk-WARNING **: cannot open display:

$DISPLAY is fine:

[wireless-152:~] jeevan% echo $DISPLAY
localhost:0.0

And what's weirder, is that these same display errors happen in both bash and tcsh, so I don't think fink (which lives in tcsh-land, right?) is responsible for gumming things up.

Any help would be appreciated. I think I am also having GTK issues in fink, but I don't know if these are related.
thanks,
jeevan

powerbook G4, Mac OS X (10.4.3)

Posted on Dec 6, 2005 12:28 AM

Reply
4 replies

Dec 6, 2005 5:17 AM in response to Jeevan Kalanithi

Hi Jeevan,
Jun is of course right. It's my theory that if you specify a host, even localhost, apps try to make a network connection instead of a socket connection and run afoul of the nolisten_tcp preference in the ~/Library/Preferences/com.apple.x11.plist preference file. If I get a chance I'll test this but the reason isn't as important as the cure Jun gave.
--
Gary
~~~~
X windows:
You'd better sit down.
Don't laugh. It could be YOUR thesis project.
Why do it right when you can do it wrong?
Live the nightmare.
Our bugs run faster.
When it absolutely, positively HAS to crash overnight.
There ARE no rules.
You'll wish we were kidding.
Everything you never wanted in a window system. And more.
Dissatisfaction guaranteed.
There's got to be a better way.
The next best thing to keypunching.
Leave the thrashing to us.
We wrote the book on core dumps.
Even your dog won't like it.
More than enough rope.
Garbage at your fingertips.

Incompatibility. Shoddiness. Uselessness.
X windows.

Dec 8, 2005 2:24 AM in response to Gary Kerbaugh

A gold star for Gary. 🙂

If the DISPLAY is specified as hostname: screen, X tries to make a TCP connection to the server, which is disabled if the nolisten_tcp preference is set and is also subject to being blocked by the MacOS X firewall if it is enabled.

Specifying DISPLAY as unix: screen or just plain : screen causes X to use a UNIX-domain socket for the connection, which is the default allowed by the X server and is not subject to being blocked by the firewall.

Oh, and don't forget the number one thing about X, that used to be front and center in the docs for X11R2 and X11R3:

It's a Window System named X, not a system named "X Window."

(In the interest of full disclosure, check out the top line of the shell script that implements the xdpr(1) command… :-))

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

X11 can't open display:localhost: 0.0 after start up

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.