Skip to content

Instantly share code, notes, and snippets.

@keithhamilton
Last active August 30, 2016 18:35
Show Gist options
  • Save keithhamilton/9770267 to your computer and use it in GitHub Desktop.
Save keithhamilton/9770267 to your computer and use it in GitHub Desktop.
Install Virtualbox and Vagrant on OS X
#!/bin/bash
# make sure brew and wget are installed
BREW=`which brew | sed -e 's/\// /g' | awk '{print $NF}'`
if [ -z $BREW ]; then
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
WGET=`which wget | sed -e 's/\// /g' | awk '{print $NF}'`
if [ -z $WGET ]; then
brew install wget
fi
fi
# Vagrant
wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.5.1.dmg -O ~/Downloads/vagrant_1.5.1.dmg
hdiutil mount ~/Downloads/vagrant_1.5.1.dmg
sudo installer -package /Volumes/Vagrant/Vagrant.pkg -target /
diskutil unmount force /Volumes/Vagrant
# VirtualBox
wget http://download.virtualbox.org/virtualbox/4.3.8/VirtualBox-4.3.8-92456-OSX.dmg -O ~/Downloads/VirtualBox-4.3.8-92456-OSX.dmg
hdiutil mount ~/Downloads/VirtualBox-4.3.8-92456-OSX.dmg
sudo installer -package /Volumes/VirtualBox/VirtualBox.pkg -target /
diskutil unmount force /Volumes/VirtualBox
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment