Windows 10 + winrm example template for VMware & OpenStack

684 views
Skip to first unread message

Blake Garner

unread,
Jul 30, 2016, 7:28:02 PM7/30/16
to Packer
I have posted a sanitized version of the packer templates for Windows 10 that we use at Adobe. These are created specifically for VMware ESXi and OpenStack/KVM private cloud usage. I wanted to share some code and approaches that are fairly different from the other windows template builds out there. 


Cheers,
Blake

@trodemaster

Steve Bailey

unread,
Dec 14, 2017, 4:07:19 PM12/14/17
to Packer
OK.  I'm having an issue retrofitting this to work with win2012R2.  It gets stuck on waiting for winrm to be available.  I've confirmed that bootstrap-win.ps1 is running.  I've narrowed it down to the fact the host cannot communicate with the guest.  I ping the guest IP from the host and get nothing.  I go in to the guest manually and install VMware tools and then I can communicate with the guest from the host.  So the only thing I can conclude is that the networking isn't configured correctly as part of the autounattend.xml ... I'm attaching my autounattend.xml file for review and comment. 

Steve
Autounattend.xml

Jordan Borean

unread,
Dec 14, 2017, 10:54:28 PM12/14/17
to Packer
Hey Steve

A few issues with your answer file

* You set the order for the single command to 2, it should start at 1
* When executing a PS script, you either need to set the execution policy to Unrestricted or bypass it when calling the script (-ExecutionPolicy ByPass)
* I don't know whether the script needs input from the user but I would remove it just to be safe

In the end I would change it to;

<FirstLogonCommands>
   
<SynchronousCommand wcm:action="add">
       
<CommandLine>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy ByPass -File a:\bootstrap-win.ps1</CommandLine>
       
<Description>Bootstrap Windows</Description>
       
<Order>1</Order>
   
</SynchronousCommand>
</FirstLogonCommands>

As for why you can't ping it, by default Windows Firewall blocks ICMP so it won't reply to a ping. VMWare tools might put in a Firewall rule to allow it but I'm not sure.

Thanks

Jordan

Steve Bailey

unread,
Dec 20, 2017, 10:26:34 AM12/20/17
to Packer
OK... Making progress but now hit a snag I cannot overcome.

In the windows-update-winrm.ps1 script, there is a call to Get-PackageProvider for NuGet.  We are behind a proxy and I cannot find a way to get this cmdlet to use a proxy.  I've tried every trick I can think of but this just won't acknowledge the http_proxy system variables, the IE settings or anything else.

Anyone have ideas on how to get this to work behind a proxy?


On Saturday, July 30, 2016 at 7:28:02 PM UTC-4, Blake Garner wrote:

Blake Garner

unread,
Dec 20, 2017, 7:43:09 PM12/20/17
to Packer
You might want to just skip NuGet and install the windows update power shell module from a zip file. It’s also possible to install NuGet from a file downloaded from its website as well. Patching the windows images is always the most painful part. I use a offline zip file to patch older versions of windows like 2012r2. Check out wsuoffline.net for the best option I have found. Ok be honest patching older windows is super problematic and painful.

Blake

engel der

unread,
Jan 14, 2020, 8:27:17 AM1/14/20
to Packer
Thank you very much for sharing. I was wondering why there is no update since 4 years?

Blake Garner

unread,
Jan 14, 2020, 6:43:51 PM1/14/20
to packe...@googlegroups.com
I have posted a newer repo with some updates here. https://github.com/trodemaster/packer-windows-10-insider It's a bit of effort to sanaitize our internal packer templates for public consumption. Note that this one does not include the qemu builder but no reason it wouldn't work. 

Blake


--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to a topic in the Google Groups "Packer" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/packer-tool/6evwAHomcaA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/c1d031cb-38d7-4aba-8bcc-c2f11a2f3b9c%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages