Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
2  
Accept the nice answer the guy wrote to you.... – gsamaras Jan 22 at 20:03

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.

enter image description here

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.

enter image description here


Command line

This can also be done from command line with the following command:

VBoxManage unregistervm --delete "<Name of Machine>"

By doing so the following files will be deleted:

  • all hard disk image files, including differencing files, which are used by the machine and not shared with other machines;
  • saved state files that the machine created, if any (one if the machine was in "saved" state and one for each online snapshot);
  • the machine XML file and its backups;
  • the machine log files, if any;
  • the machine directory, if it is empty after having deleted all the above.

Source: Virtual Box Manual

share|improve this answer

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.

MyHostName:homedir ayekay$ ps -ef| grep -i My-Locked-VM
1624398723  1196 23121   0 11:34AM ??         0:05.11 /Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/MacOS/VirtualBoxVM --comment My-Locked-VM --startvm 8dc249f1-6877-4caf-bbd4-27ae6b78ceb6 --no-startvm-errormsgbox --separate
1624398723 89252 23121   0 10:06AM ??         3:07.87 /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless --comment My-Locked-VM --startvm 8dc249f1-6877-4caf-bbd4-27ae6b78ceb6 --vrde config
1624398723  2323 79114   0 11:48AM ttys007    0:00.00 grep -i My-Locked-VM
MyHostName:homedir ayekay$ kill -9 1196 89252
MyHostName:homedir ayekay$

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.

share|improve this answer
    
You could be a bit more elaborate about how to do that, this would greatly improve the quality of your answer. – Videonauth Jun 3 at 1:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.