Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 04-13-2009, 09:38 AM   #1
Registered: Mar 2007
Posts: 180

Rep: Reputation: 17
how do I start a gui application and the Desktop on a remote computer threw ssh

I have an ssh question that I have not been able to figure out.

I am sitting in front of computer A on computer B I would like to start mplayer and have it display a movie on computer B's screen. I think a better question might be how do I start a gui application and the Desktop on a remote computer threw ssh.


[Partial SOLUTION]

Problem 1

To start say mplayer on the remote machine do the following.

Local Machine
Log into the remote machine.
ssh me@

Remote Machine
export DISPLAY=:0

mplayer ILoveLindyLex.avi

Now mplayer will play on the remote machine.

Problem 2.

How do I start the remote desktop?

I got this solution from askvictor1 on IRC "openssh" channel on Freenode network.

Thanks, Lindylex

Last edited by lindylex; 04-14-2009 at 10:06 AM.
Old 04-14-2009, 06:40 PM   #2
Senior Member
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 404Reputation: 404Reputation: 404Reputation: 404Reputation: 404
the answer depends.. if both systems are running linux and both already have running desktops then the answer would be, from computer b, ssh -X computer a, log in, then run mplayer and it should automatically forward mplayer from computer a to b
mind you full frame video might be laggy via network

you could also use xinit to start another X session with nothing but an xterm, ssh -X computer a, gnome-session& (or whatever desktop you want to run..) then run your application as normal.

but if videos on computer a playing on computer b is all you want then nfs is probably better

just add a line as such to /etc/exports on comp a
/path_to_video    ip.addr.of.compb(rw,root_squash)
then restart nfs services (/etc/init.d/nfs restart or perhaps /etc/init.d/nfs-kernel-server restart)
then add on comp b's /etc/fstab
/mount_point_for_videos   ip.addr.of.compa:/path_to_video nfs defaults 0 0
and then mount network share and play them as if they were local

Last edited by frieza; 04-14-2009 at 06:43 PM.
Old 04-21-2009, 08:40 AM   #3
Registered: Mar 2007
Posts: 180

Original Poster
Rep: Reputation: 17
frieza, or any one else reading this. I am sorry if I confused you. My goal is not to display anything on computer A from computer B. I want to use computer A as full remote control for computer B threw ssh. Currently my first solution works well for starting gui apps on computer B.

Solution 1 start GUI apps on computer B

To start say mplayer on the remote machine do the following.

Local Machine
Log into the remote machine.
ssh me@
Remote Machine
export DISPLAY=:0
mplayer ILoveLindyLex.avi
I still would like to know if it is possible to start the desktop without forwarding it since I do not use a login manager on computer B.

Old 04-21-2009, 08:59 AM   #4
Registered: Oct 2003
Location: Chennai
Distribution: Slackware 12.1
Posts: 165

Rep: Reputation: 36

Unless you do as suggested frieza you would not be able to open any gui on computer B and see it.

The way I see it, local machine is computer A and you want to run graphical applications on computer B !

The Partial Solution provided by you will run mplayer on computer B, but you will not be able to see it on your local machine (computer A), since you are setting the display to computer B. And if this is exactly what you want, then to start the desktop all you have to do is run the desktop application. For gnome that would be gnome-session.
Old 04-21-2009, 09:00 AM   #5
Senior Member
Registered: Dec 2005
Distribution: Slackware -current, 14.2
Posts: 1,089

Rep: Reputation: 197Reputation: 197
If I understand you correctly, once you're logged into B from A, you should be able to start a Desktop on B thusly:

$ startx -- :0
If you need the ability to see this desktop from A, you'll have to ensure that x11vnc (or FreeNx, et al) starts when X starts, then you can connect separately.


Last edited by mrclisdue; 04-21-2009 at 09:04 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using DSL and ssh / ssh-server to access the Windoze desktop GUI On2ndThought Linux - Server 4 11-16-2008 03:17 PM
Remote desktop software to control desktop GUI? Phaethar Linux - Software 3 06-27-2008 10:30 AM
Remote login with SSH, but display on remote computer. brodin Linux - Software 3 09-09-2007 04:01 AM
How do you connect to another computer and use an application running on it remote? zahadumy Linux - Software 8 05-19-2006 05:43 PM
Running remote application through SSH tuananhbirm Linux - General 1 11-15-2005 03:42 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:28 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration