So, while building some dev VM's, I needed to be able to install Visual Studio into some Vagrant base images using Packer. No one had a method to dynamically add an ISO during the provisioning process, so I thought, why not add another virtual DVD drive during the VM creation process?
This example demonstrates how to add an additional CD drive in both Parallels and VirtualBox. Since I don't use VMWare or HyperV, I don't have an example to provide, but I imagine the process would be similar:
// For Parallels
"prlctl": [
["set", "{{.Name}}", "--device-add", "cdrom", "--image", "./iso/en_visual_studio_professional_2013_with_update_4_x86_dvd_5935322.iso"]
]
// For VirtualBox
"vboxmanage": [
[
"storagectl",
"{{.Name}}",
"--name",
"SataController",
"--add",
"sata",
"--controller",
"IntelAHCI"
],
[
"storageattach",
"{{.Name}}",
"--storagectl",
"SataController",
"--port",
"0",
"--device",
"0",
"--type",
"dvddrive",
"--medium",
"./iso/en_visual_studio_professional_2013_with_update_4_x86_dvd_5935322.iso"
]
]
You would then be able to start the installation via a standard provisioning script.