How To Completely Uninstall Virtualbox from Ubuntu?

VirtualBox is a widely used virtualization software that allows users to run multiple operating systems on a single host system. While it offers many benefits, such as flexibility and scalability, there may come a time when you need to uninstall VirtualBox from your Ubuntu system. Whether you need to free up disk space or switch to a different virtualization software, it’s essential to completely uninstall VirtualBox to avoid any potential issues. In this guide, we’ll walk you through the steps to uninstall VirtualBox from Ubuntu.

Here is How to Uninstall Virtualbox from Ubuntu Completely with the step-by-step instructions provided below. So there are many ways to remove Virtualbox from your Linux computer but the best ways are provided below.

To check if the VirtualBox is already installed then check the version of the Virtualbox with the following commands:

sudo apt install aptitude
aptitude search virtualbox\*

If the latest version virtualbox-5.1. is installed in your computer then check the version by

dpkg-query -s virtualbox-5.1

To Remove VirtualBox packages from your Ubuntu system follow the steps provided below.

Step 1: Remove VirtualBox packages

The first step in uninstalling VirtualBox is to remove the VirtualBox packages from your system. To do this, open the terminal and type the following command:

sudo apt-get remove virtualbox

This command will remove the VirtualBox package from your system, but it will not remove any of the VirtualBox configuration files or dependencies.

Step 2: Remove VirtualBox configuration files

After removing the VirtualBox package, you need to remove the configuration files associated with it. To do this, type the following command in the terminal:

sudo apt-get purge virtualbox

This command will remove all VirtualBox configuration files and dependencies from your system.

Step 3: Remove VirtualBox kernel modules

VirtualBox installs kernel modules that allow it to communicate with the host operating system. To completely remove VirtualBox from your system, you need to remove these kernel modules. To do this, type the following command in the terminal:

sudo dkms remove virtualbox/[version] --all

Replace [version] with the version of VirtualBox that you have installed. For example, if you have VirtualBox version 6.1.26 installed, you would type:

sudo dkms remove virtualbox/6.1.26 --all

This command will remove all VirtualBox kernel modules from your system.

Step 4: Remove VirtualBox user configuration files

VirtualBox also creates user-specific configuration files in your home directory. To remove these files, open the terminal and type the following command:

rm -rf ~/.config/VirtualBox

This command will remove all VirtualBox configuration files from your home directory.

Step 5: Remove VirtualBox data files

Finally, you need to remove any VirtualBox data files that may still be on your system. To do this, type the following command in the terminal:

sudo rm -rf /usr/src/vbox*
sudo rm -rf /etc/vbox
sudo rm -rf /var/lib/vbox

These commands will remove any remaining VirtualBox data files from your system.

Conclusion Uninstalling VirtualBox from Ubuntu is a straightforward process that requires a few simple steps. By following the steps outlined in this guide, you can completely remove VirtualBox from your system and free up disk space. Whether you are switching to a different virtualization software or simply need to free up space, properly uninstalling VirtualBox is essential to avoid any potential issues.

Another Method to uninstall Virtualbox from Ubuntu

The problem is Virtual Box keeps its folder and settings in your home folder. You have to delete everything inside the folder.

First, uninstall VirtualBox

sudo apt-get remove --purge virtualbox 

Run these commands to delete all virtual machines and settings and Virtual Hard Drives:

sudo rm ~/"VirtualBox VMs" -Rf
sudo rm ~/.config/VirtualBox/ -Rf

Run this command If you want to install it again

sudo apt-get install virtualbox

Additionally, check:

sudo ps aux | grep -i "vbox"

Kill any “ghost” processes you may think are relevant.

sudo pkill VBox*

Read also:

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top