From 11ea6f68eed657716f6dae2cc5d42bda78d46d01 Mon Sep 17 00:00:00 2001 From: djpbessems Date: Wed, 23 Jun 2021 09:30:15 +0200 Subject: [PATCH] Specify pvscsi drivers --- .../Server2019/pvscsi/Autounattend.xml | 167 ++++++++++++++++++ packer/windowsserver2019.pkr.hcl | 2 +- 2 files changed, 168 insertions(+), 1 deletion(-) create mode 100644 packer/preseed/Server2019/pvscsi/Autounattend.xml diff --git a/packer/preseed/Server2019/pvscsi/Autounattend.xml b/packer/preseed/Server2019/pvscsi/Autounattend.xml new file mode 100644 index 0000000..1521498 --- /dev/null +++ b/packer/preseed/Server2019/pvscsi/Autounattend.xml @@ -0,0 +1,167 @@ + + + + + + + + + + 1 + Primary + true + + + + + false + NTFS + C + 1 + 1 + + + + 0 + true + + OnError + + + true + + + <> + Never + + + + + + 0 + 1 + + OnError + false + + + /IMAGE/INDEX + 4 + + + + + + + + en-US + + en-US + en-US + en-US + en-US + en-US + + + + + false + + + + + E:\Program Files\VMware\VMware Tools\Drivers\pvscsi\Win8\amd64 + + + + + + + + en-US + en-US + en-US + en-US + + + + + <> + true</PlainText> + </AdministratorPassword> + </UserAccounts> + <OOBE> + <HideEULAPage>true</HideEULAPage> + <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> + <NetworkLocation>Home</NetworkLocation> + <ProtectYourPC>1</ProtectYourPC> + </OOBE> + <AutoLogon> + <Password> + <Value><<img-password>></Value> + <PlainText>true</PlainText> + </Password> + <Username>administrator</Username> + <Enabled>true</Enabled> + </AutoLogon> + <FirstLogonCommands> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> + <Description>Set execution policy 64bit</Description> + <Order>1</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> + <Description>Set execution policy 32bit</Description> + <Order>2</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c reg add "HKLM\System\CurrentControlSet\Control\Network\NewNetworkWindowOff"</CommandLine> + <Description>Disable new network prompt</Description> + <Order>3</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\Set-NetworkProfile.ps1</CommandLine> + <Description>Set network profile to private</Description> + <Order>4</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\Disable-WinRM.ps1</CommandLine> + <Description>Disable WinRM</Description> + <Order>5</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c a:\Install-VMwareTools.cmd</CommandLine> + <Order>13</Order> + <Description>Install VMware Tools</Description> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\Enable-WinRM.ps1</CommandLine> + <Description>Enable WinRM</Description> + <Order>99</Order> + </SynchronousCommand> + </FirstLogonCommands> + <ShowWindowsLive>false</ShowWindowsLive> + </component> + </settings> + <settings pass="specialize"> + <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <OEMInformation> + <HelpCustomized>false</HelpCustomized> + </OEMInformation> + <!-- Rename computer here. --> + <ComputerName>packer-template</ComputerName> + <TimeZone>W. Europe Standard Time</TimeZone> + <RegisteredOwner/> + </component> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <SkipAutoActivation>true</SkipAutoActivation> + </component> + </settings> +</unattend> diff --git a/packer/windowsserver2019.pkr.hcl b/packer/windowsserver2019.pkr.hcl index a14e455..9dc42b1 100644 --- a/packer/windowsserver2019.pkr.hcl +++ b/packer/windowsserver2019.pkr.hcl @@ -104,7 +104,7 @@ source "vsphere-iso" "srv2019-virtual" { usb_controller = ["xhci"] floppy_files = [ - "packer/preseed/Server2019/Autounattend.xml", + "packer/preseed/Server2019/pvscsi/Autounattend.xml", "packer/preseed/Server2019/Sysprep_Unattend.xml", "scripts/Set-NetworkProfile.ps1", "scripts/Disable-WinRM.ps1",