start a GUI software on a remote Linux PC via SSH

Is there a way to start a GUI software on a remote Linux PC via SSH?

=>

We just need to run export DISPLAY=:0 in ssh session and programs run will run on the remote display.

 

eg:

[null@AONT12 ~]$ssh null@192.168.8.11

[null@AONT12 ~]$export DISPLAY=:0

[null@AONT12 ~]$ firefox

However when you close your ssh session, most of the time the remote application will close. If you want to disconnect from ssh but leave the application running you need to launch it in a special way using something like screen (keeps the ssh session running in the background) or nohup, or another method.

we can shorten this all down into one command that will connect, export the display in-line and start the application in a way that won't close it after the ssh session dies

[null@AONT12 ~]$ ssh null@192.168.8.11 "DISPLAY=:0 nohup firefox" 

posted on 2017-09-01 13:09  NullSir  阅读(164)  评论(0编辑  收藏  举报

导航