Skip to content

Instantly share code, notes, and snippets.

@jrhea
Last active August 29, 2015 14:01
Show Gist options
  • Save jrhea/9061ffdc3058791b46a0 to your computer and use it in GitHub Desktop.
Save jrhea/9061ffdc3058791b46a0 to your computer and use it in GitHub Desktop.
Batch file to create VirtualBox VM
cd "C:\Program Files\Oracle\VirtualBox\"
VBoxManage unregistervm "foo" --delete
echo Creating machine...
VBoxManage createvm --name "foo" -register
echo Registering OS Type
VBoxManage modifyvm "foo" --ostype Debian_64
echo Setting boot order
VBoxManage modifyvm "foo" --boot1 disk
VBoxManage modifyvm "foo" --boot2 none
VBoxManage modifyvm "foo" --boot3 none
VBoxManage modifyvm "foo" --boot4 none
echo Disable usb...
VBoxManage modifyvm "foo" --usb off --usbehci off
echo Enabling clipboard...
VBoxManage modifyvm "foo" --clipboard bidirectional --draganddrop hosttoguest
echo Enabling audio...
VBoxManage modifyvm "foo" --audio dsound --audiocontroller ac97
echo Enabling Remote Desktop Extension
VBoxManage modifyvm "foo" --vrde on
echo Setting machine specs...
VBoxManage modifyvm "foo" --memory "2048" --vram "16" --cpus "2" --acpi on --ioapic on
echo Creating HD Controller...
VBoxManage storagectl "foo" --name "SATA Controller" --add sata --controller IntelAhci
echo Registering HD...
VBoxManage storageattach "foo" --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium "foo.vdi"
echo Creating network interface 1...
VBoxManage modifyvm "foo" --nic1 bridged --nictype1 82540EM --bridgeadapter1 "Intel(R) 82579LM Gigabit Network Connection" --macaddress1 080027FF0C42 --nicpromisc1 allow-all
echo Creating network interface 2...
VBoxManage modifyvm "foo" --nic2 hostonly --nictype2 82540EM --hostonlyadapter2 "VirtualBox Host-Only Ethernet Adapter" --macaddress2 080027D96666 --nicpromisc2 allow-all
echo All Done...
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment