Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How are these 2 variables used by the X Window system?

On my Ubuntu 9.10 host, if I set XAUTHORITY to anything and then try to run a GUI program, I receive a GTK-WARNING ***: cannot open display :0.0 (DISPLAY is set to :0.0 by default). What is causing this error message?

share|improve this question

migrated from stackoverflow.com Mar 25 '10 at 5:00

This question came from our site for professional and enthusiast programmers.

3 Answers 3

DISPLAY is used by the X Window System to specify the host, graphics controller, and physical display. The default :0.0 means local host (frequently a Unix domain socket instead of a TCP/IP socket), first graphics controller and first physical display attached (0 for both). If you were connecting to an X server on a different host, you would specify that host's name or IP address; if you were using a different controller or display you would specify that number.

XAUTHORITY is used by xauth (as mentioned by c4747p) and contains the name of the file with your X privilege tokens.

You are probably getting the message because a bad XAUTHORITY file leads one to have no permissions to attach to the X server.

share|improve this answer

DISPLAY tells a program which "display" to run on (Linux typically has multiple virtual consoles). :0 is the default one; you can configure more. XAUTHORITY is related to the xauth system. The xauth system manages privileges for connecting to the X server, which runs as root. Because the program cannot find the authority file that it thinks you're specifying in XAUTHORITY, it can't get permission to connect.

share|improve this answer

c4757p is correct.

The specific reason why you can't launch GUI programs after setting XAUTHORITY is, it already has a value (assigned automatically by your display manager program when you log in,) and if you tamper with that, you'll get problems changing authorization. You would still be able to launch programs, but running anything as a different user would be a problem (so any administrative programs wouldn't launch.)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.