malboxes icon indicating copy to clipboard operation
malboxes copied to clipboard

Idea: Add the profile to the box name.

Open pix opened this issue 8 years ago • 4 comments

When using the custom profiles, it would be great that the generated box included the used profile. E.g.:

$ malboxes build win10_32 --profile analyst
$ malboxes build win10_32 --profile test

with either:

$ malboxes spin win10_32_analyst Test.Spin.Analyst
$ malboxes spin win10_32_test Test.Spin.Analyst

or

$ malboxes spin win10_32 --profile analyst Test.Spin.Analyst
$ malboxes spin win10_32 --profile test Test.Spin.Analyst

I already toyed with --profile switch, but this would require some additionnals changes. What do you think ?

pix avatar Sep 07 '17 13:09 pix

I like the idea and I'd prefer the first one personally!

Svieg avatar Sep 07 '17 14:09 Svieg

I think a command-line switch to specify the profile is nice. This would decouple a template which is more or less an OS / arch and the stuff you want to do with it.

However, what would a profile change when it's specified at spin time?

Maybe we should do the template thing using packer and the profile thing using Vagrant provisioning. This way we have few base boxes (less disk waste) and more flexibility.

obilodeau avatar Sep 07 '17 16:09 obilodeau

Maybe we should do the template thing using packer and the profile thing using Vagrant provisioning. This way we have few base boxes (less disk waste) and more flexibility.

Yeah, I don't know Vagrant that enough to do it.

I tested a simple approach:

// In config.js
{ "profile": "test1" }
$ malboxes build win10_64_analyst
# Results: a win10_64_analyst_test1 box is built
$ malboxes build win10_64_analyst --profile test2
# Results: a win10_64_analyst_test2 box is built

$ malboxes spin win10_64_analyst Foo
# Uses `win10_64_analyst_test1` as the base box since `"test1"` is the default profile

$ malboxes spin win10_64_analyst Foo --profile test2
# Uses `win10_64_analyst_test2` as the base box

pix avatar Sep 08 '17 12:09 pix

You can take a look at https://github.com/pix/malboxes/tree/profiles (not tested, build in progress). I'll submit a proper pull request once stabilized.

pix avatar Sep 08 '17 14:09 pix