Start a GUI Application on a Remote Computer using SSH

This article describes how to log into the remote computer (server) using SSH and run a GUI (graphical) application that requires screen. The GUI program will be displayed on the physical monitor, connected to that remote machine.

Run a GUI Program on a Remote Computer’s Screen

The Basic Procedure

Log into a remote machine using SSH:

$ ssh 192.168.1.100

Tell GUI applications to be launched on the local screen (so, any graphical program that you run, will be displayed on the remote computer’s screen):

$ export DISPLAY=:0

Execute GUI Program. For, example lets start Firefox browser that will be launched and displayed on the remote machine’s screen in which we logged in:

$ firefox "www.shellhacks.com"

Use nohup to prevent a process from being stopped after closing SSH session:

$ nohup firefox "www.shellhacks.com"

More Examples

Send a pop-up notification (notify-send) that will be shown on the remote computer’s screen:

$ ssh 192.168.0.100 'DISPLAY=:0 nohup notify-send "Hello" "World"'

Start a music player (rhythmbox) on the remote computer:

$ ssh 192.168.0.100 'DISPLAY=:0 nohup rhythmbox ./Smoke-on-the-Water.mp3'
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

SSH Login Slow — Removing Delay

Problem: When I’m trying to log into the remote server via SSH, after I enter the UserName, it...

SSHPass: SSH Login With Password – Command Line

A password-based authentication is often a default way to connect to a remote host over SSH. But...

Signing Failed: Agent Refused Operation [SOLVED]

While attempting to connect to some server over SSH, you may get the error as follows:...

SSH Fingerprint: Get Fingerprint of SSH RSA Key

The fingerprint is a unique sequence of letters and numbers used to identify the SSH RSA key. It...

SSH: Create Public Key from Private

Usually a public SSH key is generated at the same time as a private key. Unlike a private SSH...