[vbox-dev] VB xml format

Klaus Espenlaub klaus.espenlaub at oracle.com
Wed Nov 3 21:18:40 UTC 2021

Hi everyone,

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 
> src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.cpp 
> (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 
> favorite".
> Regards
> fth0
>> Am 03.11.2021 um 10:30 schrieb Bernard Giannetti 
>> <thebernmeister at hotmail.com>:
>> Hi,
>> 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)?
>> Thanks,
>> Bernard.
>> ------------------------------------------------------------------------
>> *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
>> Devs,
>> Is there documentation available for the VirtualBox XML file format?  
>> Specifically, what you'd expect to find in Ubuntu at this location:  
>> ~/.config/VirtualBox/VirtualBox.xml
>> 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/".
>> Thanks,
>> Stéphane
>> --
>> <https://about.me/stephane.charette?promo=email_sig&utm_source=product&utm_medium=email_sig&utm_campaign=edit_panel&utm_content=thumb> 
>> Stéphane Charette
>> about.me/stephane.charette 
>> <https://about.me/stephane.charette?promo=email_sig&utm_source=product&utm_medium=email_sig&utm_campaign=edit_panel&utm_content=thumb> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20211103/19a997ad/attachment-0001.html>

More information about the vbox-dev mailing list