malboxes icon indicating copy to clipboard operation
malboxes copied to clipboard

Change cpu, memory and other from the config file with vboxmanage options in the packer templates

Open Svieg opened this issue 9 years ago • 3 comments

A quick look-up told me that we could add vboxmanage options in the profiles so the user could easily modify those options in config.js

Svieg avatar Dec 19 '16 21:12 Svieg

That would only require to template the builder_virtualbox_windows.json snippet as I can tell

Svieg avatar Dec 20 '16 23:12 Svieg

Yes, we could iterate on a dict adding modifyvm lines in this list:

                "vboxmanage": [
                        ["modifyvm", "{{ '{{.Name}}' }}", "--memory", "4096"],
                        ["modifyvm", "{{ '{{.Name}}' }}", "--cpus", "1"]
                ],

Something like:

                "vboxmanage": [
                        ["modifyvm", "{{ '{{.Name}}' }}", "--memory", "4096"],
                        ["modifyvm", "{{ '{{.Name}}' }}", "--cpus", "1"],
                        {% for key, value in my_dict.iteritems() %}
                        ["modifyvm", "{{ '{{.Name}}' }}", "--{{ key }}", "{{ value }}"],
                        {% endfor %}
                ],

But we need to be careful with the dangling comma. Maybe put CPU last and without a terminating comma.

Anyway, I would :+1: such a change.

obilodeau avatar Dec 27 '16 17:12 obilodeau

Cool, I'll check that.

Svieg avatar Dec 27 '16 23:12 Svieg