Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is making me frustrated. Why doesn't it work, and how do I get it to work?

I have a newly installed Ubuntu 10.04.2 (Lucid Lynx). I have installed X and gdm. Gdm is set up to automatically log in a user. The computer does not have any keyboard connected, but I want to display some stuff on its local display.

Normally, I would just ssh to the computer as the user who has logged in automatically, and run "DISPLAY=:0.0 xclock", for example.

But now I only get the response:

user@host:~$ DISPLAY=:0.0 xclock
No protocol specified
Error: Can't open display: :0.0

However, if I log in as root, it works.

share|improve this question
up vote 1 down vote accepted

There seems to be a couple of bugs involved in this problem: This one prevents an .Xauthority file from being created. And this one prevents the proposed workaround from working when using an automatic login.

So the solution was to change the automatic login to a timed login with a short delay, and add the following to /etc/gdm/PostLogin/default


if [ -e $auth ]; then
diff <(xauth extract - $DISPLAY) <(XAUTHORITY=$auth xauth extract - $DISPLAY) > /dev/null && exit 0
xauth extract - $DISPLAY | XAUTHORITY=$auth xauth merge -
chown $USER $auth
share|improve this answer
Or just run 'xhost +localhost' as the user who is logged in on the machine before starting the X client. – symcbean Apr 1 '11 at 11:08

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.