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.
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.
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
Is there a way to use virtualbox without "registering" harddisks and VMs?