#Quick Start Installing VirtualBox on Mac OS X
Written 2016-01-01 by @mikeschinkel
Oracle's VirtualBox is software that loads Bootable Disk Images to run Virtual Machines on a developer or sysadmin's computer.
According to Wikipedia a Virtual Machine is:
An emulation of a particular computer system. Virtual machines operate based on the computer architecture and functions of a real or hypothetical computer, and their implementations may involve specialized hardware, software, or a combination of both.
If you are familiar with VMware Fusion then it should be easy to understand that VirtualBox is simply an open-source equivalent to VMware similar to how Linux is an open-source equivalent to Windows.
##Why Use VirtualBox?
There are many reasons to run a virtual machine using VirtualBox but the reason the author uses it is for running a local web server stack during development and being able to switch between different configurations that reasonably match the production environments for different clients.
If you'd like to know other reasons to use VirtualBox, just click here.
###Developers, Developers, Developers!
The primary tool that developers use with VirtualBox is Vagrant. If you are a software developer and are not familiar with Vagrant or have yet to start using it, read our "Learning Vagrant for WordPress From The Ground Up."
##Downloading and Installing VirtualBox
####IMPORTANT: As of January 2016 we know of numerous incompatibilities between VirtualBox version 5.0.x
and Vagrant version 1.1.8
so we suggest you try VirtualBox version 4.x instead. To do so jump to those instructions (RECOMMENDED.)
To download and install the latest VirtualBox simply visit the VirtualBox Download Page to find, download and then install the latest version of VirtualBox.
At the time of this writing the latest version of VirtualBox was 5.0.12
which you can download directly from here.
###Download and Install via Terminal Command Line Instead
If you prefer to use the command line from within the OS X Terminal you can run the following commands (note this will download and install version 5.0.12 but there may be a newer version when you read this. If so modify the commands accordingly):
cd /tmp
curl -O http://download.virtualbox.org/virtualbox/5.0.12/VirtualBox-5.0.12-104815-OSX.dmg
hdiutil attach VirtualBox-5.0.12-104815-OSX.dmg
sudo installer -pkg /Volumes/VirtualBox/VirtualBox.pkg -target /Volumes/Macintosh\ HD
rm VirtualBox-5.0.12-104815-OSX.dmg
Of you can just download the same as a shell script and then run:
chmod +x install-virtualbox.sh
./install-virtualbox.sh
rm install-virtualbox.sh
###Download and Install using HomeBrew Instead Of course if you happen to already be using HomeBrew and its Casks then installing VirtualBox is much easier:
brew cask install virtualbox
If you decided to install VirtualBox version 5.x with the above instructions you are done!
##Version 4.3.x
To download and install VirtualBox 4.3 simply visit the VirtualBox "Old Builds" Download Page to find, download and then install the version 4.3.x
of VirtualBox.
Or download 4.3.x
directly from here.
###Download and Install 4.3.x via Command Line
If you prefer to use the command line from within the OS X Terminal you can run the following commands to download and install version 4.3.34
:
cd /tmp
curl -O http://download.virtualbox.org/virtualbox/4.3.34/VirtualBox-4.3.34-104062-OSX.dmg
hdiutil attach VirtualBox-4.3.34-104062-OSX.dmg
sudo installer -pkg /Volumes/VirtualBox/VirtualBox.pkg -target /Volumes/Macintosh\ HD
rm VirtualBox-4.3.34-104062-OSX.dmg
Of you can just download the version 4.3
instructions as a shell script and then run:
chmod +x install-virtualbox-4.3.sh
./install-virtualbox-4.3.sh
rm install-virtualbox-4.3.sh
##