LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace

Welcome to LinuxQuestions.org, a friendly and active Linux Community.

You are currently viewing LQ as a guest. By joining our community you will have access to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!

Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

Are you new to LinuxQuestions.org? Visit the following links:
Site Howto | Site FAQ | Sitemap | Register Now

If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.

Go Back   LinuxQuestions.org > Forums > Linux > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Reply
 
Thread Tools
Old 07-27-2006, 02:51 AM   #1
DaneM
Member
 
Registered: Oct 2003
Location: Chico, CA, USA
Distribution: Slackware, Suse, Ubuntu, Gentoo
Posts: 544
Trying to tunnel X over SSH


[Log in to get rid of this advertisement]
Hello, all.

I'm trying to tunnel X over SSH like this:

Code:
ssh -X dane@192.168.1.250
But it just puts me into a terminal on the remote machine, and when I try to start X, it tells me that, "Server is already active for display :0".

What am I doing wrong?

Thanks in advance.

--Dane
DaneM is offline     Reply With Quote
Old 07-27-2006, 03:08 AM   #2
Nylex
HCL Maintainer
 
Registered: Jul 2003
Location: Coventry/London, UK
Distribution: Slackware, FreeBSD
Posts: 5,074
You're not doing anything wrong, it's supposed to do that. Remember, SSH = secure shell. You can run graphical programs on the remote machine and they'll appear on your local machine, just enter the program name at the prompt as you would if you were running something from a terminal locally. If you need whole desktop access, I think you'll have to look into using VNC.
Nylex is offline     Reply With Quote
Old 07-27-2006, 03:16 AM   #3
Electro
Guru
 
Registered: Jan 2002
Location: AZ
Distribution: Gentoo (2.6.16-gentoo-r12)
Posts: 5,316
Go to http://www.tldp.org/HOWTO/XDMCP-HOWTO/ssh.html
Electro is offline     Reply With Quote
Old 07-27-2006, 03:26 AM   #4
spooon
Senior Member
 
Registered: Aug 2005
Location: Hell
Distribution: Fedora Core 5
Posts: 1,754
Quote:
Originally Posted by DaneM
and when I try to start X, it tells me that, "Server is already active for display :0".
You don't want to start X on the remote machine; because that won't do any good (you are not sitting in front of the remote machine) and you already have X running on the local machine. The point is you want remote programs to talk to X on the local machine.
spooon is offline     Reply With Quote
Old 07-27-2006, 03:29 AM   #5
DaneM
Member
 
Registered: Oct 2003
Location: Chico, CA, USA
Distribution: Slackware, Suse, Ubuntu, Gentoo
Posts: 544
Thanks for the replies!

I would ultimately like to have a full X session running like this, but I would like to also like to run individual applications instead of having to start the whole GUI (KDE/Gnome/XFCE/etc.).

When I ssh in and try to start "xclock", it says that it "failed to start on :0". If I export a different $DISPLAY value, it just says that it can't start on that display.

Any ideas?

--Dane
DaneM is offline     Reply With Quote
Old 07-27-2006, 03:40 AM   #6
spooon
Senior Member
 
Registered: Aug 2005
Location: Hell
Distribution: Fedora Core 5
Posts: 1,754
Quote:
Originally Posted by DaneM
When I ssh in and try to start "xclock", it says that it "failed to start on :0". If I export a different $DISPLAY value, it just says that it can't start on that display.
don't mess with $DISPLAY, just ssh in, and run it
spooon is offline     Reply With Quote
Old 07-27-2006, 11:16 AM   #7
TB0ne
Senior Member
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, Mandrake, RedHat, Gentoo, Slack
Posts: 1,184
Trying to tunnel X over SSH

Quote:
Originally Posted by DaneM
Thanks for the replies!

I would ultimately like to have a full X session running like this, but I would like to also like to run individual applications instead of having to start the whole GUI (KDE/Gnome/XFCE/etc.).

When I ssh in and try to start "xclock", it says that it "failed to start on :0". If I export a different $DISPLAY value, it just says that it can't start on that display.

Any ideas?

--Dane
On your local machine (where you're initiating the connection), execute "xhost <IP address of remote machine>" or "xhost +". The "xhost +" is fairly unsafe, and will let ANYONE start an X session on your local box.

This should allow the remote machine to fire up an X session (such as xclock or xlogo), on your local machine.

Another thing to check is to be sure your display manager is running and accepting XDMCP connections. Run a "ps -ef | grep dm", and look for your display manager (gdm, xdm, etc.). If you see it started with the --nolisten parameter, nothing will work. Your local X server isn't set up to accept incoming connections, period. I don't know what distro or DM you're using, so I can't suggest what to change to remove the --nolisten, if it's there.

Good luck.
TB0ne is offline     Reply With Quote
Old 07-27-2006, 12:48 PM   #8
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian Sid, Slax, Knoppix
Posts: 1,269
Quote:
Originally Posted by TB0ne
Another thing to check is to be sure your display manager is running and accepting XDMCP connections.
This is not necessary if you're tunnelling the connection over ssh.
haertig is offline     Reply With Quote
Old 07-27-2006, 01:05 PM   #9
doublejoon
Member
 
Registered: Oct 2003
Location: King George, VA
Distribution: RHEL/CentOS/Fedora, Debian, PCLinuxOS, Solaris 10
Posts: 332
I did this for ubuntu.. works great! Occasionally I need to restart gdm but not a big deal

http://ubuntuforums.org/showthread.p...ighlight=xdmcp
doublejoon is offline     Reply With Quote
Old 07-27-2006, 04:06 PM   #10
DaneM
Member
 
Registered: Oct 2003
Location: Chico, CA, USA
Distribution: Slackware, Suse, Ubuntu, Gentoo
Posts: 544
Thanks for all the replies!

I tried using "xhost 192.168.1.250" (the remote server's IP address), and "xhost +", but both give me the error,

Code:
xhost: unable to open display ""
Just for good measure, I ran "ps -ef | grep dm" on the server, and determined that kdm was not running with any options.

Thanks for posting the link to the How-To, doublejoon. Setting up a VNC server will probably be my next step once I manage to get single apps working.

I suppose some more information is in order. The server is running 64-bit Gentoo (fully-updated) with xorg 7.0 and XGL (using compiz). I am able to start up a non-XGL session, however, by running "startx". The client is running 32-bit Ubuntu-Dapper, also fully-updated.

I should probably also tell you all that basically, what I'm trying to do is to be able to administer the server (which also happens to be a desktop computer) remotely, such as from the other room, should the need arise (such as when I'm trying to do something on another computer at the same time). I'm hoping that once I get this working, it'll allow me to do it on other computers that I'll set up strictly as servers, so that I won't need to have a monitor attached to them in order to get at the tools I need.

Thanks again.

--Dane
DaneM is offline     Reply With Quote
Old 07-27-2006, 11:09 PM   #11
DaneM
Member
 
Registered: Oct 2003
Location: Chico, CA, USA
Distribution: Slackware, Suse, Ubuntu, Gentoo
Posts: 544
Hello again.

I just realized that I had missed one (obvious?) step: the X server wasn't running on my client box. Now I can run programs from the server on the Ubuntu computer!

Thanks for all our help; I'll probably move on to VNC next.

--Dane
DaneM is offline     Reply With Quote
Old 07-28-2006, 12:51 AM   #12
lleb
Member
 
Registered: Dec 2005
Posts: 544
just an FYI, VNC is slow no matter what the platform.

there are several thinclient type apps out there for linux that will give you a new xwindow on a remote system that are not near as laggy as vnc.

i do use x11vnc on one of my computers, but that is just because it is easy to not muck with much, but now that i have it hooked up to a HDTV i no longer use the x11vnc as i can read the screen on the TV clearly now vs when it was on a standard TV.
lleb is offline     Reply With Quote
Old 07-28-2006, 03:05 AM   #13
evilDagmar
Member
 
Registered: Mar 2005
Location: Right behind you.
Distribution: NBG, then randomed.
Posts: 480
Never, ever, use `xhost +`. This disables access control entirely for X.
evilDagmar is offline     Reply With Quote
Old 07-28-2006, 03:15 AM   #14
DaneM
Member
 
Registered: Oct 2003
Location: Chico, CA, USA
Distribution: Slackware, Suse, Ubuntu, Gentoo
Posts: 544
Thanks for the tips. I'm currently looking into FreeNX for performance reasons, and have only used "xhost +" for testing purposes. It's set back to defaults now.

Have a good one.

--Dane
DaneM is offline     Reply With Quote
Old 08-13-2006, 12:15 AM   #15
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: san antonio, texas
Distribution: Ubuntu 7.10 64 bit, CentOS, GNU FreeDOS, Haiku, Plan 9 in qemu, gOS, Backtrack 3
Posts: 1,023
easy solution. dont let anyone tell you that you cant do it. login to a computer with ssh using X forwarding and type this command.

startx -- :1

You aleady have X running on :0 so you need to run X on :1
fakie_flip is offline     Reply With Quote

Reply

Submit thread to Digg | Submit thread to del.icio.us | Submit to LQ Bookmarks

« Back to Top »

Thread Tools

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
SSH tunnel help ZST Linux - Networking 2 07-05-2006 01:35 PM
SSH Tunnel - need some help on this MeridianRebel Linux - Networking 2 08-11-2005 02:10 PM
ssh tunnel crep Linux - Networking 2 08-25-2004 08:24 PM
ssh tunnel TroelsSmit Linux - Software 2 04-30-2004 03:30 PM
Ssh Tunnel tinaa Linux - Software 7 07-29-2003 07:52 PM



Add LQ To Your Yahoo Add LQ To Your Google Add LQ To Your MSN Add LQ To Your Blog
All times are GMT -5. The time now is 08:07 AM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Open Source Consulting | Domain Registration