javasshremote-accessjschsession-0-isolation

Interactive Services Detection showing when opening an application on remote server (JSch)


I have a SSH Server running and need to close and open a JavaFX application. Using freeSSHd and JSch, i was able to close the application using:

sendCommand("wmic Path win32_process Where \"CommandLine Like '%Test.jar%'\" Call Terminate");

The command above closes the application without a problem.

When I need to start the application again, I am trying to use:

sendCommand("cmd /c cd C:/Test/dist && java -jar Test.jar");

What happens is that a window from Interactive Services Detection opens with the message : "A program running on this computer is trying to display a message". Opening the message shows the JavaFX application.

I need to open the JavaFX application directly on the remote computer, without this showing up. Is this behavior normal? Can i achieve this using SSH (JSch) ? I know that PSExec is an alternative, but it has to be installed in every client computer.

The same happens when I try the command in PuTTY console.

I think it is related to "Session 0 Isolation", but I don't know what this means.


Solution

  • Normally the (SSH) servers run as a Windows service.

    Window services run in a separate Windows session (google for "Session 0 isolation"). They cannot access interactive (user) Windows sessions.

    It's not that the "Interactive Services Detection" blocks the application. It's on the contrary. It's the "Interactive Services Detection" service that detects that a service is trying to show a GUI on an invisible Session 0 and allows you to replicate the GUI on the user session.

    Also note that there can be multiple user sessions (multiple logged in users) in Windows. How would the SSH server know, what user session to display the GUI on (even if it could)? I guess (though it's just a speculation) that the "Interactive Services Detection" shows the prompt on all user sessions, and the first user, that accepts the prompt, wins the GUI.


    You can run the SSH server in an interactive Windows session, instead as a service. It has its limitations though. Actually FreeSSHD asks you, when installing, if you want to install it as a service or not.

    Though I do not recommend you using FreeSSHd at all. It's pretty buggy and not well maintained.


    In general, all this (running GUI application on Windows remotely through SSH) does not look like a good idea to me.