problem regarding setting DISPLAY env variable and hostname

Giorgos Keramidas keramida at
Thu Feb 23 09:27:31 PST 2006

On 2006-02-23 08:23, Rob <rob at> wrote:
> Sorry if you get this twice Rob as I mistakenly
> sent my reply only to you without including the list
> I had the same problem.  Add this line to your
> .xinitrc file
> xdpyinfo -display :0.0
> The hostname is not specified.
> --Duane
> --------------------------------
> Hi Duane,
> I put the line you suggest into .xinitrc, but I still have the
> same problem.  I also went into /etc/hosts after doing this and
> tried two ways of setting hosts:
> 1.  localhost   xenon
> 2  localhost

What are the "1." and "2" at the beginning of the lines above?
I hope they are not part of your /etc/hosts file.

You have obviously messed up your /etc/hosts file too much.
Before you do anything else, please restore it from the sources,
by copying `/usr/src/etc/hosts' over it.  Then re-add "xenon" at
the localhost line.

> But I am still seeing the "out of display lists" message.
> It seems like the xdpyinfo command does not do anything.

It does.  It prints a lot information about the current display.  Since
this goes to the terminal where xdpyinfo was started, then it goes to
the virtual console that you start X11 in.  You won't see much, until
you exit X11.

> The only thing that I have done which changes the error message is to
> set /etc/rc.conf hostname="xenon" Then in .bash_profile put
> "DISPLAY=xenon:0.0 export DISPLAY"

No.  That's a *horrible* idea.  The `startx' utility can start an X11
server with a slightly different display, i.e. with:

    $ startx -- :1

Then your .bash_profile will override the default DISPLAY of the X11
session, messing up everything.  If you happen to run two X11 sessions
at the same time, you will be opening windows in the first session no
matter where you run the commands that you will use.

> Then I get the different error message:
> "_X11TransSocketINETConnect() can't get address for xenon:6000: hostname nor servname provided, or not known
> Error: Can't open display: xenon:0.0"

The error message means you still have name resolution problems.  Your
system doesn't know that "xenon", "localhost", "" are all
equivalents ways of referring to itself.

> So I guess now I have tried every combination of the following:
> setting hostname in rc.conf to either "" or "xenon"
> setting "DISPLAY=xenon:0.0" or leaving that line out in .bash_profile

A hostname of "" is wrong.

A hostname of "xenon" is almost right.

> And finally, putting in xinitrc "xdpyinfo -display :0.0 or just
> leaving that line out.

This should be without any real side-effects regarding the way your X11
session works.

Please, restore your /etc/hosts file from /usr/src/etc/hosts and then
we'll see what other may be wrong with your current setup.

- Giorgos

More information about the freebsd-questions mailing list