LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > 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.

Notices

Reply
 
Search this Thread
Old 07-27-2006, 02:51 AM   #1
DaneM
Member
 
Registered: Oct 2003
Location: Chico, CA, USA
Distribution: Linux Mint
Posts: 734

Rep: Reputation: 78
Trying to tunnel X over SSH


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
 
Old 07-27-2006, 03:08 AM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
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.
 
Old 07-27-2006, 03:16 AM   #3
Electro
Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
Go to http://www.tldp.org/HOWTO/XDMCP-HOWTO/ssh.html
 
Old 07-27-2006, 03:26 AM   #4
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 48
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.
 
Old 07-27-2006, 03:29 AM   #5
DaneM
Member
 
Registered: Oct 2003
Location: Chico, CA, USA
Distribution: Linux Mint
Posts: 734

Original Poster
Rep: Reputation: 78
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
 
Old 07-27-2006, 03:40 AM   #6
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 48
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
 
Old 07-27-2006, 11:16 AM   #7
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 14,775

Rep: Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614
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.
 
Old 07-27-2006, 12:48 PM   #8
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,023

Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
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.
 
Old 07-27-2006, 01:05 PM   #9
doublejoon
Member
 
Registered: Oct 2003
Location: King George, VA
Distribution: RHEL/CentOS/Scientific/Fedora, LinuxMint
Posts: 366

Rep: Reputation: 44
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
 
Old 07-27-2006, 04:06 PM   #10
DaneM
Member
 
Registered: Oct 2003
Location: Chico, CA, USA
Distribution: Linux Mint
Posts: 734

Original Poster
Rep: Reputation: 78
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
 
Old 07-27-2006, 11:09 PM   #11
DaneM
Member
 
Registered: Oct 2003
Location: Chico, CA, USA
Distribution: Linux Mint
Posts: 734

Original Poster
Rep: Reputation: 78
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
 
Old 07-28-2006, 12:51 AM   #12
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,555

Rep: Reputation: 463Reputation: 463Reputation: 463Reputation: 463Reputation: 463
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.
 
Old 07-28-2006, 03:05 AM   #13
evilDagmar
Member
 
Registered: Mar 2005
Location: Right behind you.
Distribution: NBG, then randomed.
Posts: 480

Rep: Reputation: 31
Never, ever, use `xhost +`. This disables access control entirely for X.
 
Old 07-28-2006, 03:15 AM   #14
DaneM
Member
 
Registered: Oct 2003
Location: Chico, CA, USA
Distribution: Linux Mint
Posts: 734

Original Poster
Rep: Reputation: 78
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
 
Old 08-13-2006, 12:15 AM   #15
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: san antonio, texas
Distribution: Fedora 64 bit RAID0 + LUKS, CentOS (server), Backtrack, Gentoo Hardened
Posts: 1,441

Rep: Reputation: 81
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
 
  


Reply


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 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


All times are GMT -5. The time now is 03:08 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
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration