Create a windows immutable golden image. This will also output the image into the 'WIM' format that can be passed into other technologies such as MDT for further custimization and deployment to bare-metal machines.
Note (Required) One of the following must be installed and added to your PATH environment variable. (This is due to how packer encapsulates our boot files into an ISO in order to mount them. Documentation here)
- xorriso
- mkisofs
- hdiutil (normally found in macOS)
- oscdimg (normally found in Windows as part of the Windows ADK)
- OSFMount (Optional) Needed only if wanting to output 'wim' file with
-Capture
)
- Change into the project directory and execute
packer init .
(This will download all missing plugins) - Specify
output_directory
in vars.pkrvars.hcl - Run the build script
Build-PackerImage.ps1
Things defined in answer file:
-
Registered owner
- User
- Organization
-
Windows activation key
-
Built-in administrator account
- Username
- Password
-
Locale Settings
- Input Locale
- System Locale
- UI Language
- User Locale
-
OEM Information
-
Computername
-
TimeZone
# Build image
.\Build-PackerImage.ps1
# Build and capture image
# NOTE: OSFMOUNT required
.\Build-PackerImage -Capture
If you would like to run a specific step you can comment (#
) out the Start-Process @step<StepNumber>Args
, save and then run the powershell script.
Note
Due to how sysprep is implemented the built in 'Administrator' and 'Guest' account will always be renamed to their default 'values'. This is the reason we do not rename the built-in accounts.