This repository contains Windows templates that can be used to create boxes for Vagrant using Packer ([Website](https://www.packer.io)) ([Github](https://github.com/mitchellh/packer)).
This repository contains Windows templates that can be used to create boxes for
Vagrant using Packer ([Website](https://www.packer.io))
([Github](https://github.com/mitchellh/packer)).
This repo is a modified fork of the popular [joefitzgerald/packer-windows](https://github.com/joefitzgerald/packer-windows) repo.
The following Windows versions are known to work (built with VMware Fusion Pro 8.1.1):
The following Windows versions are known to work (built with VMware Fusion Pro
10.0.1):
* Windows 10
* Windows Server 2016
* Windows Server 2016 with Hyper-V and Docker -> see [docker-windows-box](https://github.com/StefanScherer/docker-windows-box) for an use case
* Windows 10
* Windows 10 1709
* Windows 10 Insider
* Windows Server
* Windows Server 2016 without and with Docker
* Windows Server 1709 without and with Docker
* Windows Server Insider without and with Docker
You may find other packer template files, but older versions of Windows doesn't work so nice with a Retina display.
You may find other packer template files, but older versions of Windows doesn't
work so nice with a Retina display.
### Windows Editions
All Windows Server versions are defaulted to the Server Standard edition. You can modify this by editing the Autounattend.xml file, changing the `ImageInstall`>`OSImage`>`InstallFrom`>`MetaData`>`Value` element (e.g. to Windows Server 2012 R2 SERVERDATACENTER).
All Windows Server versions are defaulted to the Server Standard edition. You
can modify this by editing the Autounattend.xml file, changing the
`ImageInstall`>`OSImage`>`InstallFrom`>`MetaData`>`Value` element (e.g. to
Windows Server 2012 R2 SERVERDATACENTER).
### Product Keys
The `Autounattend.xml` files are configured to work correctly with trial ISOs (which will be downloaded and cached for you the first time you perform a `packer build`). If you would like to use retail or volume license ISOs, you need to update the `UserData`>`ProductKey` element as follows:
The `Autounattend.xml` files are configured to work correctly with trial ISOs
(which will be downloaded and cached for you the first time you perform a
`packer build`). If you would like to use retail or volume license ISOs, you
need to update the `UserData`>`ProductKey` element as follows:
* Uncomment the `<Key>...</Key>` element
* Insert your product key into the `Key` element
If you are going to configure your VM as a KMS client, you can use the product keys at http://technet.microsoft.com/en-us/library/jj612867.aspx. These are the default values used in the `Key` element.
If you are going to configure your VM as a KMS client, you can use the product
keys at http://technet.microsoft.com/en-us/library/jj612867.aspx. These are the
default values used in the `Key` element.
### Using existing ISOs
If you have already downloaded the ISOs or would like to override them, set these additional variables:
- iso_url - path to existing ISO
- iso_checksum - md5sum of existing ISO (if different)
If you have already downloaded the ISOs or would like to override them, set
these additional variables:
* iso_url - path to existing ISO
* iso_checksum - md5sum of existing ISO (if different)
The scripts in this repo will install all Windows updates – by default – during Windows Setup. This is a _very_ time consuming process, depending on the age of the OS and the quantity of updates released since the last service pack. You might want to do yourself a favor during development and disable this functionality, by commenting out the `WITH WINDOWS UPDATES` section and uncommenting the `WITHOUT WINDOWS UPDATES` section in `Autounattend.xml`:
The scripts in this repo will install all Windows updates – by default – during
Windows Setup. This is a _very_ time consuming process, depending on the age of
the OS and the quantity of updates released since the last service pack. You
might want to do yourself a favor during development and disable this
functionality, by commenting out the `WITH WINDOWS UPDATES` section and
uncommenting the `WITHOUT WINDOWS UPDATES` section in `Autounattend.xml`:
```xml
<!-- WITHOUT WINDOWS UPDATES -->
...
...
@@ -92,35 +120,41 @@ Doing so will give you hours back in your day, which is a good thing.
These boxes use WinRM. There is no OpenSSH installed.
### Hyper-V Support
If you are running Windows 10, then you can also use these packerfiles to build a Hyper-V virtual machine. I have the ISO already downloaded to save time, and only have Hyper-V installed on my laptop, so I run:
If you are running Windows 10, then you can also use these packerfiles to build
a Hyper-V virtual machine. I have the ISO already downloaded to save time, and
only have Hyper-V installed on my laptop, so I run: