Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Local file override for Memory/CPU limits in Vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby
if File.exists?('./Vagrantfile.override.rb')
require_relative './Vagrantfile.override.rb'
end
# Defaults for CPU and Memory
CPUS ||= 1
MEMORY ||= 1024
Vagrant.configure('2') do |config|
[:parallels, :virtualbox].each do |provider|
config.vm.provider provider do |vm, override|
vm.cpus = ::CPUS
vm.memory = ::MEMORY
end
end
[:vmware_workstation, :vmware_fusion].each do |provider|
config.vm.provider provider do |vm, override|
vm.vmx[:numvcpus] = ::CPUS
vm.vmx[:memsize] = ::MEMORY
end
end
end
MEMORY = 2048
CPUS = 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.