How to Delete a Virtual Machine from VirtualBox

Mar 19, 2019 - 4 Comments

How to delete virtual machine from VirtualBox

Finished with a virtual machine and you want to delete it from VirtualBox? Maybe you setup a VM you no longer need, or cloned an OS VM and want to remove it, or perhaps you’re simply aiming to free up disk space by removing virtual machines from VirtualBox, whatever the reason it’s a simple process to delete a virtual machine from VirtualBox.

The instructions we’ll cover here work for completely removing an OS and deleting the associated virtual machine from within VirtualBox on Mac OS, Windows, and Linux. We’ll also show you how to delete a virtual machine from VirtualBox by using the command line.

How to Completely Remove an OS and Delete a Virtual Machine in VirtualBox

To completely delete any virtual machine from VirtualBox on Mac, Windows, or Linux, simply do the following:

  1. Open VirtualBox and go to the VM VirtualBox Manager screen
  2. Select the virtual machine and OS you want to delete (quit the VM if it’s currently active first)
  3. Right-click on the virtual machine name in the list and choose “Remove”, or optionally pull down the “Machine” menu and choose “Remove”
  4. How to delete a virtual machine in VirtualBox

  5. To completely delete the operating system and virtual machine from VirtualBox, choose “Delete all files” *
  6. How to delete a virtual machine from VirtualBox

  7. Repeat with other virtual machines to delete them as needed

* 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. 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 prefer to use the command line, you can also completely delete a virtual machine from VirtualBox from a terminal. 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)

VBoxManage unregistervm --delete "Name of Virtual Machine"

Deleting 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.

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.

Deleting 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. Because virtual machines can be quite large, this is often many gigabytes in size.

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.

Virtual machines offer an easy way to run multiple operating systems at the same time, which is why they’re frequently used in development environments for testing with various operating systems. This particular article is obviously focused on VirtualBox, but there are other VM software packages available too including VMWare and Parallels.

VirtualBox is particularly appealing to many users not only because it’s powerful and cross platform compatible able to run on Mac, Windows, and Linux, but also because it’s free. VirtualBox can do everything from run Windows 10 in a VM all the way back to old versions of Windows with old Internet Explorer versions, or Ubuntu Linux or another Linux distribution or unix flavor, and even Mac OS X (though if you want to virtualize MacOS it’s easier to do so with Parallels) and other operating systems too.

If the general topic of virtualization appeals to you, check out our other virtual machine posts here where you can find tons of tutorials on running a wide range of operating systems in VirtualBox.

Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of our great Apple tips, tricks, and important news delivered to your inbox! Enter your email address below:

Related articles:

Posted by: Paul Horowitz in Mac OS X, Tips & Tricks

4 Comments

» Comments RSS Feed

  1. Carbonaro says:

    the dumbest article ever!
    Next one: How To Delete Th OSXDaily Subscription.

    • Paul says:

      Why is this dumb? Not everyone knows how to delete a VM. Of course not all articles will be relevant to everyone, that’s just the nature of covering a broad range of technical topics.

      • Squiggy says:

        Sorry but this does seem like common sense to me. How long has the convention of deleting something been to right click it and select delete, move to trash, remove, etc.; like 30 years? Besides, if a person is technically inclined enough to know how to install and configure a virtual machine in the first place it should be obvious that they can easily figure out how to delete it if they don’t already know. I do appreciate the tips section and I’ve learned a lot of interesting things here but this one is kind of silly.

  2. Jdjdh says:

    Thanks, have never used this software before but this gave me the confidence to try knowing I can reverse my steps without getting too technical.

Leave a Reply

 

Shop on Amazon.com and help support OSXDaily!

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Tips & Tricks

News

iPhone / iPad

Mac