Command line interaction with NX

Forums / NoMachine for Mac / Command line interaction with NX

Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #20041
    AvatarMickM
    Participant

    I’ve been running a Linux based CAD tool package on my Mac via SSH. It’s been working fine for years, but the killer has always been that everything just died when the network connection went down. NX doesn’t have this problem, so I gave it a try and it works great. I’d now like to finish up my configuration to be the same as when I did everything via SSH.

    I started my SSH connection with a double-click on a given file in the Finder. The double-click would kick off an AppleScript in which I constructed a variable called my_cmd that was set to e.g.:

    ssh -Y my_machine@10.1.10.2 “module load sos; cd some_place; prog_name” > /dev/null 2>&1 &

    and then in the AppleScript I’d say:

    do shell script (my_cmd)

    That command made the connection to the Linux box, kicked off a program on the Linux box and displayed all the windows on my Mac.

    My question is: what do I need in the equivalent my_cmd command line variable so that I could launch NX and do the same thing.

    Many thanks in advance for your assistance!

     

    #20085
    AvatarTor
    Contributor

    Hi Mick.
    You can prepare a configuration file template, customize it through AppleScript and open it to execute NoMachine client.
    Start the connection wizard by pressing the ‘New’ button and create the default configuration. You’ll find it in the Documents/NoMachine folder.

    These are the fields you’ll need to customize:

    <option key="Server host" value="%IP%" />
    <option key="Session" value="unix" />
    <option key="Desktop" value="console" />
    <option key="Custom Unix Desktop" value="application" />
    <option key="Command line" value="%SCRIPT%" />

    %IP% is the IP or hostname of the server, while %SCRIPT% is the command or sequence of commands to execute on the server.
    After you create the temporary connection file with such configuration, use it with this command:

    open <path to the NXS file>

    Is that enough or you would like to customize more options?

    #20087
    AvatarMickM
    Participant

    Hi Tor,

    Many thanks for your response!

    Even though I’m currently connected to a server via NX, there is nothing in my Documents/NoMachine folder :-/. When I disconnect later tonight I’ll see if I can save a connection file there.

    I think you have given me enough information to move forward with. I’ll try it out and get back to you within a couple days.

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

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