I have installed Windows XP in my VirtualBox some days ago. Now, I want to remove Windows XP completely from VirtualBox and I decided to install Ubuntu 13.04 for testing.
What is the correct way to remove completely Windows XP from VirtualBox?
It makes no sense to keep a particular Virtual Machine and change the OS inside - so remove the VM and create a new one:
Virtual Box Manager
In the graphical frontend for Virtual Box we can easily remove a virtual machine by selecting the machine to remove and go to the menu entry "Machine --> Remove" or choose "Remove" from the right-click context menu.
We will then be asked whether we wish to only remove the machine (i.e. unregister it) or if we want to also "Delete all files". The latter will completely remove the virtual machine with all files from our drive.
This can also be done from command line with the following command:
By doing so the following files will be deleted:
If the issue still persists, you can also kill the VBoxHeadless & VirtualBoxVM processes associated with the VM.
E.g. Assume the name of your locked / bad vm is My-Locked-VM.
Get the process id of the VirtualBox processes associated with that VM and kill it.
Once the process is killed, the VirtualBox UI will show the VM state as Aborted. You can then use the UI to delete the VM.