Wait for application startup during the virtual session start

Forum / NoMachine Terminal Server Products / Wait for application startup during the virtual session start

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #13808
    mkrisk
    Participant

    Hello,

    I am starting a NoMachine virtual desktop session on a linux (headless) VM. My .xinitrc is configured to start an openbox session and the openbox autoconfig file is starting some GUI applications. What I am trying to achieve is to wait until those application finish the startup and only then showing the session in the NoMachine client. At the moment it seems to me that the NoMachine is forwarding the display of the virtual session to the client as soon as the X session starts, it doesn’t wait for the scripts to terminate (neither .xinitrc nor the openbox autoconfig). I’ve tried to specify “Default desktop command” in the “node.cfg”, providing a custom script that starts the X session and then waits for the applications to finish the startup. But that didn’t help, the NoMachine client still shows the display as soon as the X session is up, without waiting for the custom script to terminate.

    Is there a way to achieve my goal there with some custom scripts or by some other means?

    Thnx for any help!

    #13822
    brotech
    Participant

    Custom scripts UserScriptAfterSessionStart could be helpful here.

    The script is executed after the application starts but before the desktop is exported to the client side. The node will wait for exit of that script. So you could wait for some seconds,
    or check which process is the important one to wait for.

    Node executes it using these parameters:
    UserScriptAfterSessionStart “” session id, username, session type, display, main session id(*), main session type(*)

    (*) ‘main session id’ and ‘main session type’ parameters are available only when the user connects to an already running virtual desktop (session shadowing).

    Examples of scripts are here:
    https://www.nomachine.com/AR02L00787

    #13837
    mkrisk
    Participant

    Thnx for an advice. I did try UserScriptAfterSessionStart. But for me the NoMachine doesn’t wait for the script to terminate before the desktop is exported to the client side. So the script is still running after the NoMachine client shows the display. Am I doing something wrong there?

    #13844
    brotech
    Participant

    Hello, could You paste Your script ?
    Hard to say if you are doing something wrong.

    For sure custom script as

    #!/bin/bash
    sleep 10

    will delay session start by 10 seconds.

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

Closed because the user did not provide further feedback. Please notify us if you confirm that it is resolved or open a new topic if you have the same problem.