Originally Posted by Dead Parrot
Good advice, Kovacs. But if you edit startx, then you'll have to do that again every time after you've upgraded Xserver.
It's better to create a file named .xserverrc into your home directory and add the xserverauthfile line there, like this:
Then make .xserverrc executable (chmod +x .xserverrc).
doing this on debian/testing gives the following error
xauth: creating new authority file /home/fred/.serverauth.6509
/usr/X11R6/bin/xinit: Connection refused (error 111): unable to connect to X server
/usr/X11R6/bin/xinit: No such process (error 3): Server error.
only after deleting the file was I able to startx again.