User avatar
Newt_Othis
Posts: 20
Joined: Tue Dec 06, 2011 1:12 pm

Launching apps remotely

Tue Jun 19, 2012 12:41 pm

This is a fairly nooby question.

If I SSH into the RasPi (connected to the TV) from my laptop, can I launch a process so that it's visible on the TV?

For example, can I launch the excellent omxplayer to play a video on the TV, by issuing a command from the laptop via SSH?

BTW - I've been using Ubuntu on my laptop for ages, but am a complete novice at using Linux over a network.

godFather89
Posts: 150
Joined: Fri May 18, 2012 9:40 am
Location: Timisoara, RO

Re: Launching apps remotely

Tue Jun 19, 2012 12:43 pm

Yes you can. Actually everything you start that is not designed to run in the console will start on the real screen.

User avatar
grumpyoldgit
Posts: 1454
Joined: Thu Jan 05, 2012 12:20 pm

Re: Launching apps remotely

Tue Jun 19, 2012 12:47 pm

I have found that the easiest way to have a remote desktop is to install tight vnc server on the Pi.

Code: Select all

sudo apt-get install tightvncserver
So ....

You would sit at your laptop
ssh into your Pi
Run tightvncserver on your pi.

Then run VNC client on your laptop and attach to the Pi.

I'm actually sat here having just done that with the new Debian install.

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4205
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: Launching apps remotely

Tue Jun 19, 2012 12:57 pm

If you are just running SSH, ie a terminal session, then any graphical programs you run will be displayed on the TV. If you run an X server on your laptop, like Ximg, then starting graphical programs will make them come up on the laptop. You can change that by passing the --display flag to the command.

Code: Select all

$ xeyes --display :0

User avatar
Newt_Othis
Posts: 20
Joined: Tue Dec 06, 2011 1:12 pm

Re: Launching apps remotely

Tue Jun 19, 2012 1:01 pm

Thanks, as soon as I get the wireless working I'll try it out ;)

User avatar
jojopi
Posts: 2992
Joined: Tue Oct 11, 2011 8:38 pm

Re: Launching apps remotely

Tue Jun 19, 2012 2:25 pm

rurwin wrote:$ xeyes --display :0
It is actually "xeyes -display :0", or "DISPLAY=:0 xeyes". X predates the GNU double-minus option style.

TrevorAppleton
Posts: 74
Joined: Wed May 30, 2012 7:26 pm
Contact: Website

Re: Launching apps remotely

Thu Jun 21, 2012 7:50 am

I can VNC into my Raspberry Pi from my laptop. However the screen connected to the Raspberry Pi is not the same as on my laptop.My laptop is not controlling the screen connected to the Raspberry Pi but another instance of a desktop. Any ideas what I am doing wrong?
Check out my blog post for Raspberry Pi and Python tutorials.

http://trevorappleton.blogspot.co.uk/

User avatar
Newt_Othis
Posts: 20
Joined: Tue Dec 06, 2011 1:12 pm

Re: Launching apps remotely

Thu Jun 21, 2012 8:29 am

TrevorAppleton wrote:I can VNC into my Raspberry Pi from my laptop. However the screen connected to the Raspberry Pi is not the same as on my laptop.My laptop is not controlling the screen connected to the Raspberry Pi but another instance of a desktop. Any ideas what I am doing wrong?
I could be wrong, but I think that if you launch the VNC session from the CLI, it creates a virtual session of X that is different from the one running locally.

Again, I could be wrong, but I'd try launching VNC from the X session itself to share that screen.

I haven't quite got the wireless network running yet, so I can't test it.

TrevorAppleton
Posts: 74
Joined: Wed May 30, 2012 7:26 pm
Contact: Website

Re: Launching apps remotely

Fri Jun 22, 2012 10:54 am

Thanks for the reply.

I currently start VNCserver from the terminal as I SSH into the raspberry PI. When you say I should start it from X session do you mean from the session running on the raspberry pi rather than from the terminal I ssh into? So to do this I would need to hook a keyboard up to the raspberry pi I guess? I cannot SSH in to sort this out? Would I then need to start the VNCserver from the raspberry pi each time, or can this be set up to start automatically?
Check out my blog post for Raspberry Pi and Python tutorials.

http://trevorappleton.blogspot.co.uk/

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: Launching apps remotely

Fri Jun 22, 2012 11:03 am

I had a quick google, and it seems that http://www.karlrunge.com/x11vnc/ might be what you're looking for :?:

User avatar
Newt_Othis
Posts: 20
Joined: Tue Dec 06, 2011 1:12 pm

Re: Launching apps remotely

Fri Jun 22, 2012 11:11 am

AndrewS wrote:I had a quick google, and it seems that http://www.karlrunge.com/x11vnc/ might be what you're looking for :?:
That explains the behaviour of the 'regular' VNC nicely, thanks. ie VNC creates a 'virtual' instance of the GUI that is separate from what is seen locally.

I've only used VNC on Windows machines previously so the behaviour is subtly different.

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4205
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: Launching apps remotely

Sat Jun 23, 2012 7:02 am

It would be better (for some meanings of "better") to run an X server on the other PC.

If you use VNC then the RaspPi has to run not only the X server but also the VNC server. Both of those are very hungry.

If you run an X server on your PC, then the RaspPi does not run either of them, just the application.

User avatar
Newt_Othis
Posts: 20
Joined: Tue Dec 06, 2011 1:12 pm

Re: Launching apps remotely

Sat Jun 23, 2012 9:01 am

@rurwin - I'm not really sure what you mean by running an X Server on the PC.

Google will be my friend on this one...

BTW - Have you seen today's Google Doodle? Simply brilliant.

User avatar
geep999
Posts: 28
Joined: Fri May 18, 2012 10:20 pm
Location: East Herts, UK
Contact: Website

Re: Launching apps remotely

Sat Jun 23, 2012 9:45 am

I used the instructions here:
http://www.caslab.queensu.ca/LabHelp/XServer/
and downloaded the referenced Xserver and Putty onto Vista (32bit).
VMware Player on Slackware host with Win Vista guest running an X server showing R-Pi running ARMedSlack forwarding X11 of xfce session:
Image

Cheers,
Peter

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: Launching apps remotely

Sun Jun 24, 2012 11:17 am

geep999 wrote:VMware Player on Slackware host with Win Vista guest running an X server showing R-Pi running ARMedSlack forwarding X11 of xfce session:
Image
:shock: You do realise that Slackware also comes with an X-server, right?! So there's no need for VMware and Vista in the middle of that "stack".
Unless you're being deliberately obtuse, of course ;)

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4205
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: Launching apps remotely

Sun Jun 24, 2012 10:40 pm

Newt_Othis wrote:@rurwin - I'm not really sure what you mean by running an X Server on the PC.
X is a windowing system that runs in user-space. It is not tied to Linux. The server receives commands on a network connection. Most of the time we use it, the client program is on the same machine as the X server, but it doesn't have to be.

So if you run an X server on your windows PC, then the client program can be on the RaspPi. X does not have to run on the RaspPi and you do not need VNC, nor a Linux VM. Just an X server ported to Windows. Then any of the programs that run on the RaspPi will work perfectly with their display on the Windows PC.

All you need to do is to have an SSH terminal session and set up the DISPLAY environment variable to point to your Windows PC, but Xming linked to above has tools that do that automatically. You can have the RaspPi desktop in a Windows window, or have each RaspPi window open independently on the Windows desktop.

Just one Windows application to install; easy as Pi ;-)

geep999 has it right; Windows Vista acting as an X display for the RaspPi. It's just that Windows Vista happens to be a VM on a Linux box; those of us running Linux tend not have real Windows PCs handy. I've got an old Windows 2000 laptop around here, I'll see if I can set it up tomorrow and write a howto.

@AndrewS, geep999 is showing how it works with a Windows PC. Yes he could do it directly on Slackware, but that's not the point we are trying to demonstrate.

User avatar
geep999
Posts: 28
Joined: Fri May 18, 2012 10:20 pm
Location: East Herts, UK
Contact: Website

Re: Launching apps remotely

Tue Jun 26, 2012 10:23 pm

AndrewS wrote:Unless you're being deliberately obtuse, of course ;)
I was just playing around to see what's possible, and thought it made a nice screenshot. :)
Cheers,
Peter

Return to “Beginners”

Who is online

Users browsing this forum: Anne_Carlill and 43 guests