Building a development environment with Vagrant, Packer, Windows 10 and Server 2016
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
answer_files
archive
extras
scripts
templates
.gitignore
README.md
example_build_parallels_server_2016.sh
example_build_parallels_server_2019.sh
example_build_parallels_w10_box.sh
example_build_vbox_server_2016.sh
example_build_vbox_servercore_2016.sh
example_build_vbox_w10.sh

README.md

Templates for Packer (Virtualbox, Parallels and Hyper-V support)

Introduction

This repository contains Windows templates that can be used to create boxes for Vagrant using Packer. It is inspired by https://github.com/mwrock/packer-templates and by https://github.com/MattHodge/PackerTemplates. I was a bit stuck until I read https://hodgkins.io/best-practices-with-packer-and-windows. My previous approach of stuffing all box creating effort in 1 file was very cumbersome. Turns out you can use a modular approach with Packer by creating multiple artifacts and chain them together.

New! Hyper-V support in packer

Now you can create Hyper-V boxes on Windows with Hyper-V enabled. Unfortunately the modular approach does not work with Hyper-V.

How to

Prerequisites

The Windows boxes are created with Packer version 0.12.2 and are using WinRM (no SSH). Vagrant, Packer and Virtualbox or Parallels.

Linux: Install them with your package provider.

MacOS:

brew cask install vagrant
vagrant plugin install vagrant-parallels

Windows VirtualBox: You can install the prerequisites with packagemanagement:

Install-Package -ProviderName Chocolatey -ForceBootstrap -Force vagrant,virtualbox,packer

Windows Hyper-V (New!): You can install the prerequisites with packagemanagement. And you need to install Hyper-V:

Install-Package -ProviderName Chocolatey -ForceBootstrap -Force vagrant,packer
Enable-WindowsOptionalFeature -Online -FeatureName:Microsoft-Hyper-V -All

Clone and run

Clone the repository:

git clone https://github.com/jacqinthebox/packer-templates.git; cd packer-templates

Save the Packer executable in this folder.

How to create a Parallels Windows 2016 box:

./example_build_parallels_windows_2016.sh

How to create a Windows 2016 box for VirtualBox.

./example_build_vbox_windows_2016.sh

How to create a Hyper-V box on Windows

.\packer.exe build --force .\templates\hyperv_windows_server_2016_1_base.json

Adding the box to Vagrant

vagrant box add --name windows_server_2016 windows2016_parallels.box