Unregistering a VM
Combine with
--delete
to also remove associated
- Hard disk images
- Saved state files
- The machine XML file and its backups
- Machine log files
- The machine directory (if it is empty after deleting the above files)
$vmName = …
VBoxManage controlvm $vmName poweroff
VBoxManage unregistervm $vmName --delete