Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Launch GUI program at host through SSH

I've got a Raspberry Pi connected to my TV, with no mouse or keyboard.

I'm sshing into it, starting X and then I want to launch VLC (or any other GUI program, for that matter). If I ssh -X, that will open the program in the computer I'm sshing from, not on the TV.

How can I launch a program and make it appear on the TV?

like image 227
iomartin Avatar asked May 01 '13 18:05

iomartin


People also ask

Can you open a GUI from SSH?

While X11 remains the foundation for most Linux desktops, its network transparency, or ability to display output across the network, is one of its unsung features. SSH makes it easy and secure to run Linux GUI apps on a remote machine and display them on your machine.

How do I access remote GUI?

Remote GUI allows you to access your router's online settings, also known as the graphical user interface (GUI), through a WAN connection. To access your modem remotely, you will enter https:// followed by the modem IP in the URL field of a browser.


2 Answers

Slightly less typing than Joachim's (and actually slightly different behavior):

DISPLAY=:0 vlc

This doesn't actually set the DISPLAY variable to :0 for the whole shell session, only passes it to vlc.

So:

  • If you want to start other X programs in that session after VLC, Joachim's is better.

  • If you just want to run VLC ASAP, this is faster by 9 keypresses. :)

(I wanted to add this only as a comment, but I didn't have enough points for that, sorry.)

like image 74
Sz. Avatar answered Sep 20 '22 19:09

Sz.


The DISPLAY environment variable needs to have a value set to which display the program should be opened. If you set it to :0, it means the first local screen.

This should in other words open vlc on the first local screen;

export DISPLAY=:0 ; vlc
like image 33
Joachim Isaksson Avatar answered Sep 17 '22 19:09

Joachim Isaksson