Connection fails on headless client

Forums / NoMachine for Linux / Connection fails on headless client

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #21734
    xedyron
    Participant

    I can’t connect to my VM (Arch with KDE Plasma and SDDM, NoMachine 6.5.6) when the display server is disabled and X is not already running.

    The connection is started after login, a black screen appears and the mouse cursor is visible for a few seconds but then the window just closes and goes back to Recent Connections.

    Before I made changes to xinit there was a message dialog on the black screen: “Could not sync environment to dbus”. After the changes the message went away and the window closes without any feedback.

    It works however if I start Xorg manually (startx or starting SDDM service) and on other headless VMs so I think there has to be something wrong in my system or nxnode/nxserver configuration.

    Attachments:
    #21746
    graywolf
    Moderator

    dbus-launch or startkde (look at the command defined by DefaultDesktopCommand key in /usr/NX/etc/node.cfg) failed to start (actually they terminated after just 2 seconds).

    Browse for the application log in files /usr/NX/var/log/F-*/clients and in the systemd journal (try the command journalctl -b -0 | grep -i "kde\|dbus").

    #21761
    xedyron
    Participant

    /usr/NX/var/log/node/…/clients

    startkde: Starting up...
    dbus-update-activation-environment: error: unable to connect to D-Bus: Failed to connect to socket /tmp/dbus-t7CoXdBU1J: Connection refused
    startkde: Could not sync environment to dbus.

    journalctl

    Mar 15 14:00:49 V5 audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=dbus comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
    Mar 15 14:00:49 V5 dbus-daemon[480]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.1' (uid=981 pid=378 comm="/usr/lib/systemd/systemd-networkd ")
    Mar 15 14:02:35 V5 systemd[1628]: dbus.socket: Succeeded.
    #21773
    xedyron
    Participant

    I think the issue is somehow related to Arch since it doesn’t work on Antergos and Manjaro (both based on Arch) with multi-user.target either.

    It even won’t connect successfully after starting the display manager until nxserver is restarted manually.

    After trying almost every change I could find that might be related to this problem I’m really out of ideas 🙁

    #21783
    graywolf
    Moderator

    It looks that dbus-daemon in Arch Linux exits immediately if not launched from a terminal. Rather that using dbus-launch, you could run a systemd user daemon using some tweaks.

    1. Create a backup of nx PAM configuration (sudo cp -a /etc/pam.d/nx /etc/pam.d/nx.original). Then change /etc/pam.d/nx in this way:

    auth       include       system-login
    account    include       system-login
    password   include       system-login
    session    include       system-login

    2. Change DefaultDesktopCommand in /usr/NX/etc/node.cfg in order to remove dbus-launch –exit-with-session:

    DefaultDesktopCommand "startkde"

    3. Stop display manager:
    sudo systemctl stop display-manager

    4. Restart NoMachine:
    sudo /etc/NX/nxserver --restart

    #21784
    xedyron
    Participant

    It finally connects! Changing su to system-(remote-)login and removing dbus-launch worked 😀 Thank you soooooooooo much graywolf!!!

    #21789
    xedyron
    Participant

    There seems to be a issue with some tray icons, though. NoMachine icon appears as nxclient.bin and its context menu looks different from the usual login session. But the main problem is that some other icons are missing completely which makes my cloud storage app inaccessible. Do you have a clue what the reason could be?

    #21798
    graywolf
    Moderator

    Try a little change to the command:

    DefaultDesktopCommand "env DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus startkde"

    #21800
    xedyron
    Participant

    I bow to you mighty Linux-Wizard 🙂 I’m only guessing what your magic does but I’m thankful that it solved my problem!

Viewing 9 posts - 1 through 9 (of 9 total)

This topic was marked as solved, you can't post.