Windows Server 2016 unattended installation plus VMware Tools

Create with PowerShell a ISO for a Windows server 2016 unattended installation including VMware Tools and PVSCI drivers.

Introduction

This post is the first one of “deploy a VMware lab automatically” serie.

The first goal was to skip the manuel steps associated to:
Create the first VM
Install Windows
Install VMware tools
Create template
Deploy from template

And replace them by:
Create with PowerShell an ISO for Windows server 2016 unattended installation including VMware tools.
Use PowerCLI to configure the VM.
Use PowerCLI to configure the OS with invoke-vmscript via the VMware tools.

Note: The script could also be used for others version of Windows.

Prerequisites

1) Workstation with Windows 10
SSD strongly recommended for a fast execution
Enough disk space

2) Windows ADK installed in the default installation path. (Deployment Tools only)
windows-assessment-deployment-kit
Use the one associated to your Windows 10 build

#Find your build
(Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name ReleaseId).ReleaseId

3) Download Windows ISO.
Example with windows server 2016 evaluation:
evaluate-windows-server-2016
14393.0.161119-1705.RS1_REFRESH_SERVER_EVAL_X64FRE_EN-US.ISO

4) Identify the URL of the VMware tools ISO matching the version to be installed in Windows.
Index of all VMware tools
For example the URL for 6.5 now is:
https://packages.vmware.com/tools/esx/6.5/windows/VMware-tools-windows-10.1.0-4449150.iso

5) Create “autounattend.xml” for this Windows server version.
The autounattend.xml must be configured to launch the installation of VMware tools.
See details in the next section

Create the autounattend.xml

The “autounattend.xml” is mandatory to automatically install Windows.
In this context it doesn’t need to be complex.
As long as VMware tools are installed, everything else could be configured with PowerCLI and PowerShell instead.

Lazy option:
Download one below:
2012R2
2016
Password: TheCr@zyConsu1tant
I have unticked “Hide Sensitive Data” in Windows System Image Manager>Tools.
So, the password is in clear text in the XML file and can be modified.

Build it yourself:
This post provides the majority of settings needed: Windows Server 2012 Unattended Installation
Few minor modifications:
For windows 2012R2 only
Image name: Windows Server 2012 R2 SERVERSTANDARD
Partition 1 size: 350 (Default size with 2012 R2)
For windows 2016 only
Image name: Windows Server 2016 SERVERSTANDARD
Partition 1 size: 500 (Default size with 2016)
And for both:
The most important setting, add in the “RunSynchronous” command in the specialize pass.
amd64_Microsoft-Windows-Deployment_neutral
Order: 1
Path: D:\CustomFolder\setup64.exe /s /v”/qn REBOOT=R”

Script to create custom ISO

New-IsoWindowsUnattendedPlusVMwareTools.ps1

Reference to others blog post

This script is based on the work of many others bloggers.
Inject VMware Drivers into Windows Server 2012 ISO Image
Windows Server 2012 Unattended Installation
Update an ISO using PowerShell
Silent Install of VMware Tools From The Command Line
Manual Download of VMware Tools from VMware Website

Leave a Reply

Your email address will not be published. Required fields are marked *