LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Need help forwarding X11 via SSH (https://www.linuxquestions.org/questions/linux-networking-3/need-help-forwarding-x11-via-ssh-549208/)

buckwheat12 04-26-2007 11:17 AM

Need help forwarding X11 via SSH
 
I have two computers both running Debian (testing). The host PC has ssh installed and running, I'm using Putty on the client PC to make the ssh connection. I have no problems making the ssh connection and logging into the host with Putty, but when I try to run an application (gimp for instance) I'm getting the following message:

The application 'gimp' lost its connection to the display localhost:10.0;
Most likely the X server was shut down or you killed/destroyed the application.

Any help would be most appreciated.

MensaWater 04-26-2007 11:41 AM

PuTTY can establish the ssh connection with tunneling. However, PuTTY is NOT an "X Client". You have to run something else on your M$ Windoze machine to actually see the X windows.

Commercial Product
eXceed from Hummingbird (my favorite - been using its various versions for years)

Non-Commercial ("free") Product
xming - Built out of the Cygwin stuff
Seems to do OK but since I had eXceed before I got it I haven't really beaten on it. My co-worker has indicated there are some color/font issues he has seen but everything I did with it seemed to work OK.

buckwheat12 04-26-2007 11:48 AM

Actually the host and client PC are both running Debian (testing). I'm not using Windows. I also made sure the X11 forwarding was enabled in Putty as well, it is set to localhost:0.

MensaWater 04-26-2007 11:50 AM

Quote:

I'm using Putty on the client PC to make the ssh connection.
Why the hell would you be using PuTTY on a Debian box? Debian like all other Linux distros does ssh natively.

buckwheat12 04-26-2007 11:56 AM

What's the difference if I make the connection with Putty or make it via a terminal command?

MensaWater 04-26-2007 12:01 PM

Exactly HOW are you running PuTTY? I'm wondering if you're not doing some sort of DOS/Windows emulations (WINE or something like that) and running PuTTY in that environment. So far as I know there is no "PuTTY" port to install directly in Linux because its avowed purpose to allow Windoze machines to do telnet/ssh connections to UNIX/Linux machines.

Are you actually IN a GUI environent? If you open a "terminal" window (NOT PuTTY and not connected to remote side - just locally) and just type "xterm" does it open and xterm window on your screen?

MensaWater 04-26-2007 12:06 PM

OK I'm confused. I do see "UNIX source code" for PuTTY on their site but then in the FAQ at their site:
http://www.chiark.greenend.org.uk/~s....html#faq-what

It says:

Quote:

In really simple terms: you run PuTTY on a Windows machine, and tell it to connect to (for example) a Unix machine. PuTTY opens a window.
I've never heard of anyone using PuTTY on anything other than an Windoze machine.

buckwheat12 04-26-2007 12:07 PM

No, no emulators, I'm in Gnome. There is a putty package in Debian (as well as other distros I've used).... apt-get install putty. It looks and is configured identical to the Windows version.

MensaWater 04-26-2007 12:17 PM

My apologies. I'm now downloading the FC4 package using yum.

I'll see if it operates any differently than the one on my company provided Windoze machine and report back.

Make sure you don't have anything on the remote end that is explicitly setting the "DISPLAY" variable. The tunnel creates its own DISPLAY setting and you must use that rather than standard DISPLAY setting method to use the tunnel.

It isn't unsusual to have DISPLAY=<whatever>.#.# in one of your start up files (/etc/profile, /etc/bashrc, $HOME/.profile, $HOME/.bashrc) when you login. If you do that would overwrite the one that the tunnel is setting.

Also make sure you're not doing an "su - <user>" AFTER you open the tunnel. That would lose the DISPLAY variable as well.

MensaWater 04-26-2007 12:31 PM

OK I just did my test to a system where we purposefully block 6000 range ports because it is web facing. That is an HP-UX (UNIX) 11.11 host.

I was able to open a PuTTY session from Fedora Core 4 (FC4) to the HP-UX host successfully with X tunneling. I then ran "xterm" in that established window and it successfully sent the Xterm window back to my Gnome display on the my FC4 console.

Although the PuTTY on FC4 had some additional options not seen on the Windoze PuTTY I'd downloaded (may be time to update that) I didn't use any of those newer options. What I did use:
Under the "Tunnels"
Checked the box for "Enable X11 forwarding".
Kept the default selection for "MIT-Magic-Cookie-1"
Kept the default selection for "Local"
Did not select anything else or type anything in the boxes on that.

In the main Session window I had the host IP and selected ssh and let it use port 22 (default for ssh). I saved it with the host name then used this session. As noted it opened fine and successfully opened the tunnel which successfully sent the X application back to my originating FC4 box.

buckwheat12 04-26-2007 02:39 PM

I'll recheck my settings, I pretty much have the same setup. I'm away from the computer I was working on. I'll keep you posted when I get the change to try it again.

buckwheat12 04-30-2007 05:51 AM

OK, I got it to work. I had to remove localhost:0 from the "X display location" setting. Thanks.

MensaWater 04-30-2007 12:10 PM

Glad I could help. Nice that I learned something from the thread as well. My problem is I'm so accustomed to command line I sometimes forget to take GUI into account.

rob.rice 04-30-2007 04:41 PM

as a note both Xming and putty will run from a flash drive with out being installed to the windoze box
so will VNC and there is a VNC client and server built in to KDE from version 3.1 onward

think about that you can carry your linux box around in your pocket and run it from any wondbloze computer

manojkandoth 05-02-2007 12:24 AM

You can simply use the -X option while using ssh.

eg:-
#ssh -X <SYSTEMNAME>

This will help you to run remote systems graphics on your local system.


All times are GMT -5. The time now is 06:25 AM.