Subject: Bug#1347: X2go ERROR 31 on NixOS

From: Jiahui Tang <[email-masked]>
Date: Fri, 23 Nov 2018 11:55:29 -0800

Package: x2goclient
Version: 4.1.2.1

I am trying to use x2goclient on NixOS, and installed x2go by "nix-env -iA
nixos.x2goclient" and x2goclient can run successfully. However, when I
tried to create a session to connect the terminal of a lxd container I
build before, I got an error looks like this:

Unable to find the sftp-server binary. Neither bundled, nor found in $PATH
> nor additional directories.

In my configuration.nix, I enabled ssh and also sftp by "
services.openssh.enable = true; services.openssh.allowSFTP = true;", so I
believe the sftp-binary was already installed in my system.  By the way,
actually I think I can access to the lxd container's terminal (got the
terminal on my screen), but once I clicked the ok button on the error
pop-up, the session would be aborted.

I am using NixOS 18.09 and X2go client version is 4.1.2.1. Thanks.

Regards,

Jiahui Tang

---

From: Mihai Moldovan <[email-masked]>
Date: Tue, 18 Jun 2019 12:38:39 +0200

We expect to find the sftp-server binary in a specific set of directories
(additionally to $PATH).

For NixOS, I added /run/current-system/sw/bin at some point. If you setup a
special environment, i.e., creating something like /run/nixos.x2goclient/
instead of the default current-system name, I'm afraid you'll have to patch X2Go
Client yourself.

Alternatively, is there any way to detect what directory SHALL be used? We can't
and shouldn't scan for all directories under /run, since even if one contains
the binary we're searching for, we won't know if it is the "system snapshot"
that the user INTENDED to use. However, maybe NixOS sets up a special
environment variable we could use for that - and replace the hardcoded
current-system string with the content of the env variable.

Mihai