Remotely deploying NoMachine with NoMachine Network?

Forum / NoMachine Network Products / Remotely deploying NoMachine with NoMachine Network?

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #54305
    Pesky_UK
    Participant

    (Assuming this is the correct place for the new NM Network product?)

    Is is possible to remotely deploy via script NM and connect it to the NM Network?

    What I would like to do is have a powershell script that installs (silently so will be installed using chocolatey) NM on a remote machine and configures / fetches the generated Machine ID & Access ID and locks it down to my email address.

    Can this be done?

     

     

    #54324
    Britgirl
    Keymaster

    Hi, absolutely. NoMachine can be installed in silent/very silent mode on Windows. There is an article with instructions on how to do that here: https://kb.nomachine.com/AR07K00682. To do it remotely, as an admin user, you’ll have to first connect to the target host over SSH or similar tool.

    You can also leverage the --networkadd key to add the machine to Network and set its availability, i.e. lock it down to your email address (or others).

    nxserver --networkadd [--visible-set all|<list>|nobody]
    [--accessid [<code>]|--noaccessid]
    
    Publish this computer in the NoMachine Network. By default it is
    visible to all users, this corresponds to option '--visible-set all'.
    Use '--visible-set <list>' to provide a comma-separated list of Ids
    of NoMachine Network users who will be able to see this computer or
    use '--visible-set nobody' to hide this computer to all users.
    A random access ID code is assigned by default, otherwise
    set a nine numbers code by means of '--accessid <code>'. Specify
    --noaccessid to not use the access ID code.
    #54325
    Pesky_UK
    Participant

    Brilliant @Britgirl, works perfectly.

    For future searchers here is a very simple powershell script that will install NM on a Windows machine using choco and assign it to an email address. Chocolately also performs a silent install:

    choco install nomachine -y
    & 'C:\Program Files\NoMachine\bin\nxserver.exe' --networkadd --visible-set your@email-address.com

    The output of nxserver will also give you the Machine ID and Access ID required to add the connection to your address book.

     

    #54327
    Britgirl
    Keymaster

    Great 🙂 we’ll make sure this is added to the appropriate article. Thanks for sharing!

    #54438
    Pesky_UK
    Participant

    @Britgirl I know that NM can be remotely installed on macOS but I can’t get either of the ID’s using the same syntax as for Windows. Even with the system extension enabled, privacy etc it doesn’t want to work.

    Any suggestions?

     

    #54442
    Britgirl
    Keymaster

    Hi, what macOS version is it? Have you tried removing ‘NoMachine’ from Accessibility and Screen Recording, and then adding it again?

    ” I can’t get either of the ID’s using the same syntax” – do you mean you can’t add the macOS machine to NoMachine Network?

    #54443
    Pesky_UK
    Participant

    I mean programatically from terminal – sorry, I should have specified that!

    #54447
    Tor
    Participant

    The procedure to add a machine to Network is the same you already used on Windows,  by running the command /etc/NX/nxserver with the same options. As you probably already noticed, a remote configuration is not entirely possible on macOS because of privacy permissions and their design, requiring a user to interact with settings on the physical desktop as security measure. Remote install of software requiring security permissions, even through administrator account, is pretty critical and so we approve Apple’s take on this aspect.

    If you run the correct command, but you still don’t get the expected result, do you mind sharing the terminal output so we can check what’s happening?

    #54448
    Pesky_UK
    Participant

    This is what I get when running it on a Mac (permissions etc already granted):

    bash-3.2# /etc/NX/nxserver –networkadd –visible-set myemail@address.com
    NX> 500 ERROR: Invalid command: ‘networkadd’

    #54449
    Pesky_UK
    Participant

    Ah, I’ve just realised what is causing the problem.

    I use brew to remotely install NM but it’s installing version 8.16.1_2 which is the latest version on homebrew.

    Can someone update the package on homebrew please?!

    #54454
    Tor
    Participant

    We’re not maintaining the Homebrew cask. You could install the software from a terminal (remember what we said about security permissions) by using the hdiutil mount command to mount the DMG, and the installer -package command to install the PKG from the mounted volume.

    #54455
    Pesky_UK
    Participant

    Is there a command line to update the software or does it have to be done from the GUI?

    #54458
    Tor
    Participant

    The installer command will just install on top of current existing bundle.

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

You must be logged in to reply to this topic. Please login .