Is there a way to use VirtualBox without using it's resource registry?
Posted
by
Catskul
on Super User
See other posts from Super User
or by Catskul
Published on 2012-07-09T17:06:07Z
Indexed on
2012/07/09
21:18 UTC
Read the original article
Hit count: 197
Summary
VirtualBox seems to want everything to be "registered" which makes it much more annoying to work with on the command line.
I'm attempting to create an automated script which will create, move, start, stop, and destroy virtual machines and virtual disks. Requiring registration will complicate the task for the following reasons.
- leaves state information around that can cause unpredicted edgecases causing scripts to fail.
- creates potential name space collisions for multiple process creating VMs with the same name
- moving/copying resources on the same machine is more complicated because references in the registry need to be updated
- copying resources (disk + vm combination) to another machine require reconfiguration once they reach their target machine, and require the transfer of extra meta data to do the reconfiguration.
- If something unexpectedly fails, and an unregister thus fails to happen, left over configuration information can cause problems in subsequent runs.
Use Case
My specific use case is for a continuous integration server which creates and destroys VMs and Disk images potentially with the same name, and would require more logic to deal with the registry's statefulness.
Imaginary Example
It seems that I should just be able to for example (using some imaginary and/or incorrect commands):
mkdir foobar
customdiskimg_script ./foo/foo.vdi
vboxmanage createvm --name "foo" --ostype Linux --basefolder ./foo/foo.xml
vboxmanage storagectl ./foo/foo.xml --name foo --add ide
vboxmanage storageattach --storagectl foo --medium ./foo/foo.vdi ./foo/foo.xml
vboxmanage startvm ./foo/foo.xml
TLDR
Is there a way to use virtualbox without "registering" harddisks and VMs?
© Super User or respective owner