Using racker, this repo can generate dynamic packer templates for building Windows VMs.
- packer
- ruby with bundler (tested with 2.4.0)
- Virtualbox or QEMU/KVM
- Install racker by running
bundle install
- Using the provided
unattend-template.xml
file, use sed or another method to replace the following strings and make a file calledAutounattend.xml
:111USERNAME
- local user created to run packer scripts111PASSWORD
- password for local user111ADMINPASS
- password for built-in admin account111PRODUCTKEY
- product key for version of Windows being installed111IMAGENAME
- name of the version of Windows you want to install from the ISO .111TIMEZONE
- your timezone.
- Use racker to generate your packer template. The syntax is
racker template_1.rb template_2.rb output.json
- Build your packer images!
VM_NAME
- VM nameWINRM_USER
- username for packer WinRMWINRM_PASS
- password for WinRM userNUM_CPU
- number of CPUs for VMMB_RAM
- MB of RAM for VMUNATTEND_FILE
- path toAutounattend.xml
file created in previous steps.
PACKER_TEMPLATE_ROOT
- prefix for drivers/scripts foldersCLOUDBASE_CONFIG_ROOT
- prefix for cloudbase_config folderGUEST_FILES_ROOT
- prefix for guest_os_files folder
- Packer: https://packer.io
- Racker: https://github.com/aspring/racker
- Windows Unattend files: https://technet.microsoft.com/en-us/library/cc722132(v=ws.10).aspx