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

3 thoughts on “Windows Server 2016 unattended installation plus VMware Tools

  1. Mick Short

    I can’t get the autounattend.xml to install vmware tools. Keep getting a invalid command line argument error code 1639. I simplified the install command down to D:\VMwareTools\setup64.exe /S /v. The VMwareTools folder is located on the bootable ISO i created. Any ideas?

    3
    D:\VMwareTools\setup64.exe /S /v
    VMware Tools

    I can successfully run the command on the server once its built. Also tried
    cmd /c D:\VMwareTools\setup64.exe /S /v “/qn /l*v “”c:\windows\temp\vmmsi.log”” REBOOT=R ADDLOCAL=ALL REMOVE=Hgfs”

    Next option is to follow this method https://social.technet.microsoft.com/wiki/contents/articles/33457.windows-installing-vmware-tools-during-install-by-modifying-windows-iso.aspx

    Reply
  2. Nico

    I keep getting this exception:
    WARNING: DISM has skipped driver signature check because the version of running OS and that of target OS do not match.
    Add-WindowsDriver : Driver file or path not found
    At C:\Users\nbm\Documents\unattendedinstallation.ps1:115 char:2
    + Add-WindowsDriver -path ‘C:\CustomizedWindowsIso\Temp\MountDISM’ …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Add-WindowsDriver], FileNotFoundException
    + FullyQualifiedErrorId : Add-WindowsDriver,Microsoft.Dism.Commands.AddWindowsDriverCommand

    Reply

Leave a Reply

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