Skip to content

Instantly share code, notes, and snippets.

@seandenigris
Last active February 11, 2024 01:31
Show Gist options
  • Select an option

  • Save seandenigris/5039427 to your computer and use it in GitHub Desktop.

Select an option

Save seandenigris/5039427 to your computer and use it in GitHub Desktop.
VirtualBox: Programmatically Create Debian VM
#!/usr/bin/bash
# Reference: http://stdioe.blogspot.com/2012/01/creating-virtual-machine-with.html
VM_NAME="Debian Squeeze 2"
DEBIAN_CD_IMAGE="debian-6.0.3-amd64-i386-netinst.iso"
# Create VM
VBoxManage createvm --name "$VM_NAME" --ostype Debian --register
# RAM
VBoxManage modifyvm "$VM_NAME" --memory 384
# Hard Disk
VBoxManage createhd --filename "$VM_NAME.vdi" --size 10000 --format
VBoxManage storagectl "$VM_NAME" --name "SATA Controller" --add sata --controller IntelAhci
VBoxManage storageattach "$VM_NAME" --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium "$VM_NAME.vdi"
VBoxManage storagectl "$VM_NAME" --name "IDE Controller" --add ide --controller PIIX4
VBoxManage storageattach "$VM_NAME" --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium "$DEBIAN_CD_IMAGE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment