Skip to content

Instantly share code, notes, and snippets.

@erkl
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erkl/c68e85e9ed9e6ab17d05 to your computer and use it in GitHub Desktop.
Save erkl/c68e85e9ed9e6ab17d05 to your computer and use it in GitHub Desktop.
# ...
name="linux"
base="$HOME/.vm"
disk="$base/$name/$name.vdi"
# Create and register the virtual machine.
VBoxManage createvm --name "$name" --basefolder "$base" --register
# ...
VBoxManage modifyvm "$name" --ostype Linux_64
VBoxManage modifyvm "$name" --cpus 1
VBoxManage modifyvm "$name" --memory 4096
VBoxManage modifyvm "$name" --firmware bios
VBoxManage modifyvm "$name" --boot1 dvd
VBoxManage modifyvm "$name" --boot2 disk
VBoxManage modifyvm "$name" --nic1 bridged
VBoxManage modifyvm "$name" --nictype1 82540EM
VBoxManage modifyvm "$name" --audio none
# ...
VBoxManage createhd --filename "$disk" --size 8192
VBoxManage storagectl "$name" --name "IDE Controller" --add ide
VBoxManage storageattach "$name" --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium "$disk"
# ...
url="http://mirror.rackspace.com/archlinux/iso/2015.07.01/archlinux-2015.07.01-dual.iso"
iso="/tmp/archlinux-2015.07.01-dual.iso"
# ...
curl -o "$iso" "$url"
VBoxManage storageattach "$name" --storagectl "IDE Controller" --device 0 --port 1 --type dvddrive --medium "$iso"
# ...
# VBoxManage modifyvm "$name" --dvd none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment