If you attempt to run a command on a remote machine that uses a graphical window, you will see an error similar to cannot open display. This is because the ssh shell is attempting (and failing) to connect to the X server on the remote machine.
Running graphical commands on a remote machine
How to do it...
To run an graphical application on a remote server, you need to set the $DISPLAY variable to force the application to connect to the X server on your local machine:
ssh user@host "export DISPLAY=:0 ; command1; command2"""
This will launch the graphical output on the remote machine.
If you want to show the graphical output on your local machine, use SSH's X11 forwarding option:
ssh -X user@host "command1; command2"
This will...