Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ssh X-forwarding on headless (no monitor) system [SOLVED]
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
tinytim
n00b
n00b


Joined: 08 Sep 2005
Posts: 19

PostPosted: Sun Sep 12, 2010 8:58 am    Post subject: ssh X-forwarding on headless (no monitor) system [SOLVED] Reply with quote

Hi

Not the problem: I have a number of desktop systems running and can ssh between them without any difficulties using ssh -Y . When typing "emacs", for example, the editor opens in a separate window. Fantastic, this is exactly what I want.
Problem: I also have a headless system (no monitor, no keyboard) running to which I can connect via ssh, but cannot get the applications to open in a new window on my desktop (tried xclock and emacs). The sshd_config does contain the line 'X11Forwarding yes' all other options were left default (openssh-5.5_p1-r2) (this works fine for connecting to the other desktops)

Use flags on the headless system have X enabled, Xorg-server is installed and I even tried installing twm and xterm in frustration trying to get any kind of X-response from the system.

oh, and starting xdm does not help either as Xorg dies on me with a "Fatal server error:no screens found"; but that is more or less expected on a headless system. The question here is do I need to start xdm at all?

I suppose I am missing some key package or service or forgetting to start sth. critical, but which and how?


Last edited by tinytim on Sun Sep 12, 2010 10:12 am; edited 1 time in total
Back to top
View user's profile Send private message
Kobboi
l33t
l33t


Joined: 29 Jul 2005
Posts: 672
Location: Belgium

PostPosted: Sun Sep 12, 2010 9:18 am    Post subject: Reply with quote

No, I have just turned off X on my remote system and was able to run its xclock on my laptop.
Back to top
View user's profile Send private message
vivaceious
n00b
n00b


Joined: 08 Sep 2010
Posts: 31
Location: San Francisco, USA

PostPosted: Sun Sep 12, 2010 9:21 am    Post subject: Reply with quote

can you ssh -Yv and see if the verbose option gives any additional output that might clue you in as to what's going on? :)
i also confirmed Kobboi's findings just now
Back to top
View user's profile Send private message
tinytim
n00b
n00b


Joined: 08 Sep 2005
Posts: 19

PostPosted: Sun Sep 12, 2010 9:21 am    Post subject: Reply with quote

great. so xdm is not needed as a service for x-forwarding to work.

then the question remains: How do I get X-forwarding to work from the headless system?
Back to top
View user's profile Send private message
tinytim
n00b
n00b


Joined: 08 Sep 2005
Posts: 19

PostPosted: Sun Sep 12, 2010 9:27 am    Post subject: Reply with quote

the output of ssh -YV does not seem to give me any clues, but here it is in case I missed sth.
Code:

OpenSSH_5.3p1, OpenSSL 0.9.8n 24 Mar 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to xxx.xxx.xxx.xxx port 22.
debug1: Connection established.
debug1: identity file /home/name/.ssh/identity type -1
debug1: identity file /home/name/.ssh/id_rsa type -1
debug1: identity file /home/name/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.5
debug1: match: OpenSSH_5.5 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'xxx.xxx.xxx.xxx' is known and matches the RSA host key.
debug1: Found key in /home/name/.ssh/known_hosts:2
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /home/name/.ssh/identity
debug1: Trying private key: /home/name/.ssh/id_rsa
debug1: Trying private key: /home/name/.ssh/id_dsa
debug1: Next authentication method: keyboard-interactive
Password:
debug1: Authentication succeeded (keyboard-interactive).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: Requesting X11 forwarding with authentication spoofing.
Last login: Sun Sep 12 12:36:58 CEST 2010 from xxx.xxx.xxx.xxx on pts/1
Back to top
View user's profile Send private message
Kobboi
l33t
l33t


Joined: 29 Jul 2005
Posts: 672
Location: Belgium

PostPosted: Sun Sep 12, 2010 9:28 am    Post subject: Reply with quote

Did you set the display offset in sshd_config?
Back to top
View user's profile Send private message
vivaceious
n00b
n00b


Joined: 08 Sep 2010
Posts: 31
Location: San Francisco, USA

PostPosted: Sun Sep 12, 2010 9:29 am    Post subject: Reply with quote

oh oops after you've opened the ssh connection with -v, you might then try to run xclock or *any* X application and see what the verbose option spits out at you in the way of extra errors?
sorry I'm stabbing in the dark as I'm relatively new to X11 forwarding over SSH

also: did u try to change the X11UseLocalHost option? i *think* that option is about correcting for some kind of error
Back to top
View user's profile Send private message
tinytim
n00b
n00b


Joined: 08 Sep 2005
Posts: 19

PostPosted: Sun Sep 12, 2010 9:35 am    Post subject: Reply with quote

Kobboi

The default setting (and I use that) is: X11DisplayOffset 10

vivaceious

trying this for emacs the output is:
Code:

Home$ ssh -Yv root@headless emacs
OpenSSH_5.3p1, OpenSSL 0.9.8n 24 Mar 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to xxx.xxx.xxx.xxx port 22.
debug1: Connection established.
debug1: identity file /home/name/.ssh/identity type -1
debug1: identity file /home/name/.ssh/id_rsa type -1
debug1: identity file /home/name/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.5
debug1: match: OpenSSH_5.5 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'xxx.xxx.xxx.xxx' is known and matches the RSA host key.
debug1: Found key in /home/name/.ssh/known_hosts:2
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /home/name/.ssh/identity
debug1: Trying private key: /home/name/.ssh/id_rsa
debug1: Trying private key: /home/name/.ssh/id_dsa
debug1: Next authentication method: keyboard-interactive
Password:
debug1: Authentication succeeded (keyboard-interactive).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: Requesting X11 forwarding with authentication spoofing.
debug1: Sending command: emacs
emacs: standard input is not a ttydebug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 1552, received 2104 bytes, in 0.0 seconds
Bytes per second: sent 155463.3, received 210757.0
debug1: Exit status 1


So here a bit of sth. does happen, but the output is perfectly cryptic to me. I hope it means a bit more to you.

...and the X11UseLocalhost option is on by default (but now I set it explicitly --> no change)
Back to top
View user's profile Send private message
vivaceious
n00b
n00b


Joined: 08 Sep 2010
Posts: 31
Location: San Francisco, USA

PostPosted: Sun Sep 12, 2010 9:43 am    Post subject: Reply with quote

maybe something is hindering the DISPLAY variable?
Code:
$ env | grep DISPLAY

OR try manually
Code:
$ DISPLAY=localhost:10.0 emacs

last random thought before bed.... sorry i'm not much help lol
Back to top
View user's profile Send private message
tinytim
n00b
n00b


Joined: 08 Sep 2005
Posts: 19

PostPosted: Sun Sep 12, 2010 9:47 am    Post subject: Reply with quote

...
DISPLAY is not set on the headless system, setting it manually via 'export DISPLAY=localhost:0.0' does not help either. After that the DISPLAY is set, but emacs still only appears on the commend line and not in a separate window.
...and I get a message telling me :
Code:

Display localhost:0.0 unavailable, simulating -nw

(but how to resolve that is probably the whole crux of the problem)

Thanks for the try anyway, at least I have other people who share my ignorance partially :-)
Back to top
View user's profile Send private message
vivaceious
n00b
n00b


Joined: 08 Sep 2010
Posts: 31
Location: San Francisco, USA

PostPosted: Sun Sep 12, 2010 9:50 am    Post subject: Reply with quote

Quote:
setting it manually via 'export DISPLAY=localhost:0.0' does not help

naturally it wouldn't, since your X11 Display Offset is set to 10 by default...
Code:
$ export DISPLAY=localhost:10.0
$ emacs

:) maybe
Back to top
View user's profile Send private message
tinytim
n00b
n00b


Joined: 08 Sep 2005
Posts: 19

PostPosted: Sun Sep 12, 2010 9:54 am    Post subject: Reply with quote

using export DISPLAY=localhost:10.0 I get the same thing

Code:
Display localhost:10.0 unavailable, simulating -nw
Back to top
View user's profile Send private message
tinytim
n00b
n00b


Joined: 08 Sep 2005
Posts: 19

PostPosted: Sun Sep 12, 2010 10:12 am    Post subject: Reply with quote

Ok, that is a bit disappointing...

A reboot of the system fixed the problem. (Sometimes the approach for solving "windows problems" does work for linux too) now everything works as it should.
Back to top
View user's profile Send private message
Kobboi
l33t
l33t


Joined: 29 Jul 2005
Posts: 672
Location: Belgium

PostPosted: Sun Sep 12, 2010 11:08 am    Post subject: Reply with quote

tinytim wrote:
Ok, that is a bit disappointing...

A reboot of the system fixed the problem. (Sometimes the approach for solving "windows problems" does work for linux too) now everything works as it should.

Maybe you changed the sshd configuration without restarting it? Anyway, glad it works now.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum