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
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).
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:
Uninstall using the VirtualBox uninstaller from Control Panel (for some reason I didn't have one on my machine).
Remove the folders
Remove virtual box drivers (files starting with VBox..) from
Clean up windows registry: start
regedit.exeas 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
../NETfolder (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
../NETMaybe you'll need to play around with the permission further, machine restarts might help.
../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?
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
- 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