2.2.0
Windows Server 2012 R2 [Version 6.3.9600] (German)
Vagrant.configure("2") do |config|
#config.vm.box = "debian/stretch64" # does not support provider hyperv
config.vm.box = "generic/debian9"
config.vm.provider "hyperv" do |h|
h.memory = 4096
# h.maxmemory = 4096
end
end
https://gist.github.com/vchrizz/8730697b9d4323c5ed4d16a2b2e3e704
Vagrant machine should start with the defined memory set.
vagrant up fails with an error about maxmemory setting:
An error occurred while executing a PowerShell script. This error
is shown below. Please read the error message and see if this is
a configuration error with your system. If it is not, then please
report a bug.
Script: configure_vm.ps1
Error:
Failed to configure memory: Maximum memory value is less than required minimum memory value.
Vagrantfile and set memory more than 2048maxmemory (setting this to same amount as memory 'fixes' the issue.vagrant upHi there,
This is occurring because the generic/debian9 box sets the maxmemory option to 2048. Below is the snippet from the Vagrantfile:
# Adding a second CPU and increasing the RAM to 2048MB will speed
# things up considerably should you decide to do anythinc with this box.
config.vm.provider :hyperv do |v, override|
v.maxmemory = 2048
v.memory = 2048
v.cpus = 2
end
If you want to the VM to have the memory statically allocated to it, you can just set the maxmemory option to nil. If you'd rather allow Hyper-V to dynamically allocate memory to the guest, you can not modify memory and instead just update the maxmemory option to 4096.
Cheers!
Thanks! Didnt notice that.
For Vagrant beginners, where can i find this Vagrantfile from generic/debian9 to know where to debug?
It'll be with the unpacked box, and the path will be dependent on the VAGRANT_HOME setting and the box version. The path will look something like this with default settings:
C:\Users\USERNAME\.vagrant.d\boxes\generic-VAGRANTSLASH-debian9\BOX_VERSION\hyperv\Vagrantfile
Where USERNAME is your username on the host and VERSION is the version of the box you have installed.
I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Most helpful comment
Hi there,
This is occurring because the
generic/debian9box sets themaxmemoryoption to2048. Below is the snippet from the Vagrantfile:If you want to the VM to have the memory statically allocated to it, you can just set the
maxmemoryoption tonil. If you'd rather allow Hyper-V to dynamically allocate memory to the guest, you can not modifymemoryand instead just update themaxmemoryoption to4096.Cheers!