On 06.07.2012 19:25, Rajiv Jaisankar wrote: > > Hi Klaus, > > Forgot to mention the changes made to the script. Below are the two > changes made to testclient.pl > > - Change #1 > > # assume it's a UUID > my $machine = vboxService->IVirtualBox_findMachine($vbox, $vmname); > > - Change #2 > > print "[$cmd] UUID: $uuid\n"; > > my $progress = vboxService->IMachine_launchVMProcess($vbox, > $session, > $uuid, > "vrdp", > "");
Too many parameters for launchVMProcess - just leave out "$uuid,", plus the first parameter needs to be $machine instead of $vbox. It always has to match the Iwhatever type... the perl webservice code has a pretty crude "manual" object orientation approach where "this" is passed as the first parameter. Then you should have more success. Klaus > die "[$cmd] Cannot open remote session; stopped" > $session, > $uuid, > > Regards, > Rajiv > > -----Original Message----- > From: Rajiv Jaisankar [mailto:[email protected]] > Sent: Friday, July 06, 2012 10:50 PM > To: Klaus Espenlaub; [email protected] > Subject: Re: [vbox-dev] unable to startvm using sdk(clienttest.pl) from > VMs > > Hi Klaus, > > Thank you for your advice. I have made the changes you suggested. But I > am still getting " Cannot open remote session; stopped at > ./clienttest.pl line 141" error. > > [root@server3 samples]# ./clienttest.pl startvm server1 > > Subroutine XML::Parser::Lite::_parse_re redefined at > /usr/lib/perl5/site_perl/5.8.8/XML/Parser/Lite.pm line 144. > [clienttest] UUID: e45fc242-0adc-4b84-a26b-bac23a63bbf4 > [clienttest] Cannot open remote session; stopped at ./clienttest.pl line > 141. > > I am not if it used display. But, I checked xclock. That seems to be ok. > > [root@server3 samples]# echo $DISPLAY > localhost:10.0 > [root@server3 samples]# xclock > Warning: Missing charsets in String to FontSet conversion > [root@server3 samples]# > > Regards, > Rajiv > > -----Original Message----- > From: Klaus Espenlaub [mailto:[email protected]] > Sent: Friday, July 06, 2012 9:42 PM > To: [email protected] > Subject: Re: [vbox-dev] unable to startvm using sdk(clienttest.pl) from > VMs > > 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@server3 samples]# pwd >> >> /root/sdk/bindings/webservice/perl/samples >> >> i.Run without modifying clienttest.pl >> >> [root@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 > > _______________________________________________ > vbox-dev mailing list > [email protected] > https://www.virtualbox.org/mailman/listinfo/vbox-dev > > _______________________________________________ > vbox-dev mailing list > [email protected] > https://www.virtualbox.org/mailman/listinfo/vbox-dev _______________________________________________ vbox-dev mailing list [email protected] https://www.virtualbox.org/mailman/listinfo/vbox-dev
