Page 1 of 1
Sending mouse clicks in cmd
Posted: 4. Sep 2017, 08:10
by Mishmish
Hi.
I am trying to automate something for my job in VBox.
My company uses a 64Bit linux distribution which i installed as guest.
I want to be able to send mouse clicks to my guest with a command.
Is it possible? i use vboxmanage to get screenshots of the VM
but no documentation anywhere about sending mouse clicks.
also if there was a settings to send long taps it would be awesome.
Thanks for helpers!
Technical data:
Host: Windows 10 64Bit
Guest: "Other Linux(64-Bit)"
VBox v5.1.26 r117224
Re: Sending mouse clicks in cmd
Posted: 4. Sep 2017, 22:19
by noteirak
The object
IMouse contains what you need, allowing you to send arbitrary mouse events. You can get it with
IConsole::mouse after obtaining a shared lock on the VM object.
Re: Sending mouse clicks in cmd
Posted: 5. Sep 2017, 16:21
by Mishmish
noteirak wrote:The object
IMouse contains what you need, allowing you to send arbitrary mouse events. You can get it with
IConsole::mouse after obtaining a shared lock on the VM object.
Hi and thanks for the fast response!
The api you linked is exactly what im looking for, especially because it has java API which is what im using
unfortunatly i couldnt find the jar file for VBox 5.1 (which is what im using)
will 4.2.8 work for me? and is 5.1 backwards compatible?
thank you
Re: Sending mouse clicks in cmd
Posted: 5. Sep 2017, 16:25
by noteirak
The jar file can be found in the SDK package in the
Downloads page. Here's a
download link for 5.1.26. You do not need an exact version match, as long as the VirtualBox version you installed is 5.1.x
For any other version, see the specific download page of the version, there is a SDK link as well.
You'll find two Jars in the SDK package within the bindings folder: one for XPCOM, one for WebServices.
Re: Sending mouse clicks in cmd
Posted: 7. Sep 2017, 08:54
by Mishmish
noteirak wrote:The jar file can be found in the SDK package in the
Downloads page. Here's a
download link for 5.1.26. You do not need an exact version match, as long as the VirtualBox version you installed is 5.1.x
For any other version, see the specific download page of the version, there is a SDK link as well.
You'll find two Jars in the SDK package within the bindings folder: one for XPCOM, one for WebServices.
I have researched quite a bit.
from what i can gather this api connects to a webserver in the quest machine - which i do not have
I use a custom linux machine and I CANNOT install anything on it...
also the sdk contains only XPCOM and SOAP jars which the documentation suggests dont work on windows hosts...
i simply want to send mouse clicks to a local guest...
Re: Sending mouse clicks in cmd
Posted: 7. Sep 2017, 10:01
by noteirak
I'm afraid you missunderstood the docs.
The webserver is vboxwebsrv which is a SOAP frontend and is present with any VirtualBox install.
The SOAP jar works on any system, only XPCOM is limited to Unix-like system.
And this is definittely the way to send from host to guest.
Re: Sending mouse clicks in cmd
Posted: 7. Sep 2017, 11:30
by Mishmish
noteirak wrote:I'm afraid you missunderstood the docs.
The webserver is vboxwebsrv which is a SOAP frontend and is present with any VirtualBox install.
The SOAP jar works on any system, only XPCOM is limited to Unix-like system.
And this is definittely the way to send from host to guest.
I cannot figure out what url to give the SOAP jar.
tried both "localhost:18083" and my guests ip.
I am using a bridged network.
keep getting the exception "org.virtualbox_5_1.VBoxException: Illegal endpoint address"
obviously while the VBoxWebSrv.exe file is running
Re: Sending mouse clicks in cmd
Posted: 7. Sep 2017, 12:04
by noteirak
The endpoint is
http://localhost:18083
There are
code samples to help you, see specifically "Export a VM to a OVA appliance" which shows you value in the code directly.
if you want to avoid dealing with authentication at the start, you can give "-A null" to the vboxwebsrv as argument.