Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save loftywaif002/fdabfffd3541f3e171222b43f5539045 to your computer and use it in GitHub Desktop.
Save loftywaif002/fdabfffd3541f3e171222b43f5539045 to your computer and use it in GitHub Desktop.

Revisions

  1. loftywaif002 created this gist Jun 6, 2020.
    44 changes: 44 additions & 0 deletions install vagrant and vistualbox in macOS
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,44 @@
    # 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.

    ```sh
    $ brew cask install virtualbox
    ```

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

    ```sh
    $ brew cask install vagrant
    ```

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

    ```sh
    $ 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.