Skip to content

Instantly share code, notes, and snippets.

@adeoke
Last active February 4, 2020 22:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adeoke/dc10c6491a9ad299033e7932efc0f186 to your computer and use it in GitHub Desktop.
Save adeoke/dc10c6491a9ad299033e7932efc0f186 to your computer and use it in GitHub Desktop.
Setup a vagrant, virtualbox and virtualbox extensions on macos
#!/usr/bin/env bash
# Vagrant and virtualbox install script with relatively useful vagrant plugins
# and virtualbox extensions pack (this is needed for USB 2.0 and 3.0 device support, webcam,
# remote vm support, disk image encryption and Intel PXE Boot ROM support).
# NB: Be advised!
# The virtual box extensions requires root access, as such this script should be executed with sudo privileges.
# You may also want to separately install xcode, and xcode command line tools
# (this script has not been tested with the absense of those tools).
echo "installing homebrew, unless it's already installed"
if test ! $(which brew); then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
echo "check homebrew status on your machine"
brew doctor
brew update
echo "Preparing casks for install."
CASKS=(
vagrant
virtualbox
virtualbox-extension-pack
)
echo "Installing cask applications."
for i in "${CASKS[@]}"; do
echo "Installing cask app $i"
brew cask install "$i"
done
echo "Check the list of brew installed applications"
brew list
echo "Preparing commonly used vagrant plugins."
VAGRANT_PLUGINS=(
vagrant-disksize
vagrant-hostsupdater
vagrant-timezone
vagrant-vbguest
)
echo "Installing vagrant plugins."
for i in "${VAGRANT_PLUGINS[@]}"; do
echo "Installing vagrant plugin $i"
vagrant plugin install "$i"
done
echo "list vagrant plugins"
vagrant plugin list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment