Is it possible to use ssh to start applications remotely? I have a linux machine for a mediacenter and I want to be able to connect through ssh and start for example XBMC or Boxee on it and then use my iphone as a remote.

2 Answers 2



$ DISPLAY=:0 /usr/bin/xbmc

(after you ssh into the machine of course)

  • so basicly by adding DISPLAY:0 in front of the command. Thanks man.
    – Stulli
    May 18, 2009 at 17:29
  • Of course you could do this in one line too: ssh user@server "DISPLAY=:0 /user/bin/xmbc"
    – x3ja
    May 19, 2009 at 14:04

I took a different slant on what the OP asked and now realise I might have gone in the wrong direction. Had written the full answer below before I realised this, and think some people might find this looking for the other interpretation.

The advice below is if you want to start the application remotely but view it locally (i.e. run on mediacenter, view on another PC).

You could use:

ssh -X user@server


The -X just means "use X11 Forwarding".

To get it all in one line you could just do:

ssh -X user@server "/user/bin/xmbc"

This will only work if the server (in this case your mediacenter) has the X11 forwarding option enabled (normally in /etc/ssh/sshd_config and the option is X11Forwarding yes - restart ssh after you change this - /etc/init.d/ssh restart)

Now, if you're really wanting ease of use, you could key share between the two computers and then make an icon on your desktop that ran the above command and you'd have passwordless access to it!

  • In some cases I've had to use the -Y option instead of the -X option when doing this...
    – David Z
    May 18, 2009 at 21:19
  • This actually might come in handy. Thanks
    – Stulli
    May 19, 2009 at 9:02

Not the answer you're looking for? Browse other questions tagged .