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. |
 |
|
07-27-2006, 02:51 AM
|
#1
|
|
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
|
|
|
|
07-27-2006, 03:08 AM
|
#2
|
|
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.
|
|
|
|
07-27-2006, 03:16 AM
|
#3
|
|
Guru
Registered: Jan 2002
Location: AZ
Distribution: Gentoo (2.6.16-gentoo-r12)
Posts: 5,316
|
|
|
|
|
07-27-2006, 03:26 AM
|
#4
|
|
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.
|
|
|
|
07-27-2006, 03:29 AM
|
#5
|
|
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
|
|
|
|
07-27-2006, 03:40 AM
|
#6
|
|
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
|
|
|
|
07-27-2006, 11:16 AM
|
#7
|
|
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.
|
|
|
|
07-27-2006, 12:48 PM
|
#8
|
|
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.
|
|
|
|
07-27-2006, 01:05 PM
|
#9
|
|
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
|
|
|
|
07-27-2006, 04:06 PM
|
#10
|
|
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
|
|
|
|
07-27-2006, 11:09 PM
|
#11
|
|
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
|
|
|
|
07-28-2006, 12:51 AM
|
#12
|
|
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.
|
|
|
|
07-28-2006, 03:05 AM
|
#13
|
|
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.
|
|
|
|
07-28-2006, 03:15 AM
|
#14
|
|
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
|
|
|
|
08-13-2006, 12:15 AM
|
#15
|
|
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
|
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 08:07 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
LQ Podcast
LQ Radio
|
|