[vbox-dev] unable to startvm using sdk(clienttest.pl) from VMs

Klaus Espenlaub klaus.espenlaub at oracle.com
Fri Jul 6 09:12:10 PDT 2012


Hi Rajiv,

On 06.07.2012 10:07, Rajiv Jaisankar wrote:
> Hi Virtualbox dev,
>
> I have a windows machine hosting VMs(hostmachine). I have a few vms –
> server1, server2, server3. I have a requirement of starting other vms
> from a VM. For example, I would like to start server1 or server2 from my
> linux VM server3.
>
> 6.Clienttest.pl of startvm is not working
>
> [root at server3 samples]# pwd
>
> /root/sdk/bindings/webservice/perl/samples
>
> i.Run without modifying clienttest.pl
>
> [root at server3 samples]# ./clienttest.pl startvm server2
>
> Subroutine XML::Parser::Lite::_parse_re redefined at
> /usr/lib/perl5/site_perl/5.8.8/XML/Parser/Lite.pm line 144.
>
> *Unrecognized method 'IVirtualBox_getMachine'*. List of available
> method(s): IVirtualBox_getExtraData IStorageController_getBus
> IMachine_queryLogFilename IMedium_setType IMachine_getName
> IMachineRegisteredEvent_getRegistered IProgress_getTimeout
> IMedium_getState ISnapshot_getChildren
> ISystemProperties_getFreeDiskSpacePercentError

This is caused by modifying the VBox API without consistently updating 
this script.

> ii.Run modifying clienttest.pl
>
> Modified clienttest.pl and changed getMachine to getMachines - this will
> get the first of the vm list i.e. uid of server1

That's not the right approach, so this can't fix the problems. You need 
to switch to IVirtualBox::findMachine.

> Is it expected that IVirtualBox class/java code doesn’t have functions
> getMachine and openRemoteSession? Can we get the modified IVirtualBox
> class or jar file?

Yes, that's expected. The sample code is broken, that's all. There are 
no significant users of the perl API bindings, which is why it slipped 
through the cracks for a while. This shows in a different way, too: the 
bindings are incomplete, e.g. one can't use the enum values without 
jumping through hoops by implementing custom marshaling...

We're working on fixing the bugs in the sample code. In the mean time 
you can use the sample code for other language bindings to see how a VM 
is started with the current API (IMachine::launchVM). It's simpler than 
it used to be.

Klaus

>
> Regards,
>
> Rajiv




More information about the vbox-dev mailing list