Using Sikuli tests on a headless remote VM

Asked by worm


I want to trigger a Sikuli test hosted on a headless remote machine (let's call it B) which runs VMWare and Windows Server 2008 from a Linux headless machine (let's call it A).

I assume I just have to establish a RDP connection from A to B and send the appropriate command to B in order to execute the Sikuli test on it.

But reading the other questions about this subject led me to believe it won't work because B doesn't have a physical screen. Is there any workaround?

Question information

English Edit question
SikuliX Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
akbar (mohammed-akbar-ali) said :


Revision history for this message
worm (rom-seguy) said :

How to configure a Sikuli script so it executes within the VNC client window and not locally?

Revision history for this message
RaiMan (raimund-hocke) said :

Sikuli scripts will not run on headless machines in no case (this is a restriction by the internally used Java Robot class).

If you succeed to make visible a VNC window from such a headless machine on another machines screen (client), ten a script running on the client just sees the pixels in the VNC window the same as any other pixel on the local screen.

So you have to simulate, what you would do manually on the local machine.

But be aware: if you start a script on the remote machine through the VNC window, the script will not work, since the script runs on the remote machine, which is still headless.

I saw some solutions on the net (google is your friend), that used some complex X11 based solutions, that allowed to run Sikuli scripts on headless machines through VNC.

Revision history for this message
worm (rom-seguy) said :

I came up with a scenario that I think could make sense. At least more sense than the one in my opening post.

I would run the Sikuli script from the Linux headless machine using the virtual display created by a XVFB server running on that same machine. The Sikuli script would first open a VNC window (within the XVFB virtual display) so it'd be able to execute the rest of the test in the remote UI.

I know there are tools allowing to capture screenshots from such a XVFB virtual display so I don't see why it would be a problem for Sikuli either.

Revision history for this message
RaiMan (raimund-hocke) said :

With the current implementation a Sikuli script will not even startup on a headless machine, since the prereqs are checked at initialization (It will be detected, that there is no physical screen available).

Sikuli currently has no features to access virtual screens, wherever and however they might be run.
So your "XVFB virtual display" cannot be accessed with the features of Sikuli.

But you might setup a Java program, that accesses the virtual display, acquires screenshots and then searches images inside these screenshots using the Java API of Sikuli (class Finder).

Again: if you want to use:

someRegion must be a rectangular area of pixels on a real screen.

SikuliX out of the box does not support virtual (or in memory) screens.

Revision history for this message
worm (rom-seguy) said :

Alright then. Do you recommend any other UI automation tool that would support virtual/in-memory screens? Auto-it perhaps?

I'd go with your solution but only as a last resort since its implementation seems rather difficult at first sight.

Revision history for this message
RaiMan (raimund-hocke) said :

--- Do you recommend any other UI automation tool ...
I do not know any free tool that allows this easily

So I guess, I cannot help you further.

... but pleas feedback if you find any rather simple solution, to run Sikuli scripts on a headless machine.

Can you help with this problem?

Provide an answer of your own, or ask worm for more information if necessary.

To post a message you must log in.