I'm trying to execute a labview VI, launching that from a .bat file, called via ssh, from another Windows machine. So I do
ssh myuser@IP
cd Desktop
launchVis.bat
I connect with user and password. myuser have all the rights to launch the batch file. Meanwhile I check the execution via RDP connection on the same machine.
If I run the bat file from a cmd line on the remote machine, the VI starts normally If I run the bat file from the ssh connection, i can see the output of echoes in the bat file but LabVIEW will be launched in a different session from RDP-TCP#1. The result is that I can see a "LabVIEW" process started in a Session named Services, but I cannot see the VI executing and in general, I don't know IF is executing or not.
Googling about the problem, It seems that I cannot avoid to start processes in "Services" Session and, for this reason, I cannot launch any GUI Program via SSH. Suggested solutions are using PsExec or, maybe a third part of ssh Server (with a third part ssh Server I reached my goal over Windows 7)
SSH, the Secure Shell, supports remote login and command-line or GUI access across the network through encrypted tunnels protected by public-key cryptography.
As well as the traditional terminal window command line interface, PuTTY can be configured to open graphical applications on the remote computer.
To check if SSH is enabled on your system, open a command prompt and end the command ssh . If it provides you with help for using SSH, it is already enabled!
After OpenSSH was installed i started it. You can get to it easily by typing "services" into the Windows Search Bar, scroll down and find "OpenSSH SSH Server", right click and click "Start". You can also set the service to start automatically by right clicking, select Properties and set Startup type "Automatic".
How to run GUI application via SSH SSH is normally used for remote access and administration where tasks are done from the CLI (Command Line Interface), using command line tools. SSH can forward the display or GUI from the SSH server to the client, enabling running X11/X or graphical apps from within an SSH session.
Applies to Windows Server 2019, Windows 10 OpenSSH is a connectivity tool for remote login that uses the SSH protocol. It encrypts all traffic between client and server to eliminate eavesdropping, connection hijacking, and other attacks.
OpenSSH can be used to connect Window 10 (build 1809 and later) or Windows Server 2019 devices with OpenSSH Client installed to those devices with OpenSSH Server installed.
Running SSHd as a service makes launching desktop applications difficult, because a service has no access to the user desktop (Windows Station, WinSta0
) link
Option 1: Start SSHd as a user
fork of unprivileged child failed
, as running SSHd as a user is no more possible since OpenSSH 7.5 released in 2017 link
Option 2: Use a launcher that has access to the Windows Station
On Windows, there are 2 options left to launch desktop applications over SSH: link to Github OpenSSH issue
Usage:
ssh user@host "psexec -i 1 mydesktoplauncher.bat"
See psexec documentation for optional arguments like -i 1
The "solution", using a third party ssh server is this:
In that way, the ssh server will be launched as user and CAN execute GUI programs.
Unfortunately, I didn't manage to achieve the same goal with the Windows official OpenSSH server, because it fail to be launched as User, but seems working only as a Service
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With