VectorLinux

The nuts and bolts => Networking & Security => Topic started by: Daniel on August 02, 2009, 02:10:50 pm

Title: controlling graphical applications on a computer over a network
Post by: Daniel on August 02, 2009, 02:10:50 pm
I have a computer that I'm not using right now and I would like to connect it to a tv and use it to show pictures and video and stuff on the tv. The media would come from somewhere on the network and the computer would be controlled over the network. I would need to control a video/music/picture application on that computer from another computer on the network (likely a linux computer since the currently unused computer has linux on it). Is there a good way to do this other than using VNC?
Title: Re: controlling graphical applications on a computer over a network
Post by: M0E-lnx on August 02, 2009, 03:29:57 pm
NX is a much better technology than vnc is.
Try my howto here
http://m0e-lnx.blogspot.com
Title: Re: controlling graphical applications on a computer over a network
Post by: rbistolfi on August 02, 2009, 05:12:51 pm
If you are going to do this from a LAN, a plain remote X login would be enough imho. You need to configure GDM to allow remote connections. Keep in mind that this will enable a insecure connection, so the involved ports shouldnt be accessible from the Internet.
Title: Re: controlling graphical applications on a computer over a network
Post by: Daniel on August 02, 2009, 05:32:16 pm
I'll use a VNC-like thing (freenx or remote X login maybe) if there's no other alternative but I was really looking for something else... Command-line driven even. Something like ssh where you can pull graphical X windows over the connection to see them except I want to run the graphical program but leave the window at the remote computer.
Title: Re: controlling graphical applications on a computer over a network
Post by: nightflier on August 02, 2009, 07:21:21 pm
You can tunnel X over SSH, but I have found it to be very slow. If you're on a fast LAN it may be usable.
Title: Re: controlling graphical applications on a computer over a network
Post by: Daniel on August 03, 2009, 06:50:14 am
nightflier: What exactly do you mean by "tunnel X over SSH"? Is that X11 Forwarding? I have used X11 Forwarding but I want to run graphical programs on the remote computer but leave the application's window at the remote computer so that the media could be viewed on the tv that the remote computer is connected to. If that's not what you mean, please elaborate.
Title: Re: controlling graphical applications on a computer over a network
Post by: uelsk8s on August 03, 2009, 07:48:16 am
http://www.karlrunge.com/x11vnc/
Title: Re: controlling graphical applications on a computer over a network
Post by: rbistolfi on August 03, 2009, 08:17:51 am
nightflier: What exactly do you mean by "tunnel X over SSH"? Is that X11 Forwarding? I have used X11 Forwarding but I want to run graphical programs on the remote computer but leave the application's window at the remote computer so that the media could be viewed on the tv that the remote computer is connected to. If that's not what you mean, please elaborate.

A simple ssh connection can do that iirc, try setting the DISPLAY variable as desired. For example, if the remote computer is 192.168.0.5 then

Code: [Select]
export DISPLAY=192.168.0.5:0.0
And you should be able to run X applications from the shell and display them in the remote box.
Title: Re: controlling graphical applications on a computer over a network
Post by: M0E-lnx on August 03, 2009, 09:00:34 am
You need to enable X11Forwarding on the server box
Just setting the DISPLAY will not work if X11 is not forwared.
You also need to tell it you want X during the connection by specifying the "-X" flag

ssh -X you@192.168.x.x

But if you really think about this, it is the reverse of what you need

If what you really need is to control a remote display and display it on both machines at the same time, then x11vnc is what you need
we have packages for that in the repos.
It even comes with a nice gui to setup the server.

X11vnc allows you to display the currently running display on a remote box, and control it from there too.

That is if you're not concerned about security
Title: Re: controlling graphical applications on a computer over a network
Post by: rbistolfi on August 03, 2009, 09:43:12 am
M0E: he doesnt want to forward X, he wants the application to be shown at the remote server :)
Title: Re: controlling graphical applications on a computer over a network
Post by: M0E-lnx on August 03, 2009, 10:26:27 am
So he needs a way to push a local app to display on a remote xserver then.
That's a little hard to do. and you can't really control the remote app. you can only run it.

which is why I would suggest x11vnc. You get to control the whole desktop
Title: Re: controlling graphical applications on a computer over a network
Post by: nightflier on August 03, 2009, 10:56:29 am
Yeah, with "X over SSH" I was referring to X11 forwarding. I thought you wanted to run a remote application in a local window.

As far as controlling a remote X app over the network using only command line, I wouldn't even know where to start.
Title: Re: controlling graphical applications on a computer over a network
Post by: Daniel on August 03, 2009, 11:02:36 am
Thanks for the suggestions. I think I might try x11vnc and ssh with exporting the display. Just to clarify, does exporting the display variable affect the local display or just send the X11 Forwarding back to the remote display?
Title: Re: controlling graphical applications on a computer over a network
Post by: M0E-lnx on August 03, 2009, 11:05:53 am
Think of X11 forwarding as in launching a remote GUI app on your local desktop.
FOr instance, You are @ box "A", and connect via ssh to Box "B" with X11 forwarding enabled on box "B"

if you were to launch a GUI app on box "B" over that ssh connection, the window will actually show up on your box "A"'s display.
The display on box "B" gets no change at all. it's as if nothing ever happened.
So it seems to me that is the oposite of what you need.
Title: Re: controlling graphical applications on a computer over a network
Post by: Daniel on August 03, 2009, 12:34:31 pm
Ok, I've used X11 Forwarding before but if I "export the display variable" to point to the remote display, does that keep the graphical applications on the remote machine so that they stay and show up on the remote display?
Title: Re: controlling graphical applications on a computer over a network
Post by: M0E-lnx on August 03, 2009, 12:39:14 pm
Yes... it will throw it to the remote display.
You have to remember though, you will not be able to control this app.
You wont be able to move it around the display or click anywhere on it. The remote client will have control over it
Title: Re: controlling graphical applications on a computer over a network
Post by: Daniel on August 06, 2009, 07:38:50 am
Does x11vnc have to be installed on both computers to work? or just on the local computer?
Title: Re: controlling graphical applications on a computer over a network
Post by: M0E-lnx on August 06, 2009, 08:34:48 am
x11vnc needs to be installed on the server box
you can get away with tightvnc for the client.

Not sure if x11vnc includes a vncviewer, I know tightvnc does
Title: Re: controlling graphical applications on a computer over a network
Post by: Daniel on August 08, 2009, 06:17:29 pm
Ok, I installed TightVNC, started the vncserver and I am accessing the vncserver via a browser. When I log in, I see nothing but a terminal window and a gray/black background. I have to start the desktop and taskbar manually. (unless I add them to the file that is executed when I log in) I move the mouse around and open applications and stuff but none of that is showing up on the remote monitor. Is there a way to make stuff show up on the remote monitor? I also tried x11vnc and it does make stuff show up on the remote monitor. I can use x11vnc but I really liked being able to access the computer via a web browser.
Title: Re: controlling graphical applications on a computer over a network
Post by: nightflier on August 08, 2009, 07:20:46 pm
As far as I know, TightVNC can not access the primary display in *nix.

Accessing the remote display via a browser is mainly for when you are on a computer where you don't have administrative rights, and can not install the vncviewer. The browser applet is not as efficient as the dedicated client, though.