Try using the VBoxManage command:
VBoxManage list runningvms should giveWhich gives you the name of the VM you want to shut down. For example:
"rails_1366055054" {8144df4b-941f-40d6-ba5f-6e83d398ffd3} To shut down this VM, you run
VBoxManage controlvm VMNAME"rails_1366055054" poweroff powers offNote that this advice only applies when using the VMVirtualBox provider.