36

This question already has an answer here:

I had installed VirtualBox but it started giving me problems. So I uninstalled it using:-

sudo apt-get remove virtualbox-\*
sudo apt-get purge virtualbox-\*

But when I reinstalled VirtualBox it again resumed to previous settings and started giving same problems. How can i completely remove VirtualBox from my laptop and then reinstall it such that it wont give same problem again?

marked as duplicate by terdon Jun 22 '17 at 9:35

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

46

Your problem : Virtual Box keeps its folder and settings in your home folder. Delete everything inside the folder.

Uninstall VirtualBox first.

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

If you want to install it again. Run this command:

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*
  • After reinstalling virtual box by following your procedure it said that fedora was inaccesible so i just removed it. Has it been successfuly removed? – Manish Sakpal Nov 29 '15 at 5:30
  • @Manishsakpal yes it has. – Neil Nov 29 '15 at 8:52
  • it is giving error to . ? – Manish Sakpal Nov 29 '15 at 8:57
  • @Manishsakpal What error. you may want to try my answer again. – Neil Nov 29 '15 at 8:58
  • Error is:- rm: invalid option -- '.' Try 'rm --help' for more information. – Manish Sakpal Nov 29 '15 at 9:01
26
sudo apt-get remove virtualbox* --purge

Just try one command for remove all VM. Or perticulary one VM

sudo apt remove virtualbox virtualbox-5.0 virtualbox-4.*

After that, you maybe get some instruction which will already give there you just need to type on the command line. Then again run same above command.

  • 1
    why didn't you add this to your other answer instead of posting a new one? – Zanna Mar 10 '17 at 9:33
  • Sorry @Zanna I just forgot. I will update. – jsroyal Mar 10 '17 at 9:35
  • 5
    And it was never updated. – Rexford Jan 30 '18 at 6:47
14

First find installed package using below command :

sudo dpkg -l | grep virtualbox 

Then copy packages and remove using dpkg or apt-get as below :

sudo dpkg --purge <Packages>

--force-all optional

And also manually remove folder on home directory (~/"VirtualBox VMs").

3
sudo apt remove virtualbox virtualbox-5.0 virtualbox-4.*

After that, you maybe get some instruction which will already give there you just need to type on the command line. Then again run same above command.

3

For me nothing helped but this

$ sudo /opt/VirtualBox/uninstall.sh
$ sudo rm -rf /opt/VirtualBox/

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