My approach is to package the VM's so the necessary disk and vbox files live in a certain location C:\VirtualBox\VMs (vbox files & snapshots) C:\VirtualBox\Vdisk (vdisk files). There is the potential for there to be 11 VM's to be made available to the students. One package I have created is VirtualBox.
#HOW TO USE VIRTUALBOX MACHINE XML SOFTWARE#
I'm using some packaging software to deliver applications to machines. If I explain my problem in a little more detail. My problem is that when I edit the file using a PowerShell script, which I've checked is fine after editing, that it just reverts back to a previous state as soon as VirtualBox is opened. If I manually remove the node and save it then it doesn't come back (until a machine has been added/removed so no more remain in VirtualBox).
![how to use virtualbox machine xml how to use virtualbox machine xml](https://3.bp.blogspot.com/-DyH--U0o8ZE/V1CMDLG7OfI/AAAAAAAAVHE/koi0UwC5JxUPAXMwwRbHYilc5C6KsvczQCLcB/s1600/virtualbox-default-machine-folder.png)
Manually editing the file isn't the problem. Here's a virgin VirtualBox.xml for comparison:Ĭode: Select all Expand view Collapse view No closing tag has a space before it because it's not permitted.
![how to use virtualbox machine xml how to use virtualbox machine xml](https://i.stack.imgur.com/fFPj8.png)
Once you're satisfied with your changes, lock the template. If any VirtualBox process is running, that file is in memory and any edit will be ignored. If you do want to add/delete to that user from the CLI, use VBoxManage. Create a "template" user and modify that one. Mers101 wrote:I'm trying to dynamically add and delete machines from the users VirtualBox.xml file.ĭon't. If I manually edit the VirtualBox.xml file after VirtualBox has opened/closed and delete the node then this node doesn't show up again (unless you add a machine and remove so no machines are available in VirtualBox GUI).ĭoes anybody know how these elements are built and how I can stop the empty node from being created?ĮDIT: I know I could use vboxmanage commands but this takes too long and there would be student complaints. The one which is causing me problems is the node, to confuse things further it sometimes shows up as (no space after forward slash). Even if I already have a default VirtualBox.xml file in the user profile certain elements are added. The VirtualBox.xml file which lives in C:\Users\\.VirtualBox seems to be built by default with certain nodes/elements. This is so I can package the VM's and make them available to users using some custom software we have at the University. I'm trying to dynamically add and delete machines from the users VirtualBox.xml file.