Skip to content

Instantly share code, notes, and snippets.

@tomysmile
Created April 26, 2016 05:54
Show Gist options
  • Save tomysmile/0618f1aa16341706940ed36b423b431c to your computer and use it in GitHub Desktop.
Save tomysmile/0618f1aa16341706940ed36b423b431c to your computer and use it in GitHub Desktop.
How to Install Virtualbox and Vagrant on MacOSX

Install Virtualbox && Vagrant for MacOSX

Vagrant uses Virtualbox to manage the virtual dependencies. You can directly download virtualbox and install or use homebrew for it.

$ brew cask install virtualbox

Now install Vagrant either from the website or use homebrew for installing it.

$ brew cask install vagrant

Vagrant-Manager helps you manage all your virtual machines in one place directly from the menubar.

$ brew cask install vagrant-manager

Usage Add the Vagrant box you want to use. We'll use Ubuntu 12.04 for the following example.

$ vagrant box add precise64 http://files.vagrantup.com/precise64.box

You can find more boxes at Vagrant Cloud

Now create a test directory and cd into the test directory. Then we'll initialize the vagrant machine.

$ vagrant init precise64

Now lets start the machine using the following command.

$ vagrant up

You can ssh into the machine now.

$ vagrant ssh

Halt the vagrant machine now.

$ vagrant halt

Other useful commands are suspend, destroy etc.

@junho85
Copy link

junho85 commented Aug 25, 2019

http://files.vagrantup.com/precise64.box is not work.

$ vagrant box add precise64 http://files.vagrantup.com/precise64.box
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'precise64' (v0) for provider:
    box: Downloading: http://files.vagrantup.com/precise64.box
    box: Download redirected to host: hashicorp-files.hashicorp.com
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

Failed to connect to hashicorp-files.hashicorp.com port 443: Operation timed out

below works. (https://www.vagrantup.com/intro/getting-started/boxes.html)

$ vagrant box add hashicorp/precise64
==> box: Loading metadata for box 'hashicorp/precise64'
    box: URL: https://vagrantcloud.com/hashicorp/precise64
This box can work with multiple providers! The providers that it
can work with are listed below. Please review the list and choose
the provider you will be working with.

1) hyperv
2) virtualbox
3) vmware_fusion

Enter your choice: 2

@JulienBreux
Copy link

$ brew install --cask virtualbox vagrant vagrant-manager

@timothybryant
Copy link

Refer to the following link if you get "“Vagrant Manager.app” can’t be opened because Apple cannot check it for malicious software."

lanayotech/vagrant-manager#187

@bratah
Copy link

bratah commented Mar 22, 2023

$ brew install --cask virtualbox vagrant vagrant-manager

Thanks! This works on my macOS 13.

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