Link to home
Start Free TrialLog in
Avatar of adgarcia13
adgarcia13Flag for United States of America

asked on

Putty and X11 Forwarding... (One more time...)

Greetings,

Have a copy of the Debian Putty client on Windows and while logged into a Redhat Enterprise Linux AS4 session trying to run "xclock &" and have it display the clock on my laptop. When I do I get the error:   Error: Can't open display: localhost:0.0

What am I doing wrong?

My setup is:

1. In putty session enable X11 forwarding and set "display location" to "localhost:0.0"
2. once logged into the Linux server issue the command: "DISPLAY=localhost:0.0"
3. In /etc/ssh/sshd_config set "X11Forwarding yes"
4. issue command "xclock &" and get the error....

I have also tried substituting "localhost" for map laptop's IP address and still nothing. I can also ping my laptop from the server successfully and disabled the client firewall on my laptop.

TIA,

David
Avatar of AdamsConsulting
AdamsConsulting
Flag of United States of America image

You likely don't need to set a display location for step 1, just enable X11 forwarding and leave that blank. This could be needed, depending on where your xwindows manager on windows is listening though.
You don't need to do step #2 and that may be messing you up.
Other than that, you just need an xwindows manager running on your windows workstation. I use Xming.

Did you restart SSH after enabling X11forwarding, and log back in?
Avatar of omarfarid
You just check the X forwarding box and do not specify any display. You need to have your X server started on your PC.
You don't have X server running, that's why you get error. putty can't act like a client, you have to use Cygwin/X (http://x.cygwin.com/) or WeirdX (http://www.jcraft.com/weirdx/) or xming (http://www.straightrunning.com/XmingNotes/).
Also, ensure that X is running on the server, by issuing 'startx'
Avatar of adgarcia13

ASKER


Sorry I should have been more clear. I am putty'd into a Linux Server on a different machine on the network. This Linux server is running an X Windows Manager/Server instance already.

There are no firewalls blocking traffic back to the laptop from the server, and I can ping the laptop from the Linux server just fine.

I have tried everything recommended above and still I get the following error on the Linux Server when I issue the command "xclock &" hoping the display will open on the laptop:

" Error: Can't open display: "

TIA,

David
You should have Xserver running on the host, from which you are connecting.
ok, try anyway what I suggested you before: Cygwin/X (http://x.cygwin.com/) or WeirdX (http://www.jcraft.com/weirdx/) or xming (http://www.straightrunning.com/XmingNotes/). They sure can do what you need
Oops.. sorry ai_ja_nai, I looked only on last post. I didn't see that you wrote it already.
Sorry if I am not getting your point. I believe what I hear you saying (from looking at the links you have sent me) is that I have to have an X Server running on my Windows machine as well?

The X server is already running on the Linux host, I am simply trying to get that X Server to open a display or Window on my laptop through my putty session.

Are you saying in order to do that I need 2 X Servers running? one on the Windows client and one on the Linux server?

The only thing running on my laptop at the moment is my debian putty client. I was under the assumption that the X Manager or Server on my Linux system would be able to open an X windows display on my laptop, by me simply using the putty client, setting X-11 forwarding, and once logged into the Linux Server via my putty session, have the X Windows manager or server on my Linux system open a display on my laptop.
ASKER CERTIFIED SOLUTION
Avatar of ai_ja_nai
ai_ja_nai
Flag of Italy image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Got it. Thanks, I'll look to secure the X client software you referred me to.

David