I have been working with VirtualBox and vagrant a lot today and found myself having to double check the VBoxManage CLI syntax a number of times. So I'm dumping a quick cheatsheet down to help remember it / help anyone else wanting to efficiently manage VBox VMs.

Start a VM

VBoxManage startvm "Name of VM" --type headless|gui

Forcibly Shutdown a VM

VBoxManage controlvm "Name of VM" poweroff

List VMs

VBoxManage list vms

Unregister/delete a VM

VBoxManage unregistervm "Name of VM" --delete

Forward / Unforward Ports for SSH

Modifyvm must be only be used when VM is powered off, otherwise controlvm for running VMs.

VBoxManage modifyvm "VM name" --natpf1 "guestssh,tcp,,2222,,22"
VBoxManage modifyvm "VM name" --natpf1 delete "guestssh"