Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

builder: vagrant - manage virtualbox VM #8239

Closed
lmilbaum opened this issue Oct 16, 2019 · 3 comments
Closed

builder: vagrant - manage virtualbox VM #8239

lmilbaum opened this issue Oct 16, 2019 · 3 comments

Comments

@lmilbaum
Copy link

Feature Description

When vagrant builder launch a VirtualBox VM, I would like to specify how much memory and cpus to allocate the VM.

Use Case(s)

Any relevant use-cases that you see.

@SwampDragons
Copy link
Contributor

Hi, thanks for reaching out! You can already do this by using the template option to provide a vagrantfile template with the necessary fields.

Create a file that contains the following (this is the current default template):

Vagrant.configure("2") do |config|
  config.vm.define "source", autostart: false do |source|
	source.vm.box = "{{.SourceBox}}"
  end
  config.vm.define "output" do |output|
	output.vm.box = "{{.BoxName}}"
	output.vm.box_url = "file://package.box"
  end
  {{ if ne .SyncedFolder "" -}}
  		config.vm.synced_folder "{{.SyncedFolder}}", "/vagrant"
  {{- else -}}
  		config.vm.synced_folder ".", "/vagrant", disabled: true
  {{- end}}
end

and add the lines for configuring memory and CPU -- Vagrant docs for this can be found here:
https://www.vagrantup.com/docs/virtualbox/configuration.html#vboxmanage-customizations

Then save it and give the path to the new template in the "template" option linked above.

It would definitely be nice to make this directly configurable instead of needing a custom template, but since it's doable right now with this workaround, it'll be a low priority fix on my end. The best way to get nice-to-have changes like these is to open a pull request :)

@lmilbaum
Copy link
Author

lmilbaum commented Nov 2, 2019

Thanks. Will take a look at it.

@ghost
Copy link

ghost commented Jan 23, 2020

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.

@ghost ghost locked and limited conversation to collaborators Jan 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants