Skip to content

Instantly share code, notes, and snippets.

@lox
Last active February 26, 2020 18:54
Show Gist options
  • Save lox/52f27919816a7eadb6d3 to your computer and use it in GitHub Desktop.
Save lox/52f27919816a7eadb6d3 to your computer and use it in GitHub Desktop.
Uninstall VirtualBox from the command-line
#!/bin/bash
set -e
version=$(VBoxManage --version)
filename="VirtualBox-${version//r/-}-OSX.dmg"
base=$(echo ${version//r/-} | cut -d- -f1)
echo "downloading installer (for uninstall tool)"
if ! [ -f ~/Downloads/$filename ]; then
curl -C - -L -o ~/Downloads/$filename \
"http://download.virtualbox.org/virtualbox/$base/$filename"
fi
(
cd ~/Downloads
echo "mounting volume"
hdiutil attach $filename > /dev/null
yes 'Yes' | sudo /Volumes/VirtualBox/VirtualBox_Uninstall.tool
hdiutil detach /Volumes/VirtualBox > /dev/null
)
@lox
Copy link
Author

lox commented May 20, 2014

Run with

curl -s https://gist.githubusercontent.com/lox/52f27919816a7eadb6d3/raw/uninstall_virtualbox.sh | bash

@kareemjeiroudi
Copy link

Thanks for saving me time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment