I'm trying to startx as user. I am only able to startx as sudo. More specifically, I'm trying to get pulseaudio to work with xfce4.

I get an error as follows.

xauth: timeout in locking authority file /home/user/.Xauthority

Your sudo is likely configured not to change the $HOME environment variable. Meanwhile startx (or at least, the X-server process that it spawns) wants to write an authentication cookie to $HOME/.Xauthority. The net result is that sudo startx will leave a root-owned .Xauthority in your user's home directory - which the user then cannot write to because of its ownership and permissions, so that startx without sudo fails.

If that's what has happened, you will need to correct the ownership (or simply delete) the root-owned .Xauthority file so that normal startx can succeed. For example

  • switch to a CLI virtual terminal using (for example) CTRL+ALT+2
  • log in using your regular user credentials
  • rm ~/.Xauthority

See also Why should users never use normal sudo to start graphical applications?

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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