1

I've used Nomachine for years to connect my 2 Linux laptops. The client machine A has always connected to an existing X session in the server machine B displaying it in both A and B. However, lately it always creates a new session on B while showing it on A only. To my knowledge, I haven't done (installed, removed, changed, etc.) anything to deserve this.

Upon connecting, I lately also sometimes get warnings either about a keyring or not being allowed to control network, so I suspect a polkit issue. If I open a web browser in the B session displayed only in A, the browser opens only in the existing X session on B (this is the only way I can interact w/ the X session there). So it seems that something's preventing me from accessing the web over Nomachine, creating a new webless X session instead.

What I've done

To get rid of the keyring nag:

mv /home/j/.local/share/keyrings/login.keyring /home/j/.local/share/keyrings/login.keyring.bak

To ensure network control:

  • created /etc/polkit-1/localauthority/50-local.d/50-allow-network-manager.pkla:
[Network Manager all Users]
Identity=unix-user:*
Action=org.freedesktop.NetworkManager.settings.modify.system;org.freedesktop.NetworkManager.network-control
ResultAny=yes
ResultInactive=yes
ResultActive=yes

(tried also versions w/ ResultAny=no and ResultInactive=no)

  • commented out the following value of allow_any of
<action id="org.freedesktop.NetworkManager.network-control">
<_description>Allow control of network connections</_description>
<_message>System policy prevents control of network connections</_message>

(this is a message I sometimes got) in /usr/share/polkit-1/actions/org.freedesktop.NetworkManager.policy:

    <defaults>
<!--      <allow_any>auth_admin</allow_any>-->
      <allow_inactive>yes</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>

This has suppressed the "System policy prevents control of network connections" messages and temporarily fixed the keyring nag (login.keyring gets re-created and sometimes fires the nag again) but hasn't enabled me to connect to an existing X session on B. Needless to say, I've rebooted both machines many times. Any ideas on how to proceed?

2
  • Are you using ssh and/or have tried "xhost +"? Have there been any system upgrades or package upgrades lately? Commented Jul 14, 2021 at 21:12
  • @CinaedSimson Not using ssh and have tried xhost + (didn't help). I didn't do any upgrades before the problem occurred (but one of the systems is Xubuntu, and its shutdown is suspiciously slow, so I suspect it may be doing some surreptitious upgrading)
    – jaam
    Commented Jul 15, 2021 at 4:12

1 Answer 1

0

I solved the problem but am a bit unsure on how. Here's what I did:

  1. Upgraded all packages and Nomachine on both machines to newest versions (they were different but this didn't interfere w/ using them (till they worked)). Rebooted. This alone bought me nothing.

  2. Took a look at the server's configuration file (on B) at /usr/NX/etc/server.cfg, which contained some suspicious key values. Made some changes, including

EnableNetworkBroadcast 1 
CreateDisplay 0 
WebAccessType unrestricted

Rebooted. Again, nothing. I "forgot" the whole business for a couple of days and when I fired the computers up -- bang! It worked.

I have some theories concerning all this. The first, obvious one is that the computer (probably B) needed multiple reboots. Possibly, the shutdown after the first reboot fixed some settings on B, and it rebooted correctly after that. Also possibly (but more unlikely), leaving the network cable disconnected on one of the reboots flushed some corrupted settings, and things worked after that. There's also a very slight possibility that I didn't reboot after changing B's /usr/NX/etc/server.cfg but e.g. did a logout.

As to the root cause of the mess, I have three theories:

  1. When B crashed (as it occasionally does), Nomachine's server settings were corrupted / overwritten on next reboot.

  2. In Nomachine, I've since seen a dialog "Cannot detect a display on server xxxxx. Always create a new display for this server?". Maybe I unconciously clicked Yes to the question, which might explain an unability to connect to an existing session and CreateDisplay 1 in /usr/NX/etc/server.cfg (doesn't explain an unability to connect to the internet, though).

  3. B's SSD is having some problems (my Linux partition there didn't boot up today before I did fsck -fy to it). This may have corrupted something, too.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .