Complete uninstall Virtualbox

3

2

Few days ago my VirtualMachine Centos refused to launch. It says an "an unexpected shutdown happened before" so it refuses to start and gives error. Now, after unsuccessful, side by side searching internet for a solution, i decided to uninstall it completely and to install everything from scratch. But however i uninstall the the Virtualmachine and next, Virtualbox it is doesn't help. After i install it again it still keeps the old settings and still gives that error. So, i am very upset, and really need help. I also followed Virtualbox uninstall documentation and no success because it just says to uninstall it ordinary way from Control Panel. I have also deleted all related folder also, but again no success. Plz help me. Thank in advance! (i can provide any info upon request)

Cliff Cliffer

Posted 2017-05-23T21:06:17.827

Reputation: 33

you don't uninstall virtual machines, you either delete them, or mount a Centos install disk to the VM, and boot from it to reinstall the OS over the existing one. as for your virtualbox settings, they are likely in your user profile in your %appdata% directory, so check in C:\Users\yourusernamehere\Appdata\Local\.virtualbox\. – Frank Thomas – 2017-05-23T22:23:32.967

Answers

8

After you uninstall Virtualbox from control Panel

You also have to delete the folder:

C:\Users\[Your User Name]\Appdata\Local\.virtualbox

You may have to enable Show hidden files and folders option for Appdata folder to be visible (see here for how to do this on Windows 7).

Ahmed Akhtar

Posted 2017-05-23T21:06:17.827

Reputation: 195

@CliffCliffer Welcome, glad that it did. It's my first answer on superuser. – Ahmed Akhtar – 2017-05-25T11:37:01.697

Does this remove the drivers that are installed alongside VirutalBox? – Stevoisiak – 2019-08-06T19:13:05.863

@Stevoisiak Which drivers are you referring to? I don't know of any drivers that are installed alongside VirtualBox. – Ahmed Akhtar – 2019-08-07T10:19:24.117

5

Disclaimer: this procedure is dangerous and can break your host system. Please backup your data or/and take a system image first. (That said, I've applied this procedure twice to my main Windows 7 machine, and the operating system is still running fine.)

My situation: I wanted to update from VirtualBox 5.1.22 to 5.1.28. The installer of newer version hanged near the end, so I needed to properly uninstall 5.1.22 first to get it work:

  1. Download psexec.exe and CCleaner. Then unplug network cable, turn off wifi. Kill google drive, dropbox, and other system-invasive tools (and do this again if you restart during the procedure).

  2. Uninstall using the VirtualBox uninstaller from Control Panel (for some reason I didn't have one on my machine).

  3. Remove the folders C:/Program Files/Oracle/VirtualBox and %userprofile%\.VirtualBox

  4. Remove virtual box drivers (files starting with VBox..) from C:\Windows\system32\drivers\

  5. Clean up windows registry: start regedit.exe as an administrator, search for VirtualBox everywhere and thoughtfully but carefully (don't break other stuff) delete the corresponding folders, keys and values.

At this point, I was blocked because I couldn't remove the children folders (which are VirtualBox network drivers) of Computer/HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Enum/Root/NET/ folder. For me, the workaround consisted in

  • Download PsExec.exe to your desktop

  • Go Start and in "Start search" type in: cmd. Hold CTRL and SHIFT keys, press Enter. Command prompt window will open.

  • Copy and paste following command: "%userprofile%\desktop\psexec" -i -d -s c:\windows\regedit.exe

Using such the empowered version of regedit, you need

  • Take the ownership of ../NET folder (right click, "Permissions...", Advanced, Owner tab, check on "Replace owner on subcontainers and objects")

  • Add Full Control to OWNER RIGHTS

  • Remove all the children folders of ../NET Maybe you'll need to play around with the permission further, machine restarts might help.

Goal: ../NET should be clean of VirtualBox driver folders, and have the Full Control permissions for administrators and OWNER RIGHTS as well.

Then several passes of CCleaner followed by restarts, and finally you are clean. If everything was done correctly, you now will be able to successfully install the newest version of VirtualBox, if necessary.

Related question: How to uninstall Virtualbox on windows10?

Hope

Posted 2017-05-23T21:06:17.827

Reputation: 167

Nice findings for all the places where it leaves its traces. However, this creates much more panic than needed ("this procedure is dangerous") ...as usually with system tweak guids - come on people its just an OS. Usually, user data is left untouched and can be recovered easily by hooking up the harddrive to another computer. – masterxilo – 2018-09-24T11:56:23.967

It depends on the recover tools you dispose. This disclaimer was suggested by Ramhound.

– Hope – 2018-09-27T16:20:08.107

0

The only thing that worked for me was to extract the original installer to the path.

This is what I did:

  1. Download the installer
  2. Open Command Prompt
  3. Change to dir containing the installer
  4. Run the installer with the --extract parameter. eg: VirtualBox-5.1.22-115126-Win.exe --extract
  5. Uninstall VirtualBox in the usual way (using "Add or Remove Programs" / "Apps & Features"), or you should be able to run the installer for your new version of VirtualBox.

David Gallagher

Posted 2017-05-23T21:06:17.827

Reputation: 131

0

As well as following the steps in the accepted answer I had to do the following step.

I am using a Windows 7 Enterprise.

In File Explorer enter %userprofile% in the addressbar. If you have Show hidden files and folders available you will see a folder called .VirtualBox.

Delete the .VirtualBox folder

cageyKJ

Posted 2017-05-23T21:06:17.827

Reputation: 1