matthodge / packertemplates Goto Github PK
View Code? Open in Web Editor NEWPacker Templates for building Windows Operating Systems
Home Page: https://hodgkins.io/best-practices-with-packer-and-windows
Packer Templates for building Windows Operating Systems
Home Page: https://hodgkins.io/best-practices-with-packer-and-windows
Right now you are not to be able to build an identical image to what was created at any point in the past. For example. If on January first Microsoft had released patch1, patch2 and patch3 and you build a Windows 2016 image, which applies those updates, and then on February first you try to rebuild that image you will end up with an image that has all of the updates that were originally applied but all of the subsequent updates as well.
It would be great to be able to easily support this so we can build repeatable images at any point in time.
I forked, and would like to contribute back:
choco install pswindowsupdate
which I've used successfully in the past.What do you think?
Also - I like the build chain of templates - is there a way to get cake to realise that it doesn't need to rebuild a dependency, but instead build incrementally? I'm unfamiliar.
When I cloned the repo and tried to get the virtualbox guest additions installed, the script (packer) said that it could not find the file E:\cert\oracle-vbox.cer.
I am using Virtual Box version 5.1.143112924.
I fixed the script to add the correct certs by their new names and will be submitting a pull request to that effect.
Thank you Matt for this is AWESOME repo/project.
I've modified your answer xml file to work with my Windows10 Pro iso, and have been able to complete the first builder phase "virtualbox-01-windows-base", but the second phase "virtualbox-02-win_updates-wmf5" fails because WUInstallAMD64.exe fails with various errors*, causing powershell to exit with 11 meaning "at least one error occurred, reboot required".
I noticed you run scripts/install_windows_updates.ps1 several times in a loop, with windows restarts each time. Any reason why you shouldn't add exit code 11 to "valid_exit_codes" in the win_updates builder, so this builder will make a best effort at applying updates? I have done this in my fork of your (wonderful!**) repo. What I have found is that any of the various windows update errors that occur are all eliminated by the 2nd or 3rd reboot/WUInstall cycle.
** I applaud your use of chaining phases to facilitate resumption of failed packer builds. :-)
I am trying to generate the Hyper-V vhdx file, however getting the below error message, Would you please check and advise.
Environment:- Windows 2016 Datacentre Server, installed with Hyper-V
Packer Version:- tried with 1.3.2-dev, & 1.2.5
ISO: Windows 2012R2
Error: ==> hyperv-iso: Provisioning with Powershell...
==> hyperv-iso: Provisioning with powershell script: scripts/install_windows_updates.ps1
==> hyperv-iso: Disconnecting from vmconnect...
==> hyperv-iso: Error shutting down VM: PowerShell error: Hyper-V\Stop-VM : Failed to stop.
==> hyperv-iso: At C:\Users\Administrator\AppData\Local\Temp\2\ps015687669.ps1:5 char:5
==> hyperv-iso: + Hyper-V\Stop-VM -VM $vm -Force -Confirm:$false
==> hyperv-iso: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
==> hyperv-iso: + CategoryInfo : NotSpecified: (:) [Stop-VM], VirtualizationException
==> hyperv-iso: + FullyQualifiedErrorId : OperationFailed,Microsoft.HyperV.PowerShell.Commands.StopVM
Is there a way I can build Windows 2016 Datacenter Core instances. I am guessing I just need to add the extra condition for Datacenter but i am not sure where you are pulling the os_name value from.
Hi, thanks for this project. I noticed there is an unverified windows update exe being used
https://www.dropbox.com/s/bk1dodl4fb7znj3/WUInstallAMD64.exe?dl=1
Is there any reason for this?
Why do you configure video memory for virtualbox? Does this speed up provisioning?
First of all, thanks for all this great work - your packer templates are the cleanest I've seen!
I get the below error when running build.ps1. I'm running Windows 10 Pro.
PS C:\Users\tblack\src\PackerTemplates> .\build.ps1
Preparing to run build script...
Running build script...
Analyzing build script...
Processing build script...
Installing addins...
Error: The assembly 'Cake.Yaml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null'
is referencing an older version of Cake.Core (0.22.0).
This assembly need to reference at least Cake.Core version 0.26.0.
Another option is to downgrade Cake to an earlier version.
It's not recommended, but you can explicitly opt-out of assembly verification
by configuring the Skip Verification setting to true
(i.e. command line parameter "--settings_skipverification=true",
environment variable "CAKE_SETTINGS_SKIPVERIFICATION=true",
read more about configuration at https://cakebuild.net/docs/fundamentals/configuration)
I tried changing the version from 22 to 26 in tools/Addins/Cake.Yaml.2.0.0/cake.yaml.nuspec, but that didn't help. (This is my first time using cake. I'm clueless)
I am able to get past the error with the suggested build.ps1 --settings_skipverification=true
, but just wanted to make a note of this on your repo. Thanks again for all this good work!
System.IO.FileNotFoundException: Could not load file or assembly 'YamlDotNet, Version=4.2.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
File name: 'YamlDotNet, Version=4.2.1.0, Culture=neutral, PublicKeyToken=null'
at Submission#0.DeserializeYamlFromFile[T] (Cake.Core.IO.FilePath filename) [0x0000c] in <cb8a275aead04fb8b7e8455004212668>:0
at Submission#0.LoadYAMLConfig (System.String yaml_path, System.String os) [0x00016] in <cb8a275aead04fb8b7e8455004212668>:0
Error: One or more errors occurred.
Your yaml is invalid.
is the https://dl.dropboxusercontent.com/u/727435/Tools/WUInstallAMD64.exe from your dropbox ?
should this be something else like nuget
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.