I'm having a weird problem with Vagrant. Changing the default RAM of the virtual machine would have to be easy but I don't know why I am not able to do it.
My code is very simple:
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define "mimeticStack" do |v|
v.vm.box = "precise64"
v.vm.box_url = "http://files.vagrantup.com/precise64.box"
v.vm.network "private_network", ip: "192.168.33.10"
v.vm.network "forwarded_port", guest: 80, host: 8080
v.vm.hostname = "dev.mimetic.local"
v.vm.customize ["modifyvm", :id, "--memory", "512"]
end
end
Then if I run "vagrant up", Vagrant returns:
vm:
* The following settings shouldn't exist: customize
The issue was fixed:
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define "mimeticStack" do |v|
v.vm.box = "precise64"
v.vm.box_url = "http://files.vagrantup.com/precise64.box"
v.vm.network "private_network", ip: "192.168.33.10"
v.vm.network "forwarded_port", guest: 80, host: 8080
v.vm.hostname = "dev.mimetic.local"
v.vm.provider :virtualbox do |vb|
vb.customize ['modifyvm', :id,'--memory', '512']
end
end
end
I left the code here for Vagrant beginners like me.
I have tried @MikeD's suggestion with
config.vm.provider "virtualbox" do |vb|
vb.memory = "<some size>"
vb.cpus = "<some number>"
end
and it works as expected. I can ssh into my vagrant box and run lscpu
and cat /proc/meminfo
which give me the values I specified above.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With