ArcticaProject / nx-libs

nx-libs
Other
120 stars 39 forks source link

nxagent 3.5.99.26 does not work on Alpine. #1057

Closed ouziel-slama closed 1 year ago

ouziel-slama commented 1 year ago

Hello,

nxagent stops immediately with always the same error message: "'Unable to open display 'nx/nx:5":

$ DISPLAY='nx/nx:5' nxagent -ac -R :5

NXAGENT - Version 3.5.99.26

Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com)
Copyright (c) 2008-2014 Oleksandr Shneyder <o.shneyder@phoca-gmbh.de>
Copyright (c) 2011-2016 Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Copyright (c) 2014-2016 Ulrich Sibiller <uli42@gmx.de>
Copyright (c) 2014-2016 Mihai Moldovan <ionic@ionic.de>
Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com)
See https://github.com/ArcticaProject/nx-libs for more information.

Info: Agent running with pid '8515'.
Session: Starting session at 'Wed May 10 18:01:22 2023'.
Error: Aborting session with 'Unable to open display 'nx/nx:5''.
Session: Aborting session at 'Wed May 10 18:01:22 2023'.
Session: Session aborted at 'Wed May 10 18:01:22 2023'.

I did add an entry with xauth:

$ xauth list
office/unix:5  MIT-MAGIC-COOKIE-1  ca845d86031a59eebca91ac04e295a01

(The original DISPLAY is much larger and I don't use -ac but it behaves exactly the same.)

Unfortunately I can't get more information about the error either in /var/log/ or using DISPLAY=nx/nx,errors=~/errors:5,root=~/. The only clue I have is nxproxy -C $DISPLAY works perfectly with the same values!

Thank you in advance for the help.

uli42 commented 1 year ago

Hi,

I am not exactly sure what happens here. But please try if

DISPLAY='nx/nx,link=adsl:5'

makes any difference here. Maybe the parsing is flaky here and should be improved.

Instead of using DISPLAY you should also be able to use the -display options. Does that make any difference?

Uli

On Wed, May 10, 2023 at 6:30 PM Ouziel Slama @.***> wrote:

Hello,

nxagent stops immediately with always the same error message: "'Unable to open display 'nx/nx:5":

$ DISPLAY='nx/nx:5' nxagent -ac -R :5

NXAGENT - Version 3.5.99.26

Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) Copyright (c) 2008-2014 Oleksandr Shneyder @.> Copyright (c) 2011-2016 Mike Gabriel @.> Copyright (c) 2014-2016 Ulrich Sibiller @.> Copyright (c) 2014-2016 Mihai Moldovan @.> Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) See https://github.com/ArcticaProject/nx-libs for more information.

Info: Agent running with pid '8515'. Session: Starting session at 'Wed May 10 18:01:22 2023'. Error: Aborting session with 'Unable to open display 'nx/nx:5''. Session: Aborting session at 'Wed May 10 18:01:22 2023'. Session: Session aborted at 'Wed May 10 18:01:22 2023'.

I did add an entry with xauth:

$ xauth list office/unix:5 MIT-MAGIC-COOKIE-1 ca845d86031a59eebca91ac04e295a01

(The original DISPLAY is much larger and I don't use -ac but it behaves exactly the same.)

Unfortunately I can't get more information about the error either in /var/log/ or using DISPLAY=nx/nx,errors=~/errors:5,root=~/. The only clue I have is nxproxy -C $DISPLAY works perfectly with the same values!

Thank you in advance for the help.

— Reply to this email directly, view it on GitHub https://github.com/ArcticaProject/nx-libs/issues/1057, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQHBZEMRPTN7OAQUAAM3MTXFO7CZANCNFSM6AAAAAAX47AGEI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

ouziel-slama commented 1 year ago

Thank you for the answer! I tried with nx/nx,link=adsl:5 using DISPLAY and -display and it gives exactly the same thing :-/ What is curious is that nxproxy works well with the same arguments.. could this be a necessary dependency for nxagent but not for nxproxywhich is incorrectly installed?

uli42 commented 1 year ago

No, I don't think so. If any dependency was missing nxagent would not start at all. Please post the 'ldd nxagent' output.

What exactly are you trying to do? Did it work before? Have you tried the latest upstream nxagent from ArcticaProject?

Uli

On Thu, May 11, 2023 at 7:32 PM Ouziel Slama @.***> wrote:

Thank you for the answer! I tried with nx/nx,link=adsl:5 using DISPLAY and -display and it gives exactly the same thing :-/ What is curious is that nxproxy works well with the same arguments.. could this be a necessary dependency for nxagent but not for nxproxywhich is incorrectly installed?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

ouziel-slama commented 1 year ago

ah that's a clear error thank you :)

in as raspberrypi:

$ ldd nxagent
/lib/ld-musl-armhf.so.1: cannot load nxagent: No such file or directory

in a Lenovo Laptop:

$ ldd nxagent
/lib/ld-musl-x86_64.so.1: cannot load nxagent: No such file or directory

I'm trying to run an application installed on a raspberrypi on a connected laptop. I'm using nxagent on the RPI and nxproxy on the laptop through an ssh tunnel. The system was working fine on Arch Linux and I'm trying to migrate to Alpine. Didn't try yet to compile the latest upstream!

EDIT:

$ ls /lib/ld*
/lib/ld-musl-armhf.so.1

the file is here..

EDIT2: if that can help:

office3:~$ cat $(which ldd)
#!/bin/sh
exec /lib/ld-musl-armhf.so.1 --list "$@"

office3:~$ exec /lib/ld-musl-armhf.so.1 --version
musl libc (armhf)
Version 1.2.4
Dynamic Program Loader
Usage: /lib/ld-musl-armhf.so.1 [options] [--] pathname [args]

EDIT3: Ok sorry that's a better output:

~$ ldd /usr/bin/nxagent 
    /lib/ld-musl-x86_64.so.1 (0x7fd8002d1000)
    libX11.so.6 => /usr/lib/libX11.so.6 (0x7fd7ffae2000)
    libXcomp.so.3 => /usr/lib/libXcomp.so.3 (0x7fd8001de000)
    libXcompshad.so.3 => /usr/lib/libXcompshad.so.3 (0x7fd8001d1000)
    libXrender.so.1 => /usr/lib/libXrender.so.1 (0x7fd7ffad6000)
    libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x7fd7fface000)
    libXfont2.so.2 => /usr/lib/libXfont2.so.2 (0x7fd7ffaa0000)
    libXcomposite.so.1 => /usr/lib/libXcomposite.so.1 (0x7fd7ffa9b000)
    libXinerama.so.1 => /usr/lib/libXinerama.so.1 (0x7fd7ffa96000)
    libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x7fd7ffa8e000)
    libNX_X11.so.6 => /usr/lib/libNX_X11.so.6 (0x7fd7ff96c000)
    libXext.so.6 => /usr/lib/libXext.so.6 (0x7fd7ff95b000)
    libz.so.1 => /lib/libz.so.1 (0x7fd7ff941000)
    libXpm.so.4 => /usr/lib/libXpm.so.4 (0x7fd7ff930000)
    libxml2.so.2 => /usr/lib/libxml2.so.2 (0x7fd7ff81e000)
    libpixman-1.so.0 => /usr/lib/libpixman-1.so.0 (0x7fd7ff78f000)
    libpng16.so.16 => /usr/lib/libpng16.so.16 (0x7fd7ff75f000)
    libjpeg.so.8 => /usr/lib/libjpeg.so.8 (0x7fd7ff6dd000)
    libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7fd8002d1000)
    libxcb.so.1 => /usr/lib/libxcb.so.1 (0x7fd7ff6b6000)
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x7fd7ff400000)
    libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7fd7ff698000)
    libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0x7fd7ff693000)
    libXrandr.so.2 => /usr/lib/libXrandr.so.2 (0x7fd7ff687000)
    libXtst.so.6 => /usr/lib/libXtst.so.6 (0x7fd7ff67f000)
    libfontenc.so.1 => /usr/lib/libfontenc.so.1 (0x7fd7ff676000)
    libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x7fd7ff34d000)
    libbsd.so.0 => /usr/lib/libbsd.so.0 (0x7fd7ff663000)
    liblzma.so.5 => /usr/lib/liblzma.so.5 (0x7fd7ff316000)
    libXau.so.6 => /usr/lib/libXau.so.6 (0x7fd7ff65e000)
    libbz2.so.1 => /usr/lib/libbz2.so.1 (0x7fd7ff303000)
    libbrotlidec.so.1 => /usr/lib/libbrotlidec.so.1 (0x7fd7ff650000)
    libmd.so.0 => /usr/lib/libmd.so.0 (0x7fd7ff2f7000)
    libbrotlicommon.so.1 => /usr/lib/libbrotlicommon.so.1 (0x7fd7ff2d4000)
uli42 commented 1 year ago

On Thu, May 11, 2023 at 9:05 PM Ouziel Slama @.***> wrote:

ah that's a clear error thank you :)

in as raspberrypi:

$ ldd nxagent /lib/ld-musl-armhf.so.1: cannot load nxagent: No such file or directory

in a Lenovo Laptop:

$ ldd nxagent /lib/ld-musl-x86_64.so.1: cannot load nxagent: No such file or directory

I'm trying to run an application installed on a raspberrypi on a connected laptop. I'm using nxagent on the RPI and nxproxy on the laptop through an ssh tunnel. The system was working fine on Arch Linux and I'm trying to migrate to Alpine. Didn't try yet to compile the latest upstream!

  1. please retry with ldd which nxagent
  2. you seem to use a system that uses musl instead of glibc. I have never tried this so chances are that nxagent won't run with musl.
  3. there are multiple ways to establish an nx connection. Unfortunately I have forgotten the details. But you can check the example/test scripts provided in testscripts directory of the nx-libs source code. Or dig through the scripts installed by x2go-server.

HTH

Uli

ouziel-slama commented 1 year ago
  1. here the output:
    $ ldd `which nxagent`
    /lib/ld-musl-x86_64.so.1 (0x7f4adbb9f000)
    libX11.so.6 => /usr/lib/libX11.so.6 (0x7f4adba81000)
    libXcomp.so.3 => /usr/lib/libXcomp.so.3 (0x7f4adb30d000)
    libXcompshad.so.3 => /usr/lib/libXcompshad.so.3 (0x7f4adba74000)
    libXrender.so.1 => /usr/lib/libXrender.so.1 (0x7f4adba68000)
    libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x7f4adba60000)
    libXfont2.so.2 => /usr/lib/libXfont2.so.2 (0x7f4adba32000)
    libXcomposite.so.1 => /usr/lib/libXcomposite.so.1 (0x7f4adba2d000)
    libXinerama.so.1 => /usr/lib/libXinerama.so.1 (0x7f4adba28000)
    libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x7f4adba20000)
    libNX_X11.so.6 => /usr/lib/libNX_X11.so.6 (0x7f4adb1eb000)
    libXext.so.6 => /usr/lib/libXext.so.6 (0x7f4adba0f000)
    libz.so.1 => /lib/libz.so.1 (0x7f4adb9f5000)
    libXpm.so.4 => /usr/lib/libXpm.so.4 (0x7f4adb9e4000)
    libxml2.so.2 => /usr/lib/libxml2.so.2 (0x7f4adb0d9000)
    libpixman-1.so.0 => /usr/lib/libpixman-1.so.0 (0x7f4adb04a000)
    libpng16.so.16 => /usr/lib/libpng16.so.16 (0x7f4adb01a000)
    libjpeg.so.8 => /usr/lib/libjpeg.so.8 (0x7f4adaf98000)
    libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7f4adbb9f000)
    libxcb.so.1 => /usr/lib/libxcb.so.1 (0x7f4adaf71000)
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x7f4adac00000)
    libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7f4adaf53000)
    libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0x7f4adb9df000)
    libXrandr.so.2 => /usr/lib/libXrandr.so.2 (0x7f4adb9d3000)
    libXtst.so.6 => /usr/lib/libXtst.so.6 (0x7f4adaf4b000)
    libfontenc.so.1 => /usr/lib/libfontenc.so.1 (0x7f4adaf42000)
    libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x7f4adae8f000)
    libbsd.so.0 => /usr/lib/libbsd.so.0 (0x7f4adae7c000)
    liblzma.so.5 => /usr/lib/liblzma.so.5 (0x7f4adabc9000)
    libXau.so.6 => /usr/lib/libXau.so.6 (0x7f4adb9ce000)
    libbz2.so.1 => /usr/lib/libbz2.so.1 (0x7f4adae69000)
    libbrotlidec.so.1 => /usr/lib/libbrotlidec.so.1 (0x7f4adae5b000)
    libmd.so.0 => /usr/lib/libmd.so.0 (0x7f4adae4f000)
    libbrotlicommon.so.1 => /usr/lib/libbrotlicommon.so.1 (0x7f4adaba6000)
  2. given that nxproxy works with musl there is hope that nxagent too, right?
  3. it was by digging into the code of x2go-server that I managed to set up an nx connection which works well on Raspbian<->Arch and also on Arch<->Arch. Normally it should also work on Alpine<->Alpine if I manage to start nxagent :) moreover it works very well on Alpine<->Alpine just by replacing nxagent by nxproxy and keeping the same settings. In any case, I will immediately look at the examples in testscripts to see if I can find a clue!
ouziel-slama commented 1 year ago

Simply solved with:

LD_LIBRARY_PATH=/usr/lib/nx/X11/

Found the solution in the testscripts examples :)) thank you very much @uli42 for the help!

uli42 commented 1 year ago

On Fri, May 12, 2023 at 11:12 AM Ouziel Slama @.***> wrote:

here the output:

$ ldd which nxagent /lib/ld-musl-x86_64.so.1 (0x7f4adbb9f000) libX11.so.6 => /usr/lib/libX11.so.6 (0x7f4adba81000) ...

libNX_X11.so.6 => /usr/lib/libNX_X11.so.6 (0x7f4adb1eb000)

And here's the problem. nxagent must not use /usr/lib/libX11 but /usr/lib/libNX_X11. The official nx-libs packages provide libNX_X11 as libX11 in separate directory and ensure that nxagent load this library first. It is done via some linking tricks: setting RUNPATH to $ORIGIN/../lib64 or similar in the ELF header. In the dir where RUNPATH is pointing to you find a structure like this: libNX_X11.so -> libNX_X11.so.6.3.0 libNX_X11.so.6 -> libNX_X11.so.6.3.0 libNX_X11.so.6.3.0 libX11.so.6 -> libNX_X11.so.6 libX11.so.6.3.0 -> libNX_X11.so.6.3.0

given that nxproxy works with musl there is hope that nxagent too, right?

not necessarily, as nxproxy is much less system dependant.

it was by digging into the code of x2go-server that I managed to set up an nx connection which works well on Raspbian<->Arch and also on Arch<->Arch. Normally it should also work on Alpine<->Alpine if I manage to start nxagent :) moreover it works very well on Alpine<->Alpine just by replacing nxagent by nxproxy and keeping the same settings. In any case, I will immediately look at the examples in testscripts to see if I can find a clue!

Please first take care of the library problem mentioned above.

Uli

uli42 commented 1 year ago

Oh, overlap. I have just sent an explanation...

On Fri, May 12, 2023 at 11:24 AM Ouziel Slama @.***> wrote:

Simply solved with:

LD_LIBRARY_PATH=/usr/lib/nx/X11/

Found the solution in the testscripts examples :)) thank you very much @uli42 for the help!

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>