Config Server Firewall

How to Uninstall VirtualBox on Ubuntu 24.04

In this guide, we’ll show you how to uninstall VirtualBox on Ubuntu. This method works on any Ubuntu version, including Ubuntu 24 and later.

Before uninstalling VirtualBox, it is recommended to delete all your virtual machines. The uninstallation process does not automatically remove the virtual machine files you created.

Step 1: Uninstall the VirtualBox Package and Dependencies

To uninstall VirtualBox, run the following two commands:

sudo apt purge virtualbox*
sudo apt autoremove

The first command uninstalls the main VirtualBox package. The second command removes any leftover dependency packages that are no longer needed.

Step 2: Remove the 'vboxusers' Group

By default, uninstalling VirtualBox does not remove the VirtualBox group called vboxusers. If you want to delete it, you can remove it using the groupdel command:

sudo groupdel vboxusers

Step 3: Delete Virtual Machine Files

The uninstallation process does not automatically remove the virtual machine files you created. These files are typically stored inside your home directory.

In Ubuntu, the default location is the "VirtualBox VMs" folder in your home directory.

Learn More

If you want to learn more about uninstalling packages in Ubuntu, check our tutorial on how to uninstall packages in Ubuntu.

It will help you remove packages by yourself without needing extra help.