How can I start a GUI application through SSH

Brian John brianjohn at
Mon Feb 21 21:28:11 GMT 2005

----- Original Message -----
> On February 21, 2005 03:25 pm, Brian John wrote:
>> Hello,
>> I would like to be able to start an X application through ssh.  I want
>> the
>> app to actually run on my local box (meaning I want the window to pop up
>> on the box that I am ssh-ing to), but I just want to be able to start it
>> remotely.  Can someone help me figure out how to do this?
> For the purpose of this discussion, the 'server' is the remote system the
> one
> you are ssh-ing to. The 'client' is the one you are ssh-ing from.
> 1)	Before you leave, go to the server and logon at the console so that you
> have X running. Make a note of the 'DISPLAY' variable setting. Probably
> ":0.0".
> 	$ echo $DISPLAY
> 	:0.0
> Do NOT log out.
> 2)	Use SSH to connect to the server as the same user that logged on.
> 3)	Set the DISPLAY variable to the one indicated in step 1.
> 	$ export DISPLAY=:0.0
> 4)	Run the command  you want (with nohup and in the background.
> 	$ nohup xterm -sb &
> That will run the command so that output is displayed on the server
> console
> and let you log out of your ssh session.
> If you want to learn more, you should read up on the xauth command. Also,
> try
> to understand X toolkit basics.
> Why do you want to do this anyway?
The reason that I want to do this is because I have a GUI app that
basically just sits and runs and doesn't need any interaction that I want
to be able to start and stop remotely.  I'm trying to test some different
command line options with it to see if it will run.  Basically as long as
it keeps running I am ok.

Thanks for the help

> --
> Ean Kingston
> E-Mail: ean AT hedron DOT org
> URL:

More information about the freebsd-questions mailing list