We help IT Professionals succeed at work.

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

adgarcia13
adgarcia13 asked
on
Medium Priority
1,861 Views
Last Modified: 2012-05-06
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
Comment
Watch Question

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?
CERTIFIED EXPERT
Top Expert 2007

Commented:
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'
adgarcia13Enterprise Architect

Author

Commented:

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
Maciej Ssysadmin
CERTIFIED EXPERT

Commented:
You should have Xserver running on the host, from which you are connecting.
Maciej Ssysadmin
CERTIFIED EXPERT

Commented:
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
Maciej Ssysadmin
CERTIFIED EXPERT

Commented:
Oops.. sorry ai_ja_nai, I looked only on last post. I didn't see that you wrote it already.
np
adgarcia13Enterprise Architect

Author

Commented:
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.
Yuo need a  X client to connect to a X server. Putty simply is not; it's just a ssh/telnet client for Windows. Yes, it can allow X sessions encrypting and forwarding, but it can't display them.
You need a software that acts like a client, that are able to display X sessions, like the ones I suggested before

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
adgarcia13Enterprise Architect

Author

Commented:
Got it. Thanks, I'll look to secure the X client software you referred me to.

David
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.