Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
05-07-2011, 02:34 PM
|
#1
|
LQ Newbie
Registered: Aug 2009
Location: Chicago
Distribution: Debian Testing, Arch, Ubuntu 12.04
Posts: 12
Rep:
|
X forwarding though SSH not working: $DISPLAY not set
I am trying to redirect my display from a debian box that I ssh into to my laptop. I connect using
Code:
$ssh -vv -XC remote.host
and in the debug messages all I get about X is this
Code:
debug1: Requesting X11 forwarding with authentication spoofing.
Once I'm connected, X forwarding does not work. For example, when I try and start, say, xcalc, I get
Code:
$xcalc &
Error: Can't open display:
It seems that the problem is the $DISPLAY variable is not set on the remote machine (echo $DISPLAY doesn't return anything), but from what I read, sshd is responsible for setting this variable, as long as "X11Forwarding yes" is uncommented in the /etc/ssh/sshd_config file (which I made sure is true).
Is there any other reason why sshd won't open a display on the remote host?
|
|
|
05-07-2011, 02:58 PM
|
#2
|
Senior Member
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350
Rep:
|
Try with "Y" instead of "X" - $ssh -vv -YC remote.host
|
|
|
05-07-2011, 06:51 PM
|
#3
|
LQ Newbie
Registered: Aug 2009
Location: Chicago
Distribution: Debian Testing, Arch, Ubuntu 12.04
Posts: 12
Original Poster
Rep:
|
Quote:
Originally Posted by pingu
Try with "Y" instead of "X" - $ssh -vv -YC remote.host
|
Already did. It makes no difference.
|
|
|
05-07-2011, 07:33 PM
|
#4
|
LQ Newbie
Registered: May 2011
Posts: 21
Rep:
|
Time to break out a tutorial and re create a headless O/S for use the way you want. I found that a properly configured box this way, is clever and valuable.
|
|
|
05-07-2011, 08:39 PM
|
#5
|
LQ Newbie
Registered: Aug 2009
Location: Chicago
Distribution: Debian Testing, Arch, Ubuntu 12.04
Posts: 12
Original Poster
Rep:
|
I had missed what might be a key debug message when trying to connect. Here it is:
Code:
debug2: x11_get_proto: /usr/X11R6/bin/xauth list unix:0.0 2>/dev/null
debug1: Requesting X11 forwarding with authentication spoofing.
Note that xauth is NOT in that location (/usr/X11R6/bin) on either local or remote machine.
Also, I checked the debug output on the server side, by running '/usr/bin/sshd -ddd' and then connecting to it. Here I found something interesting:
Code:
...
debug1: server_input_channel_req: channel 0 request x11-req reply 0
debug1: session_by_channel: session 0 channel 0
debug1: session_input_channel_req: session 0 req x11-req
debug3: sock_set_v6only: set socket 9 IPV6_V6ONLY
debug2: bind port 6010: Cannot assign requested address
debug3: sock_set_v6only: set socket 9 IPV6_V6ONLY
debug2: bind port 6011: Cannot assign requested address
...
debug2: bind port 6999: Cannot assign requested address
Failed to allocate internet-domain X11 display socket.
debug1: x11_create_display_inet failed.
...
This seems to have to do with IPV6, but I have no idea why. Can anyone help further?
Last edited by vlsd; 05-07-2011 at 08:51 PM.
Reason: extra debug output
|
|
|
05-07-2011, 09:00 PM
|
#6
|
LQ Newbie
Registered: Aug 2009
Location: Chicago
Distribution: Debian Testing, Arch, Ubuntu 12.04
Posts: 12
Original Poster
Rep:
|
OK, I solved it. Using that last debug message and Google I came over these two posts
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=595014
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=422327
Apparently, disabling ipv6 in any way messes with X forwarding in ssh, it turns out it's an openssh issue. The posts suggest two workarounds:
1. add '-4' to the options passed to sshd in /etc/default/ssh
2. add 'AddressFamily inet' in /etc/ssh/sshd_config
I did the second one and it worked. Phew! This one was a toughy.
|
|
1 members found this post helpful.
|
07-13-2012, 09:36 AM
|
#7
|
LQ Newbie
Registered: Jul 2012
Posts: 1
Rep:
|
Same problem in RedHat 6.3 after disabling ipv6.
Added "AddressFamily inet" (without quotes) to /etc/ssh/sshd_config and Eureka
Thanks a lot!!!
|
|
|
03-10-2013, 08:37 AM
|
#8
|
LQ Newbie
Registered: Mar 2013
Posts: 1
Rep:
|
Same problem on avlinux 6.0, same fix
thanx a lot
|
|
|
12-09-2013, 07:40 AM
|
#9
|
LQ Newbie
Registered: Jan 2004
Location: Lisbon, Portugal
Distribution: Arch
Posts: 6
Rep:
|
Quote:
Originally Posted by vlsd
|
Same problem in Debian jessie.
Thanks a lot.
Mektub
|
|
|
All times are GMT -5. The time now is 09:30 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
|
|