Skip to the content.

Loading additional ISO’s within Packer.io

Author: Joe
Date: 04/30/2015 10:04:00

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?<div>
</div><div>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:
<div>
</div>

      // For Parallels
      "prlctl": [
        ["set", "", "--device-add", "cdrom", "--image", "./iso/en_visual_studio_professional_2013_with_update_4_x86_dvd_5935322.iso"]
      ]

      // For VirtualBox
      "vboxmanage": [
        [
          "storagectl",
          "",
          "--name",
          "SataController",
          "--add",
          "sata",
          "--controller",
          "IntelAHCI"
        ],
        [
          "storageattach",
          "",
          "--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. </div>