When seeting up such an environment, I'd like to automate as many tasks as possible. For this purpose, I found the (command line command) VBoxManage executable to be an invaluable tool. With VBoxManage, the guest can be administered and configured to quite an extent.
I hope, this article can demonstrate some basic usages and features of VBoxManage.
#
# Executing an executable on the guest.
# Note: the .exe suffix is mandatatory (on Windows, of course)
#
# Note also: the VBoxService service (which somehow was installed on the
# guest) needs to run in order of this command to work
#
VBoxManage guestcontrol $vmNameClone run --exe ipconfig.exe --username $userName --password $password
With the ability to call executables and passing parameters, we're able to mount (map with net use) a shared folder to a letter.
When I created the virtual machine, I already specified the (host) location for a shared folder. This shared folder is accessible under the virtual server \\vboxsvr:
VBoxManage guestcontrol $vmNameClone run --username $userName --password $passWord -- net.exe use x: \\vboxsvr\shr
As far as I can tell, the way to revert to a previous snapshot seems to be:
VBoxManage controlvm $vmNameClone pause
# VBoxManage controlvm $vmNameClone savestate // no need to save state, takes too long as we're going to throw away the current state of the machine anyway.
VBoxManage controlvm $vmNameClone poweroff
VBoxManage snapshot $vmNameClone restore after-installation
VBoxManage startvm $vmNameClone