How to Delete a Virtual Machine from VirtualBox

Mar 19, 2019 - 12 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.

.

Related articles:

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

12 Comments

» Comments RSS Feed

  1. Gary H says:

    I’ve found that to free up all the space used by a VM you have to reboot your Mac. I had a large VM (50+GB) that I removed but noticed I didn’t get all the space back after removing the VM. I rebooted and got back an additional 6GB of space.

  2. sowndarya says:

    It helped me..im learning how to use virtual box and i created a vm but i dont know how to delete.this article helped me..not everyone are born by genius..everything learned by step by step..

  3. Someone says:

    Hello
    I NEED HELP PLEASE
    I was taking an Operating System course and made a VM called Ubuntu three months ago.
    I uninstalled today VirtualBox without removing the VM!!! And there is still a huge 10 GB folder in my C drive :(!!! It can’t be deleted.
    What to do now?? Do I need to install VirtualBox again? And if I did, will I find my VM that I want to delete?? PLEASE HELP.

    • Paul says:

      You just need to find where the Virtual Machine keeps the VM files and delete it manually to recover that disk space. You may need to have admin privileges to be able to do so.

  4. A7x says:

    After doing that, can I use storage which I shared for VirtualBox (15 GB) again?

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

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

        • Matt says:

          I didn’t find it dumb. I didn’t know how to delete a VM from command line, and since the host machine is a server with no GUI, I have no choice but to use command line.

        • Yesme Again says:

          Yes, it’s all common sense. But how do we get this common sense? From experience … from learning … and … from this website !
          English is not my native language. I was looking at the big buttons in Virtualbox. One says “Discard”. Is that the same as ‘delete’ or ‘remove’? Well, it is not clear to me.
          So thanks a bunch to the writer of the article.

        • Yes Itsme says:

          Yes, it’s all common sense. But how do we get this common sense? From experience … from learning … and … from this website !
          English is not my native language. I was looking at the big buttons in Virtualbox. One says “Discard”. Is that the same as ‘delete’ or ‘remove’? Well, it is not clear to me.
          So thanks a bunch to the writer of the article.

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

Troubleshooting

Shop on Amazon to help support this site