As outlined in the link, listed in a comment by the OP:
Turns out the solution is here: blog.falconindy.com/articles/… Manually starting X by startx and polkit are not cool together :) But you say "startx -- vt01" then everything will be fine. – Daniel Oct 19 '12 at 15:54
A number of issues may arise with authenticated sessions when the user starts the X
server from the console with startx
without any parameters; apparently, a new terminal is launched with the Xserver session, where the established authentication from within the console session is not "transferred" to the newly-created X-session.
As a result of this "loss of authentication", the unprivileged user is not allowed to "speak to privileged processes" and/or ask for authentication.
The suggested workaround is to start the X
server from the console with the current VT number passed as a parameter, e.g.:
xinit -- vt01
This will cause xinit
to start the X
server within the same terminal (with the authenticated session), instead of launching a new TTY.
Similarly, according to a comment to that referenced article, systemd-logind
puts the appropriate vt in the environment variable $XDG_VTNR
; so, one might create a short script or alias
to facilitate the correct xinit process by including
exec /usr/bin/X -nolisten tcp vt$XDG_VTNR "$@"
Note
Arch-linux's version of xorg-xinit
includes this line by default as of xorg-xinit-1.3.2-3
, according to the blog-post on blog.falconindy.com