LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 05-07-2011, 01:34 PM   #1
vlsd
LQ Newbie
 
Registered: Aug 2009
Location: Chicago
Distribution: Debian
Posts: 12

Rep: Reputation: 0
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?
 
Old 05-07-2011, 01:58 PM   #2
pingu
Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 775

Rep: Reputation: 60
Try with "Y" instead of "X" - $ssh -vv -YC remote.host
 
Old 05-07-2011, 05:51 PM   #3
vlsd
LQ Newbie
 
Registered: Aug 2009
Location: Chicago
Distribution: Debian
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pingu View Post
Try with "Y" instead of "X" - $ssh -vv -YC remote.host
Already did. It makes no difference.
 
Old 05-07-2011, 06:33 PM   #4
CodeKrash
LQ Newbie
 
Registered: May 2011
Posts: 21

Rep: Reputation: 1
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.
 
Old 05-07-2011, 07:39 PM   #5
vlsd
LQ Newbie
 
Registered: Aug 2009
Location: Chicago
Distribution: Debian
Posts: 12

Original Poster
Rep: Reputation: 0
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 07:51 PM. Reason: extra debug output
 
Old 05-07-2011, 08:00 PM   #6
vlsd
LQ Newbie
 
Registered: Aug 2009
Location: Chicago
Distribution: Debian
Posts: 12

Original Poster
Rep: Reputation: 0
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.
 
  


Reply

Tags
debian, ipv6, openssh


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The difference in settings: console from desktop & ssh as DISPLAY not set when ssh in wikapuki Linux - Newbie 10 07-02-2010 09:44 AM
[SOLVED] X11 forwarding problem over ssh. Where DISPLAY is set? kaz2100 Linux - Software 3 09-27-2009 05:32 AM
X-forwarding in slack over SSH - unable to open display Old_Fogie Slackware 8 01-08-2007 04:59 PM
Can't get X forwarding working with SSH. pdeman2 Fedora 21 06-18-2006 02:38 PM
XDMCP display forwarding not working antaydos Linux - Networking 17 06-05-2003 03:55 PM


All times are GMT -5. The time now is 09:07 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration