Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vagrant complaints about "customize"

Tags:

vagrant

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
like image 300
Rubendob Avatar asked Apr 16 '14 08:04

Rubendob


2 Answers

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.

like image 142
Rubendob Avatar answered Sep 28 '22 01:09

Rubendob


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.

like image 40
musabaloyi Avatar answered Sep 28 '22 02:09

musabaloyi