GNU bug report logs -
#24049
GuixSD - problem with X11 forwarding
Previous Next
Reported by: myglc2 <myglc2 <at> gmail.com>
Date: Thu, 21 Jul 2016 16:52:02 UTC
Severity: normal
Merged with 22930,
23960
Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 24049 in the body.
You can then email your comments to 24049 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-guix <at> gnu.org
:
bug#24049
; Package
guix
.
(Thu, 21 Jul 2016 16:52:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
myglc2 <myglc2 <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-guix <at> gnu.org
.
(Thu, 21 Jul 2016 16:52:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
This is still open so I am moving it from user to bugs ...
From: myglc2 <myglc2 <at> gmail.com>
Subject: Re: guixSD - problem with X11 forwarding
Newsgroups: gmane.comp.gnu.guix.user
To: help-guix <at> gnu.org
Date: Mon, 29 Feb 2016 21:12:51 -0500 (20 weeks, 2 days, 14 hours ago)
ludo <at> gnu.org (Ludovic Courtès) writes:
> myglc2 <myglc2 <at> gmail.com> skribis:
>
>> On guixSD, with no packages installed in the login user profile, I get
>> 'X11 forwarding request failed on channel 0'
>
> [...]
>
>> debug1: channel 0: new [client-session]
>> debug1: Entering interactive session.
>> debug1: Requesting X11 forwarding with authentication spoofing.
>> debug1: Sending environment.
>> debug1: Sending env LANG = en_US.UTF-8
>> X11 forwarding request failed on channel 0
>
> Right, I see that as well.
>
> lshd gives some clues in /var/log/messages:
>
> Feb 23 18:14:09 localhost lshd[430]: lshd: Updating utmp for login failed (errno = 2): No such file or directory
> Feb 23 18:14:09 localhost lshd[430]: lshd: xauth invocation failed: exit code: 127
> Feb 23 18:14:33 localhost lshd[430]: lshd: Updating utmpx for logout failed (errno = 2): No such file or directory
> Feb 23 18:14:33 localhost lshd[430]: lshd: write_buffer: Attempt to write data to closed buffer.
> Feb 23 18:14:33 localhost lshd[430]: lshd: Disconnect for reason 11: disconnected by user
>
> Indeed, server_x11.c in lsh reads:
>
> #ifndef XAUTH_PROGRAM
> # define XAUTH_PROGRAM "/usr/X11R6/bin/xauth"
> #endif
>
> I believe this is fixed by commit da35acf.
[...]
Not, at lease, in my setup. I am running GuixSD built from git checkout ...
b006ba5 [behind 15] pull: Update the version string.
On the client, ssh produces ...
'X11 forwarding request failed on channel 0'
On the headless server (g1) in /var/log/messages ...
Jul 21 12:24:51 localhost lshd[381]: lshd: Failed to cd to `/tmp/.X11-unix' (errno = 2): No such file or directory
Jul 21 12:24:51 localhost lshd[381]: lshd: Updating utmp for login failed (errno = 2): No such file or directory
With this workaround ...
sudo mkdir /tmp/.X11-unix
sudo chmod 777 /tmp/.X11-unix
... if I log out and back in X11 forwarding "works" and in
/var/log/messages ...
Jul 21 12:33:44 localhost lshd[381]: lshd: Updating utmp for login failed (errno = 2): No such file or directory
When I logout, in /var/log/messages I see ...
Jul 21 12:36:06 localhost lshd[381]: lshd: Updating utmpx for logout failed (errno = 2): No such file or directory
Jul 21 12:36:06 localhost lshd[381]: lshd: write_buffer: Attempt to write data to closed buffer.
Jul 21 12:36:06 localhost lshd[381]: lshd: Disconnect for reason 11: disconnected by user
Of course, the workaround needs to be re-applied each time the server is
rebooted.
The system and user configs are attached below ;-)
[g1.scm (application/octet-stream, attachment)]
[system.scm (application/octet-stream, attachment)]
Information forwarded
to
bug-guix <at> gnu.org
:
bug#24049
; Package
guix
.
(Mon, 01 Aug 2016 10:19:02 GMT)
Full text and
rfc822 format available.
Message #10 received at 24049 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hi myglc2,
myglc2 <myglc2 <at> gmail.com> skribis:
> On the client, ssh produces ...
>
> 'X11 forwarding request failed on channel 0'
>
> On the headless server (g1) in /var/log/messages ...
>
> Jul 21 12:24:51 localhost lshd[381]: lshd: Failed to cd to `/tmp/.X11-unix' (errno = 2): No such file or directory
> Jul 21 12:24:51 localhost lshd[381]: lshd: Updating utmp for login failed (errno = 2): No such file or directory
>
> With this workaround ...
>
> sudo mkdir /tmp/.X11-unix
> sudo chmod 777 /tmp/.X11-unix
>
> ... if I log out and back in X11 forwarding "works"
I believe this is a bug in lshd fixed by something along the lines of
the attached patch.
Niels, what do you think?
(Strangely I can’t find equivalent code in OpenSSH.)
Thanks,
Ludo’.
[Message part 2 (text/x-patch, inline)]
--- /tmp/lsh-2.1/src/server_x11.c 2016-08-01 11:58:54.714647794 +0200
+++ /tmp/lsh-2.1/src/server_x11.c.new 2016-08-01 11:58:46.606563478 +0200
@@ -151,7 +151,7 @@ DEFINE_COMMAND(open_forwarded_x11)
#define X11_MIN_DISPLAY 10
#define X11_MAX_DISPLAY 1000
-/* FIXME: Create the /tmp/.X11-unix directory, if needed. Figure out
+/* FIXME: Figure out
* if and how we should use /tmp/.X17-lock. Consider using display
* "unix:17" instead of just ":17".
*/
@@ -253,6 +253,7 @@ open_x11_socket(struct ssh_channel *chan
old_umask = umask(0077);
+ mkdir(X11_SOCKET_DIR, S_IRWXU | S_IRWXG | S_IRWXO | S_ISVTX);
old_cd = lsh_pushd(X11_SOCKET_DIR, &dir, 0, 0);
if (old_cd < 0)
{
Information forwarded
to
bug-guix <at> gnu.org
:
bug#24049
; Package
guix
.
(Tue, 06 Oct 2020 04:05:03 GMT)
Full text and
rfc822 format available.
Message #13 received at 24049-done <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hello,
ludo <at> gnu.org (Ludovic Courtès) writes:
[...]
> I believe this is a bug in lshd fixed by something along the lines of
> the attached patch.
>
> Niels, what do you think?
>
> (Strangely I can’t find equivalent code in OpenSSH.)
>
> Thanks,
> Ludo’.
>
> --- /tmp/lsh-2.1/src/server_x11.c 2016-08-01 11:58:54.714647794 +0200
> +++ /tmp/lsh-2.1/src/server_x11.c.new 2016-08-01 11:58:46.606563478 +0200
> @@ -151,7 +151,7 @@ DEFINE_COMMAND(open_forwarded_x11)
> #define X11_MIN_DISPLAY 10
> #define X11_MAX_DISPLAY 1000
>
> -/* FIXME: Create the /tmp/.X11-unix directory, if needed. Figure out
> +/* FIXME: Figure out
> * if and how we should use /tmp/.X17-lock. Consider using display
> * "unix:17" instead of just ":17".
> */
> @@ -253,6 +253,7 @@ open_x11_socket(struct ssh_channel *chan
>
> old_umask = umask(0077);
>
> + mkdir(X11_SOCKET_DIR, S_IRWXU | S_IRWXG | S_IRWXO | S_ISVTX);
> old_cd = lsh_pushd(X11_SOCKET_DIR, &dir, 0, 0);
> if (old_cd < 0)
> {
I tried the above fix and ran a VM with the attached config (the custom
kernel stuff was to try something else at the same time). It fixes the
error about the directory, but it would still fail at X11 forwarding
(there was an error message: "Can't find any xauth information for X11
display").
I ended up figuring out it needed libxau to work; combined with your
patch, this fixes X11 forwarding.
Fixed in commit 0ec195ff02.
For the record, I've done the tests in a VM using the attached system
config. The custom kernel stuff is unrelated.
Thanks,
Closing,
Maxim
[config-custom-kernel.scm (text/plain, attachment)]
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Tue, 03 Nov 2020 12:24:06 GMT)
Full text and
rfc822 format available.
This bug report was last modified 4 years and 226 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.