problem regarding setting DISPLAY env variable and hostname

Rob rob at
Thu Feb 23 08:39:22 PST 2006

On 2006-02-22 13:07, Rob <rob at> wrote:
>On Wed, 22 Feb 2006 20:27:20 +0200
>Giorgos Keramidas <keramida at> wrote:
>>> I have read manual pages, searched the archives, but I am really confused
>>> about all of this.  Thank you for any help.
>> All this can be resolved by using `/etc/hosts'.  Just add your hostname
>> there and point it to the address.  Then all programs should be
>> able to resolve it.
> Thanks Giorgios,
> I think that I have the hostname problem resolved.  rc.conf has
> hostname="xenon" and /etc/hosts has: localhost xenon

That's quite fine :)

> So now Xorg does not give errors on startup or shutdown like the
> > > bad display name "xenon:0" in "remove" command    or
> > > bad display name "xenon:0  in "list" command
> But when not setting the DISPLAY variable explicitely anywhere I still
> get the error: "out of display lists" upon starting the program I want
> from xterm
> But then setting DISPLAY=xenon:0.0 export DISPLAY and then executing
> the program then gives the error:
> "Can't open display: xenon:0.0"   so I guess I am back to square one.
> Maybe I should call it a day and rest, haha.

Just a wild guess, since I don't see why you should have problems
running programs like:

    Can't open display: xenon:0.0

Are you running X11 as a plain user and having problems to run programs
*after* using su(1) to become root or does this happen for all users in
all terminals?

- Giorgos
Hi Giorgos,

I am trying to run a program from xterm as a normal user.  However, when su'ing in xterm,
I am unable to run any programs.  Then I get the error:

"Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
Error: Can't open display: :0.0

setting for csh as root:  setenv DISPLAY xenon:0.0 then gives the error message:

_XTransSocketINETConnect() can't get address for xenon:6000: hostname nor server name provided, 
or not known
Error: Can't open display xenon:0.0

I seem to remember never being able to su in xterm and be able to run any programs no matter what
combination of settings I have used.  I also think that the error messages might have been different
but I am starting to lose track of the error messages for combinations of settings for hostname, 
DISPLAY, etc.  I probably need to start putting all of this down on paper so I can find any patterns.



Rob Lytle Home Page

More information about the freebsd-questions mailing list