LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 04-10-2003, 11:01 AM   #1
deckmoney
LQ Newbie
 
Registered: Apr 2003
Distribution: Mandrake 9.1
Posts: 20

Rep: Reputation: 0
Launching X Program from SSH


Quick question: If I'm SSH into a machine that has X running, how do I issue commands on the SSH session to launch programs in the current X display?

For example, I just upgraded GAIM, but before I upgraded it I closed the program. Now I'm trying to launch gaim again, only I'm SSHed in from work. I thought I could do like "gaim 0:0" and that would launch it on the "0" display, but that isn't right. I know VNCing in would be easier, but this is just something I think I should know!!!

Thanks!
 
Old 04-10-2003, 11:27 AM   #2
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
export DISPLAY=localhost:0
followed by gaim.

If you have a running X server at the ssh client end, you can run gaim ( and what not ) on the ssh server side and see the display on the ssh client end. I configure kernels ( make xconfig ) and compile my kernels at work so that when I go home, it's all good to go. in this case you dont have to worry about setting the DISPLAY env variable since ssh can take care of it automatically. Just enable X11 forwarding on the SSH server and client configs.
 
Old 04-10-2003, 01:37 PM   #3
footfrisbee
Member
 
Registered: Apr 2003
Distribution: Debian Sarge
Posts: 259

Rep: Reputation: 30
Don't forget the "-X" switch on the commandline.
Code:
$ ssh -X user@foo.com
 
Old 04-10-2003, 01:44 PM   #4
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
If you have X11forwarding=yes in the client config which is the default, you wont need a -X flag.
 
Old 04-16-2003, 04:34 PM   #5
deckmoney
LQ Newbie
 
Registered: Apr 2003
Distribution: Mandrake 9.1
Posts: 20

Original Poster
Rep: Reputation: 0
Thank you both for your replies; that worked great for me. I'm still having problems launching x0rfbserver remotely (it normally popsup a menu asking for input), so I posted on the Software forum hoping for a helpful reply. I have found a few switches for the command, but there is no documentation for them. I will try them later. Thanks again!
 
  


Reply



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
Launching a program as root without using the terminal Crushing Belial Linux - Software 2 11-20-2005 10:38 PM
Running Program Through SSH windisch Linux - General 6 10-04-2005 06:10 AM
opening a gui program through ssh snumpy Linux - Newbie 7 02-07-2005 11:20 PM
using console after launching a program off it Lechium Linux - Newbie 3 08-07-2004 02:37 AM
launching a program from a C++ application Error1312 Programming 7 02-25-2004 08:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:47 PM.

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