Without being the person logged in at the console, how do I run an X application and have it display on that X session? Assume I am either root, or I am the same user who logged in, so in principle I have persmission to do this. But how do I convince X of this?
Some examples of situations like this:
import
commandThis is a simpler version of Launch OpenGL app straight from a windowless Linux Terminal
xinitrc does is to call a window manager or a session manager (e.g. twm , fvwm , gnome-session , …). This way, I can exit by using my-favorite-window-manager's “exit” command, or by running kill $XSESSION_PID from any shell in this X session.
On Unix-like operating systems, X, typically located at /usr/bin/X, is the original X server executable of MIT's X Window System. Typically, you do not need to run X manually. If what you'd like to do is start a new X Window session, use the startx command instead.
The short answer is that you have to set the DISPLAY
environment variable, and then the app will run.
The long answer is that we've got Xauth, and unless you're running as the same user on the same machine that's probably not going to work unless you export the Xauth credential from the account running the X server to the account running the X client. ssh -X
handles this for you, which is why it's awesome, but the manual procedure involves running xauth extract - $DISPLAY
on the X server account and feeding that data into xauth merge -
on the client account. (Warning: the data is binary.)
On modern Linux systems, there is one X session at :0 and the X11 authority data file is always $HOME/.Xauthority
so you can most often set two environment variables, for example, in Bash:
export XAUTHORITY=/home/$your_username/.Xauthority export DISPLAY=':0'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With