Add shortcut for setting the memory size for VirtualBox VM
This commit is contained in:
parent
eb6256316c
commit
3368ef610a
|
@ -76,6 +76,14 @@ module VagrantPlugins
|
|||
@network_adapters[slot] = [type, args]
|
||||
end
|
||||
|
||||
# Shortcut for setting memory size for the virtual machine.
|
||||
# Calls #customize internally.
|
||||
#
|
||||
# @param size [Integer, String] the memory size in MB
|
||||
def memory=(size)
|
||||
customize "pre-boot", ["modifyvm", :id, "--memory", size]
|
||||
end
|
||||
|
||||
# This is the hook that is called to finalize the object before it
|
||||
# is put into use.
|
||||
def finalize!
|
||||
|
|
|
@ -61,3 +61,12 @@ more than 50% would be used on your own host machine. Some details:
|
|||
|
||||
* Multiple `customize` directives can be used. They will be executed in the
|
||||
order given.
|
||||
|
||||
There is also a shortcut for specifying the memory size (MB) for the virtual
|
||||
machine:
|
||||
|
||||
```ruby
|
||||
config.vm.provider "virtualbox" do |v|
|
||||
v.memory = 1024
|
||||
end
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue