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'