Note this is aimed at deleting a virtual machine within VirtualBox but otherwise preserving other VMs and VirtualBox itself, it’s not attempting to remove or uninstall VirtualBox as an application though you can of course do that if needed too with these instructions.
Because virtual machines can be quite large, this is often many gigabytes in size. It doesn’t really matter if you delete the virtual machine from the command line or from the VirtualBox application directly, both get the job done.ĭeleting a virtual machine from VirtualBox will free up any storage space that was taken up by that VM and associated OS, including the associated VDI, VMDK, VHD or HDD files. VBoxManage unregistervm -delete "Name of Virtual Machine"ĭeleting a VM from VirtualBox by command line is very thorough and removes all associated virtual hard disk image files, saved states, xml files, backups, VM logs, and all associated directories with the target VM to delete. To use this approach, launch the command line (Terminal in MacOS) and then use the VBoxManage command tool with the following syntax: (note the flag –delete has two dashes) If you prefer to use the command line, you can also completely delete a virtual machine from VirtualBox from a terminal. Thus if you actually want to delete the VM and associated files, choose ‘Delete all files’ How to Delete a Virtual Machine from VirtualBox by Command Line * If you choose “Remove only” than the virtual machine is simply removed from the VirtualBox VM manager, but none of the actual files or associated VM, OS, VDI, or anything else is deleted.