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)
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).
-
@CliffCliffer Welcome, glad that it did. It's my first answer on superuser. – Ahmed Akhtar May 25 '17 at 11:37
-
Does this remove the drivers that are installed alongside VirutalBox? – Stevoisiak Aug 6 '19 at 19:13
-
@Stevoisiak Which drivers are you referring to? I don't know of any drivers that are installed alongside VirtualBox. – Ahmed Akhtar Aug 7 '19 at 10:19
-
2To keep corrupt machines from coming back after reinstall I had to search the drive for "virtualbox" and delete everything that came up. The above was insufficient. – Chris Jenks Apr 22 '20 at 23:06
-
@ChrisJenks Thanks your comment might help someone with the same issue as you. – Ahmed Akhtar Apr 23 '20 at 15:19
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:
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).
Uninstall using the VirtualBox uninstaller from Control Panel (for some reason I didn't have one on my machine).
Remove the folders
C:/Program Files/Oracle/VirtualBox
and%userprofile%\.VirtualBox
Remove virtual box drivers (files starting with VBox..) from
C:\Windows\system32\drivers\
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?
-
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 Sep 24 '18 at 11:56
-
The only thing that worked for me was to extract the original installer to the path.
This is what I did:
- Download the installer
- Open Command Prompt
- Change to dir containing the installer
- Run the installer with the
--extract
parameter. eg:VirtualBox-5.1.22-115126-Win.exe --extract
- 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.
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
Run the installer with the --extract parameter. eg: VirtualBox-5.1.22-115126-Win.exe --extract , this is working well
-
Whenever I want to truly uninstall a program in Windows, I use Revo Uninstaller (the free version will do just fine), let the uninstaller that comes with the program I want to get rid of do its job (Revo starts it for me), then click on the Advanced radio button in Revo, and proceed to delete each and every pre-checked file and folder Revo lists for me. I reboot if need be (with VirtualBox, it's better to reboot), and I usually have no aftermath to live with. – user1019780 Apr 12 '20 at 9:20
-
2
%appdata%
directory, so check in `C:\Users\yourusernamehere\Appdata\Local\.virtualbox`. – Frank Thomas May 23 '17 at 22:23