You not often have to start an application on a remote machine that requires the use of GUI, more widely in applications to launch and “turn” in background, but it can always happen. I'm thinking for example to those who use a computer as a multimedia station (with XBMC setup is very simple) or even just to experience.
Suffice it to say that you can do, but it is necessary to direct the GUI application to a screen in particular.
First we will login tramite SSH:
~$ ssh user@<ipaddress>
Obviously replace “user” and “<ipaddress>” with the IP address of the PC to which we want to connect and the user configured in the pc.
Then we will make sure that requests are diverted to a session-specific graphics:
~$ export DISPLAY=:0
In this case (except for different operations) the first session open graphics.
And finally launch the program that includes the use of the GUI:
~ $ Firefox
In alternative, can be summed up in a single command all the steps:
~$ ssh user@<ipaddress> "DISPLAY=:0 nohup firefox"
When the program starts the SSH session ends, but the program will remain open.