Giter Club home page Giter Club logo

packer-templates's Introduction

packer-templates

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.

Prerequisites

You need the following to run the template:

  1. Packer installed with a minimum version of 0.12.3.
  2. VirtualBox - Tested with 5.1.12
  3. Berkshelf - Used to find and vendor Chef cookbook dependencies. This is easist installing via the ChefDK

Vendoring the cookbooks

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:

  1. cd to cookbooks/packer-templates
  2. Run 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.

Invoking the template

Invoke packer to run a template like this:

packer build -force -only virtualbox-iso .\vbox-2016.json

Hyper-V templates

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.

Converting 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.

Troubleshooting Boxstarter package run

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.

packer-templates's People

Contributors

mwrock avatar urisimchoni avatar mariowood avatar dragon788 avatar tpetchel avatar troyready avatar fujiiface avatar genebean avatar jalessio avatar matthodge avatar petemounce avatar rickhlx avatar scullinan avatar davidsummers avatar jbruett avatar richardwadsworth avatar

Watchers

James Cloos avatar Jason Gaudard avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.