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

Klaus Espenlaub klaus.espenlaub at oracle.com
Mon Jul 9 03:59:59 PDT 2012


On 06.07.2012 19:53, Rajiv Jaisankar wrote:
>
> Hi Klaus,
>
> I changed the ISession_close to IMedium_close. Now it seems to work
> fine. Hope it's fine.

No, it's not. You can say thank you to the webservice that it doesn't do 
anything funny if you mix method invocations of one object with a 
totally different object reference.

I'm about to wrap up a fixed version of the script...

Klaus

>
> The line changed is
>      vboxService->IMedium_close($session);
>      vboxService->IWebsessionManager_logoff($vbox);
>
>
> [root at rhel5-64 samples]# ./clienttest.pl startvm rhel51_64
> Subroutine XML::Parser::Lite::_parse_re redefined at
> /usr/lib/perl5/site_perl/5.8.8/XML/Parser/Lite.pm line 144.
> [clienttest] UUID: f542e7d2-35b3-4127-899d-a31af5837d55
> [clienttest] Waiting for the remote session to open...
> [clienttest] Completed: true
> [clienttest] Result: 0
> [root at rhel5-64 samples]#
>
> Thanks,
> Rajiv
>
> -----Original Message-----
> From: Rajiv Jaisankar
> Sent: Friday, July 06, 2012 11:20 PM
> To: Klaus Espenlaub
> Cc: vbox-dev at virtualbox.org
> Subject: RE: [vbox-dev] unable to startvm using sdk(clienttest.pl) from
> VMs
>
>
> Thanks Klaus.
>
> I could start the vm now. One more small problem. It says "unrecognized
> method Isession_close."
>
> [root at rhel5-64 samples]# ./clienttest.pl startvm cm
> Subroutine XML::Parser::Lite::_parse_re redefined at
> /usr/lib/perl5/site_perl/5.8.8/XML/Parser/Lite.pm line 144.
> [clienttest] UUID: 20e53e59-fe2f-43f0-b89c-4419ede3a845
> [clienttest] Waiting for the remote session to open...
> [clienttest] Completed: true
> [clienttest] Result: 0
> Unrecognized method 'ISession_close'.
>
> Regards,
> Rajiv
>
> -----Original Message-----
> From: Klaus Espenlaub [mailto:klaus.espenlaub at oracle.com]
> Sent: Friday, July 06, 2012 11:13 PM
> To: Rajiv Jaisankar
> Cc: vbox-dev at virtualbox.org
> Subject: Re: [vbox-dev] unable to startvm using sdk(clienttest.pl) from
> VMs
>
> 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:rajiv.jaisankar at altair.com]
>> Sent: Friday, July 06, 2012 10:50 PM
>> To: Klaus Espenlaub; vbox-dev at virtualbox.org
>> 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 at 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 at server3 samples]# echo $DISPLAY
>> localhost:10.0
>> [root at server3 samples]# xclock
>> Warning: Missing charsets in String to FontSet conversion
>> [root at server3 samples]#
>>
>> Regards,
>> Rajiv
>>
>> -----Original Message-----
>> From: Klaus Espenlaub [mailto:klaus.espenlaub at oracle.com]
>> Sent: Friday, July 06, 2012 9:42 PM
>> To: vbox-dev at virtualbox.org
>> 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 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
>>
>> _______________________________________________
>> vbox-dev mailing list
>> vbox-dev at virtualbox.org
>> https://www.virtualbox.org/mailman/listinfo/vbox-dev
>>
>> _______________________________________________
>> vbox-dev mailing list
>> vbox-dev at virtualbox.org
>> https://www.virtualbox.org/mailman/listinfo/vbox-dev
>




More information about the vbox-dev mailing list