I have a Shell script on a server. The script is run by a particular user, not root.
The script has the following:
export DISPLAY=:8
Xorg $DISPLAY
But there is an error:
Fatal server error: PAM authentication failed, cannot start X server. Perhaps you do not have console ownership?
Can anyone guide me on how to fix this? I've been Googling but there are numerous different answers so I need a bit of guidance.
Thanks for your time.
Edit: I have found this (enter link description here) which suggests changing the /etc/pam.d/xserver file but I don't really know if that's the right thing to do?
WebDriver is really not supposed to be run on a server -- It should be run on a workstation being used to conduct the tests.
If you really want to run the WebDriver test suite on the server then as SvenW pointed out, you're Doing It Wrong™ – You can't just launch an X server on whatever machine you feel like, especially if you're not on the console (that's the
Perhaps you do not have console ownership?
part of the error message).The easiest solution in your case is to run an X server on the machine you're SSHing in from, and use
ssh -X
to forward X clients (like Firefox) requests from the server back to your workstation.Remove the
export DISPLAY=:8
andXorg $DISPLAY
lines from the script when you do this.ssh -X
will automatically set theDISPLAY
environment variable for you.Note that there are other possible solutions ("dummy" X servers that don't display anywhere), but that's getting far more complicated than you need to be at this point.