A Packer template that simplifies the creation of minimally-sized, fully patched Windows Vagrant boxes.
This repo and much of its content are covered in detail from this blog post. Also see this post specifically for the Nano Server template.
You need the following to run the template:
The Windows 2016 templates use the packer-templates
Chef cookbook to provision the image. The cookbook located in cookbooks/packer-templates
has dependencies on a few community cookbooks. These cookbooks need to be downloaded. To do this:
cd
to cookbooks/packer-templates
berks vendor ../../vendor/cookbooks
This downloads all dependencies and saves them in vendor/cookbooks. From here packer will upload them to the image being built.
Invoke packer
to run a template like this:
packer build -force -only virtualbox-iso .\vbox-2016.json
The Hyper-V templates now use the official Hyper-V builder available in the latest versions of packer. I no longer convert Virtual Box images to Hyper-V.
As stated above, I no longer convert VirtualBox images to Hyper-V. However that can be useful if you are limited to mac or linux hardware for creating images. This repo includes PowerShell scripts that can create a Hyper-V Vagrant box from the output VirtualBox .vmdk file. This repo leverages psake and Chocolatey to ensure that all prerequisites are installed and then runs the above packer
command followed by the scripts needed to produce a Vagrant .box file that can create a Hyper-V file.
See this blog post for more detail on converting VirtualBox disks to Hyper-V.
Boxstarter is used by some templates for initial provisioning. Due to the fact that provisioning takes place in the builder and not a provisioner, it can be difficult to gain visibility into why things go wrong from the same console where packer
is run.
Boxstarter will log all package activity output to $env:LocalAppData\Boxstarter\boxstarter.log
on the guest.