Last Updated: February 25, 2016
· moutons

vagrant-cachier is boss

Right now the plugin only works with the VirtualBox provider, vagrant-lxc, and the official HashiCorp VMware providers (although there is a bug).

However, as akalyaev noted, NFS speeds the heck out of your Vagrant operations, and vagrant-cachier makes setting up NFS shares for your machines' package manager caches simpler. Simply install the plugin:

vagrant plugin install vagrant-cachier    

Then, insert the relevant configuration line into your Vagrantfile:

Vagrant.configure("2") do |config|
  config.vm.box = 'your-box'
  config.cache.auto_detect = true
  # If your Vagrantfile provisions multiple VMs, use the following line instead of auto_detect to prevent collisions:
  #config.cache.scope = :machine
  # If you are using VirtualBox, you might want to enable NFS for shared folders
  # config.cache.enable_nfs  = true

The following package managers are managed by vagrant-cachier: APT, Yum, Pacman, Chef, RubyGems, RVM, npm, Composer, and APT-CACHER.


1 Response
Add your response


Additionally, it is possible to cache omnibus chef package. Just add

if (defined? VagrantPlugins::Cachier && defined? VagrantPlugins::Omnibus)
  puts "setting custom OMNIBUS_INSTALL_URL for vagrant-cachier: #{ENV['OMNIBUS_INSTALL_URL']}"
over 1 year ago ·