[vbox-dev] VB xml format
klaus.espenlaub at oracle.com
Wed Nov 3 21:18:40 UTC 2021
as far as XML goes "extradata" is a simple key/value store. The meaning
of the value varies greatly with the key, and the ones you mentioned
starting with GUI/ are internal stuff managed by the VirtualBox VM
manager UI code.
I would strongly advise against relying on those extradata fields,
because they're not immediately written out (IIRC it's postponed until
GUI termination, or at least for a while to not trigger too many
updates). They're also updated only when the GUI is running. One can
create VMs (and organize them in groups) without using the GUI, and then
this is stale data...
The only truly reliable approach is to use the VirtualBox API. You can
query which VMs are there, which groups, ...
Interpreting the XML files is theoretically possible, but there have
been many changes over the years which moved attributes and tags around,
changed defaults and so on. So getting this right will be essentially
implementing a 2nd version of the XML parsing code in VirtualBox, which
is quite a bit of hairy code in src/VBox/Main/xml/Settings.cpp
The only thing which is possible with usual XML tools is to validate
them against src/VBox/Main/xml/VirtualBox-settings.xsd (and it's likely
that you find some perfectly valid config files which don't validate due
to sloppiness/bugs in the XML schema definition).
On 2021-11-03 15:04, fth0 wrote:
> Hi Bernard, hi Stéphane,
> the only "documentation" of the VirtualBox.xml format that I know of
> is the VirtualBox source code, and you'll find the group attribute
> names in
> (search for "go", including the quotes).
> AFAIU, "go" represents an open group, "gc" represents a closed group.
> I'm not sure about the roles of "n" for "name" and "nf" for "name
>> Am 03.11.2021 um 10:30 schrieb Bernard Giannetti
>> <thebernmeister at hotmail.com>:
>> I'm the author of the Ubuntu VirtualBox indicator and have some
>> additional questions/clarifications please...
>> My indicator parses the VirtualBox configuration file at
>> ~/.config/VirtualBox/VirtualBox.xml to determine the virtual machines
>> and groups. Using only the XMLtags ExtraDataItem where
>> name="GUI/GroupDefinitions/*", I have assumed that:
>> 'go=...' is a group
>> 'm=...': is a machine UUID
>> I noticed between version 1.5 and 1.6 there was the addition of the
>> value "n=GLOBAL" which I skip; I assume this is safe to do so?
>> As Stéphane reported below, I have not seen the name="gc=..." before
>> and cannot reproduce this under version 1.5 or 1.6. Can 'gc' be
>> treated the same as 'go' (that is, a group)?
>> *From:*Stéphane Charette <stephanecharette at gmail.com>
>> *Sent:*Wednesday, 3 November 2021 17:56
>> *To:*vbox-dev at virtualbox.org <vbox-dev at virtualbox.org>; Bernard
>> Giannetti <thebernmeister at hotmail.com>
>> *Subject:*VB xml format
>> Is there documentation available for the VirtualBox XML file format?
>> Specifically, what you'd expect to find in Ubuntu at this location:
>> Bernard Giannetti (the author of the VirtualBox indicator on Ubuntu)
>> and I are trying to understand some fields and could use some
>> assistance. Specifically, right now we're trying to understand the
>> meaning of "*gc=*..." in <ExtraDataItem name="GUI/GroupDefinitions/".
>> Stéphane Charette
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vbox-dev