Code Monkey home page Code Monkey logo

vagrant-templates's Introduction

Vagrant Templates

The point of this repository is to hold Vagrantfile templates that I personally use as starting points for self-contained development/testing environments.

These are not minimal templates. They include configuration tweaks, workarounds for common issues that I bumped into, and provisioning scripts that install a few extra packages and customize the shell environment a bit. Check the appropriate Vagrantfile and the vagrant/provision.sh script, they should be fairly easy to modify. Some usage examples:

  • Use them as is to spin up readily usable VMs where you can log into and test random stuff.
  • Add the necessary steps to provision your application inside the VM, maybe removing some redundant things.
  • Just use them as a reference to write your own minimal environments with tweaked settings.

Dependencies

You'll need VirtualBox and Vagrant. Most templates require the vagrant-vbguest plugin installed (to share folders with the host) and som also require the vagrant-reload plugin (to allow the VM to be immediately rebooted after provisioning).

Notes

Local Customization

The default VM size is defined in the Vagrantfile but, sometimes, it's useful to locally override these settings without affecting other users of the same repo. Do this by creating a .vagrant_size.json next to the Vagrantfile with the following (example) contents:

{
    "cpus": 2,
    "memory": 4096
}

Guest Additions

By default, the vagrant-vbguest plugin tries to install/update the VirtualBox Guest Additions on every vagrant up. I find this annoying and recommend you to disable this behavior by adding something like the following to your ~/.vagrant.d/Vagrantfile:

Vagrant.configure(2) do |config|
    ...

    if Vagrant.has_plugin?("vagrant-vbguest")
        config.vbguest.auto_update = false
    end

    ...
end

The templates that need to install/update the VirtualBox Guest Additions already (re)enable auto_update explicitly.

Clock Drift

On my older Macbook Pro the (VM) clocks drift quite significantly with paravirtualization enabled, and I never quite figured out how to fix it. If you notice this happening, just add the following to your ~/.vagrant.d/Vagrantfile:

Vagrant.configure(2) do |config|
    ...

    config.vm.provider "virtualbox" do |v, override|
        v.customize ["modifyvm", :id, "--paravirtprovider", "legacy"]
    end

    ...
end

vagrant-templates's People

Contributors

carlosefr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.