Notes to self
› VirtualBox: New VM from command-line

Command-line commands to create a new virtual machine with fairly standard settings, on the Windows version of VirtualBox. Save these lines to, say, Web.cmd and run it.

The example shows how to create a Debian VM with 256 MB of RAM, a new 10 GB virtual HD and the install disc loaded into the virtual DVD drive.

If host hardware allows it, also include the last line where hardware virtualization via VT-x/AMD-V is enabled.

@echo off

REM Configuration
SET VMName=Basic web server
SET ISOName=C:\path-to-iso-storage\debian-6.0.1a-i386-netinst.iso

REM Actions
cd "C:\Program Files\Oracle\VirtualBox"
vboxmanage createvm --name "%VMName%" --ostype Debian --register
vboxmanage modifyvm "%VMName%" --memory 256 --nic1 nat
vboxmanage createhd --filename "%VDIName%.vdi" --size 10000
vboxmanage storagectl "%VMName%" --name "SATA" --add sata
vboxmanage storageattach "%VMName%" --storagectl "SATA" --port 0 --device 0 --type hdd --medium "%VDIName%.vdi"
vboxmanage storagectl "%VMName%" --name "IDE" --add ide
vboxmanage openmedium dvd "%ISOName%"
vboxmanage storageattach "%VMName%" --storagectl "IDE" --port 0 --device 0 --type dvddrive --medium "%ISOName%"

REM Optional, if supported by hardware
vboxmanage modifyvm "%VMName%" --hwvirtex on