Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using SSH to open application on desktop

So normally people ask how to forward x11 to the local machine, but rather I want to leave the application running on the remote box's desktop.

So let say I ssh from a windows machine (using putty) and run xclock & disown. If I then walked over to my desktop and look at the screen and see xclock running on the linux machine.

Any way to do that? Using Mint 13.

like image 523
beeryardtech Avatar asked Aug 20 '12 15:08

beeryardtech


2 Answers

This works for me once I'm ssh'd in:

export DISPLAY=:0; nohup <command> &>/dev/null &

For example:

export DISPLAY=:0; nohup iceweasel &>/dev/null &
like image 196
DanteAlighieri Avatar answered Sep 21 '22 18:09

DanteAlighieri


When you're ssh'd in normally, set the DISPLAY variable with export DISPLAY=0:0 (0:0 being the display of the target box), and then you can run your command as you normally would. If you want to be able to close the ssh session, prepend the command with nohup: nohup ./yourcommand > dev/null.

like image 44
ari Avatar answered Sep 19 '22 18:09

ari