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

Rajiv Jaisankar rajiv.jaisankar at altair.com
Fri Jul 6 17:25:34 GMT 2012


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",
                                                         "");
    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