Running SikuliX Script on VPS while computer off? - vps

I'm trying to run a SikuliX Script 24/7 on a VPS but I do not want to leave my computer on all the time while it runs. I know sikuli requires that you have a monitor, so I am not sure how I can have it run while my VPS isn't even open on my computer.

If your VPS is running Linux you could use a tool such as Xpra, it allows for an X application to be run even when the client disconnects. It can also be used with a nested X server like Xephyr to run a full remote desktop that persists disconnects.
On Windows Server this this superuser page details how to allow a Windows Server RDP session to persist even after the client has disconnected.

Related

Windows Start GUI Rendering without login

We want to use a 3rd party software on Windows EC2/Cloud Instances, Windows Server 2022. The software requires GUI Interaction. When we close the RDP connection, suddenly our app crashes because of missing UI. Its not a valid option to modify the 3rd party software.
Is there a possibility to start running windows UI rendering without connecting via RDP to that machine before?
Briefly; lets say we started a new Windows instance, without connecting via RDP to that instance, is there a way to start GUI Rendering on that instance? It can be tested with some screenshot scripts, if they work fine without RDP connection on that machine.
As a workaround we do not directly close the RDP connection, instead we are running some scripts which keeps the UI still alive but closes only the RDP session. But with this solution we still need to connect to the machine via RDP first and run this command once. [https://stackoverflow.com/questions/15887729/can-the-gui-of-an-rdp-session-remain-active-after-disconnect]

Using KeyboardEvent in a VPS

I have a VPS that i access by Remote Desktop Connection. In this VPS i run several Delphi applications that automate tasks. For these tasks i simulate keyboard presses by using the KeyboardEvent Windows API.
It works fine as long as i'm logged on the machine via RDC. When i logoff, the Delphi app keep running, but no KeyboardEvent works anymore.
Is there a way to fix that, or API alternatives that can send keys even if not logged on the VPS ? I can't be connected on the VPS all the time...
Thanks in advance !
I could not find a solution for this issue, but could find a workaround : if you install a new virtual machine INSIDE the VPS, the KeyboardEvent will work even if you disconnect from the VPS itself, because the virtual machine will keep running. Not an ideal solution but so far the best i could find.

How to start a program over RDP on windows 7

I want to start a command(cmd file) on remote windows 7/2008 hosts via rdp connection.
If it possible I want to operate from linux and python. If not - I can use windows.
So I have access to windows machines only via rdp. I have to start commands in automatically mode. What is the easiest way?
Don't.
Use WinRS, which is the proper solution for remote execution on Windows. See Using WinRS.
There are hacks to allow RDP to execute something remotely (eg. Can RDP clients launch remote applications and not desktops), they are hacks. RDP does not have remote execution facilities.
If you want a Linux client, then install an SSH server on your Windows images. If you're brave you could give OpenWSMAN a shot, but frankly I'd stick to ssh.

Is it possible to write a script to run an application on Windows VM from your mac?

I am using a RDC Connection from my mac to connect to an application (on windows box) in client network. Is that possible to write a script which does the following:
Open ur RDC. (i am using CoRD for this where my VM credentials are saved in .rdp files.
Login to VM with valid credentials from your .rdp file.
Open your app on that VM (for ex: IE explorer)
Following code in my shell script will connect me to my VM.(First two steps are working)
open rdp://[username[:password]#]hostname
How should I automate third step?
Is there any other way than shell script?
If you install Jenkins on your Mac, then install the Jenkins slave agent on the Windows machine, you can remotely run any command you like on the Windows box via the Jenkins web UI, and get back the results as well. In that scenario there's no need to use RDC at all.
For some more background, see: https://wiki.jenkins-ci.org/display/JENKINS/Distributed+builds
This might be a simplistic answer, but AutoHotKey is something that will automate your 3rd step. Its free and pretty easy to script. You can have this in your start up routine for your VM, so when you log in, you can have this kick off your job.
I have used it before for testing some Java Swing components on Windows and its been pretty handy (Windows was running on a Virtualbox VM on my Mac).

How to ask a remote windows machine to automatically launch an application?

I have a windows server 2003 up in the internet.
But sometime I need to restart it.
After restart, I want one of the applications to run.
I want to do this all programatically.
I can now remotely restart the server.
But the question is how can I ask that piece of software to be executed (more precisely, I want to execute a .BAT file to ask a tomcat to run)?
Because I don't want to manually log in to the machine and start that application. That is time consuming. Is there any possible way, once the machine is started, my application will be run as well?
If you're developing an application that should always be running on the server, you probably need to implement it as a Windows service. For C#, see the classes in the System.ServiceProcess namespace -- you will need to inherit from ServiceBase.
Alternatively, you can set the program to be run as a scheduled task on boot. See the Task Scheduler API to do this.
You can install Cygwin and then do it the same way we'd do it on a Linux box: via ssh, using keys.
OpenSSH is not part of the default Cygwin install, so be sure to select it. It's in the Net category.
Then, after you've installed Cygwin and sshd, read /usr/share/doc/Cygwin/openssh.README to learn how to set up sshd as a service, so it will answer requests automatically, without you having to start the ssh daemon manually.
Finally, set up keys, as described in the link above.
Part of the ssh protocol is a way to ask a remote machine to launch a program. Setting it up with keys lets you do it without needing a password.
You could try xCmd, which is a freeware app to run a command on a remote machine.

Resources