How to fix the problem of "Cannot open display"?

Ryan Schmidt ryandesign at macports.org
Sun Oct 4 16:05:44 PDT 2009


On Oct 4, 2009, at 16:32, Brandon Allbery wrote:

> On Oct 4, 2009, at 16:54 , Peng Yu wrote:
>> I started X11.app in /Applications/Utilities. But I still got the  
>> same
>> error as that in my original post. What's the problem?
>
> You'll need to run gnome-terminal from the initial xterm, or from  
> X11's Application menu, or after starting X11 do "export DISPLAY=:0"  
> in a Terminal.app, or install the update do launchd will do  
> forwarding automatically.

Starting on Leopard, Apple sets the DISPLAY variable for you in a way  
that X11 should auto-launch when you request an X11 program. So  
Brandon, you should not manually set DISPLAY, and Peng, I don't  
understand why X11 did not auto-launch for you. Do you have DISPLAY  
set to something in for example your .profile? If so, remove that,  
close the Terminal, open a new one, and try again.

Also, note that you can install the xorg-server port and the quartz-wm  
port in MacPorts, and use /Applications/MacPorts/X11.app instead of  
Apple's /Applications/Utilities/X11.app. This is a slightly newer  
version of X11 than the one you'd get from Apple.



More information about the macports-users mailing list