Uninstall Virtualbox 5.1.30/5.2.2 in macOS Sierra preserving settings

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
joseluisbz
Posts: 57
Joined: 26. Jan 2017, 19:18
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Windows, macOS, CentOS

Uninstall Virtualbox 5.1.30/5.2.2 in macOS Sierra preserving settings

Post by joseluisbz »

Hi, I want to know what settings file I need to copy in order to be applied again later.

I want to uninstall Virtualbox in my macOS Sierra, I'm not sure if it is working according expectation, but I don't want to lose my guest settings and general settings.

When I remove from macOS the settings are lost.
What files and locations I need to save?
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Uninstall Virtualbox 5.1.30/5.2.2 in macOS Sierra preserving settings

Post by socratis »

Ch. 10.1 Where VirtualBox stores its files of the User Manual.

You should have a searchable PDF included with your installation (Help » Contents). Take advantage of that fact and use it to search the PDF for those terms.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
joseluisbz
Posts: 57
Joined: 26. Jan 2017, 19:18
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Windows, macOS, CentOS

Re: Uninstall Virtualbox 5.1.30/5.2.2 in macOS Sierra preserving settings

Post by joseluisbz »

Code: Select all

$ cp -r ~/Library/VirtualBox /SOME/PATH

$ sudo rm -rf /Applications/VirtualBox.app
$ sudo rm -rf /Applications/VirtualBox.pkg
$ sudo rm -rf /Library/Application\ Support/VirtualBox
$ sudo rm /Library/LaunchDaemons/org.virtualbox.startup.plist 
$ sudo rm -rf /Library/Python/2.6/site-packages/vboxapi*
$ sudo rm -rf /Library/Python/2.7/site-packages/vboxapi*
$ sudo rm -rf ~/Library/VirtualBox
$ sudo rm ~/Library/LaunchAgents/org.virtualbox.vboxwebsrv.plist 
$ sudo rm -rf ~/Library/Preferences/org.virtualbox.app*
$ sudo rm -rf ~/Library/Saved\ Application\ State/org.virtualbox.app*
$ sudo rm /dev/vbox*

$ sudo find /private/var/db -iname "*virtualbox*" -delete

$ sudo rm -rf /usr/local/bin/V*Box*
$ sudo rm -rf /usr/local/bin/vbox*
Hi, this was found.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Uninstall Virtualbox 5.1.30/5.2.2 in macOS Sierra preserving settings

Post by socratis »

joseluisbz wrote:When I remove from macOS the settings are lost.
No, they're not. Not if you use the "VirtualBox_Uninstall.tool" that is in your DMG, they're not. I uninstall and re-install VirtualBox several times a day. My settings, my VMs and their settings are not touched. Just open the uninstall script with a decent text editor and see what gets deleted...
joseluisbz wrote:but I don't want to lose my guest settings and general settings.
Well, the following ones that you are deleting with your "script", *are* your settings/preferences. *YOU* are manually deleting the preferences!!!
joseluisbz wrote:

Code: Select all

$ sudo rm -rf ~/Library/VirtualBox
$ sudo rm ~/Library/LaunchAgents/org.virtualbox.vboxwebsrv.plist
$ sudo rm -rf ~/Library/Preferences/org.virtualbox.app*
$ sudo rm -rf ~/Library/Saved\ Application\ State/org.virtualbox.app*
Stick with the "VirtualBox_Uninstall.tool". If you want to start experimenting, expect trouble if you don't know what you're doing.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
joseluisbz
Posts: 57
Joined: 26. Jan 2017, 19:18
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Windows, macOS, CentOS

Re: Uninstall Virtualbox 5.1.30/5.2.2 in macOS Sierra preserving settings

Post by joseluisbz »

You have reason,

The Uninstaller left:

Code: Select all

$ sudo ls -al ~/Library/Preferences/org.virtualbox.app.VirtualBox*
-rw-------  1 joseluisbz  staff  288 Dec 15 11:06 /Users/joseluisbz/Library/Preferences/org.virtualbox.app.VirtualBox.plist
-rw-------  1 joseluisbz  staff   80 Dec 15 11:16 /Users/joseluisbz/Library/Preferences/org.virtualbox.app.VirtualBoxVM.plist
$

$ sudo ls -al ~/Library/Saved\ Application\ State/org.virtualbox.app.VirtualBox*
/Users/joseluisbz/Library/Saved Application State/org.virtualbox.app.VirtualBox.savedState:
total 32
drwx------   5 joseluisbz  staff   170 Dec 15 11:16 .
drwx------@ 25 joseluisbz  staff   850 Dec 15 11:17 ..
-rw-------   1 joseluisbz  staff  1104 Dec 15 11:16 data.data
-rw-------@  1 joseluisbz  staff  5376 Dec 15 11:17 window_1.data
-rw-------   1 joseluisbz  staff   404 Dec 15 11:16 windows.plist

/Users/joseluisbz/Library/Saved Application State/org.virtualbox.app.VirtualBoxVM.savedState:
total 32
drwx------   5 joseluisbz  staff   170 Dec 15 11:42 .
drwx------@ 25 joseluisbz  staff   850 Dec 15 11:17 ..
-rw-------   1 joseluisbz  staff  1088 Dec 15 11:42 data.data
-rw-------@  1 joseluisbz  staff  6208 Dec 15 11:44 window_1.data
-rw-------   1 joseluisbz  staff   895 Dec 15 11:42 windows.plist
$

$ sudo find /private/var/db -iname "*virtualbox*"
/private/var/db/BootCaches/E22879AF-588D-4B0E-AB99-B3FBABE80132/app.org.virtualbox.app.VirtualBox.playlist
$ 
I used comparator to get what files and folders are installed on Guest "clean of VirtualBox" macOS.
And I was removing manually all the new files appeared when Installation is performed.

Then we have two options, uninstaller an manually command (securely erasing folder and files).

Check the running unistaller y check my list, may be yo get files not erased by tool.
Post Reply