[vbox-dev] Reading Guest Properties for running VM (SOAP APIs)

Joseph Smith joseph1962smith at yahoo.com
Wed Jul 7 21:06:12 GMT 2010


Hi Klaus/All,

Well ... I think I have finally got this figured-out and working.

I am still using the exact steps as described in my original message.  After not 
being able to get this to work ... I decided to just on a whim try a "wildcard".

The IMachine::enumerateGuestProperties documentation specifically states the 
'patterns' parameter will match properties where a list of properties separated 
by a pipe '|' can be provided.  The documentation also states that if the 
'patterns' parameter is empty or null, all properties will match.

This works as described for VMs that are not running (using "" or null as the 
patterns parameter).  However, from my experience (3.1.8 - 3.2.4), I have now 
confirmed this does not work for VMs that are running or paused (i.e: stopped, 
aborted, etc)

I took the chance and changed the parameter to an asterisk "*" and now all 
properties are being returned for any machine I chose regardless of state.

It would seem then there is either an error in the documentation or in the API 
or I'm missing something else.


Joe.




________________________________
From: Klaus Espenlaub <Klaus.Espenlaub at Sun.COM>
To: Joseph Smith <joseph1962smith at yahoo.com>
Cc: vbox-dev at virtualbox.org
Sent: Tue, June 29, 2010 8:44:04 AM
Subject: Re: [vbox-dev] Reading Guest Properties for running VM (SOAP APIs)

Joseph Smith wrote:
> Hi Klaus,
> 
> Yaay for me!  I'm doing something right! <smile>  It's all that VBoxManage 
>advice ... ha ha ...
> 
>  From your response then ... are you indicating this could be a prob with 
>vboxwebsrv ?  VBoxManage does work correctly ... so the lower-level API 
>obviously works.

I know for sure that it works over the webservice. Sun VDI uses this API call 
via the jax-ws wrappers for java, and I haven't ever heard of problems in this 
area. Maybe you could use vboxshell.py (a rather big "sample" in python, using 
the API either directly or through the webservice if you run it with -w).

> It is nice to get some sense of direction on this thoguh ... I've been beating 
>my head against a wall not wanting to ask for help before checking every 
>possibility.

Sorry that I can't help you more...

Klaus

> 
> 
> Thanks,
> Joe
> 
> ------------------------------------------------------------------------
> *From:* Klaus Espenlaub <Klaus.Espenlaub at Sun.COM>
> *To:* Joseph Smith <joseph1962smith at yahoo.com>
> *Cc:* vbox-dev at virtualbox.org
> *Sent:* Mon, June 28, 2010 2:27:08 PM
> *Subject:* Re: [vbox-dev] Reading Guest Properties for running VM (SOAP APIs)
> 
> Joseph Smith wrote:
>  > Hi Klaus,
>  >
>  > Thanks for the reply.  I'm not able to re-run the test just now ... but will 
>later this evening.
>  >
>  > Actually ... the message I put below was copied directly from the output of 
>the soap fault message ... so I did not modify the message in any way.  Not sure 
>why it was reported that way.  I'll investigate further.
> 
> Hehe. Thanks for spotting a bug then ;)
> 
>  > I am pretty sure I am not using a IVirtualBox::getMachine ref though I may 
>have made such a mistake and not realized it.  Later tonight when I get a chance 
>to look at the code I will double-check.
> 
> Dug a little deeper, and what's happening actually is an error asking the VM 
>for up to date guest properties. Haven't seen that one ever.
> 
> So you're definitely doing the right thing, just the VM process is confused. 
>Very odd....
> 
> Klaus
> 
>  > Thanks again,
>  > Joe
>  >
>  > ------------------------------------------------------------------------
>  > *From:* Klaus Espenlaub <Klaus.Espenlaub at Sun.COM 
><mailto:Klaus.Espenlaub at Sun.COM>>
>  > *To:* Joseph Smith <joseph1962smith at yahoo.com 
><mailto:joseph1962smith at yahoo.com>>
>  > *Cc:* vbox-dev at virtualbox.org <mailto:vbox-dev at virtualbox.org>
>  > *Sent:* Mon, June 28, 2010 12:38:29 PM
>  > *Subject:* Re: [vbox-dev] Reading Guest Properties for running VM (SOAP 
>APIs)
>  >
>  > Joseph Smith wrote:
>  >  > Hi,
>  >  >
>  >  > I am encountering some challenges when trying to retrieve guest 
>properties (enumerateGuestProperties) via the SOAP API.
>  >  >
>  >  > I am able to use this API and retreive guest properties if the guest is 
>not running ... but get a runtime exception if I try when the guest is running.  
>I know it can be done since VBoxManage is able to ... but I'm wondering if this 
>could possibly be a vboxwebsrv  problem.  Essentially ... the steps I use are:
>  >  >
>  >  > 1) Instantiate a new Session object
>  >  > 2) Using this session object ... try to open a new session (openSession)
>  >  > 3) If getting a new session fails ... try to open an existing session 
>(openExistingSession)
>  >  > 3) With the opened session object ... get the machine object reference 
>(ISession::machine)
>  >  > 4) Using the machine reference ... enumerate the guest properties 
>(ISession::enumerateGuestProperties)
>  >  >
>  >  > If the VM is not running ... it works perfectly.  If the VM is running 
>... a runtime exception is thrown.  The error thrown is:
>  >  >      "VirtualBox error: Internal application error (0x2147500037)"
>  >
>  > Printing 0x in front of a number doesn't make it hex ;)
>  >
>  > This is error 0x80004005 = E_FAIL.
>  >
>  >  From the looks you're not doing what you claim, as exactly this sequence 
>works fine in VBoxManage. Sure that you're not accidentally using an IMachine 
>reference returned by IVirtualBox::getMachine?
>  >
>  > Klaus
>  >
>  >  >
>  >  > Using the same Machine reference object I can retrieve other machine 
>specific information ... so I know the machine ref is valid (additionally, the 
>UUID on the machine ref matches the UUID of the VM).
>  >  >
>  >  > I am also able to use this same approach to getting a session for both a 
>non-running and running VM to start/stop/pause or otherwise manage a VM.  As 
>frequently suggested (<smile>) ... I have looked over how VBoxManage does it ... 
>and I am unable to see a difference between how VBoxManage retreives the 
>information when compared to they way I do.
>  >  >
>  >  > I'm sure I must be doing something wrong ... but it sure does not seem 
>very obvious.
>  >  >
>  >  > Anyone have any suggestions they can offer ?
>  >  >
>  >  >
>  >  > Thanks,
>  >  > Joe
>  >  >
>  >  >
>  >  > ------------------------------------------------------------------------
>  >  >
>  >  > _______________________________________________
>  >  > vbox-dev mailing list
>  >  > vbox-dev at virtualbox.org <mailto:vbox-dev at virtualbox.org> 
><mailto:vbox-dev at virtualbox.org <mailto:vbox-dev at virtualbox.org>>
>>  > http://vbox.innotek.de/mailman/listinfo/vbox-dev
>  >
>  >
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> vbox-dev mailing list
> vbox-dev at virtualbox.org
> http://vbox.innotek.de/mailman/listinfo/vbox-dev



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20100707/9e6c4c17/attachment.html>


More information about the vbox-dev mailing list