Tiny answer file for VM templates
ok so when we create a template of Windows Server 2016 VM, after sysprepping of course, the OOBE run is annoying and time consuming…yeah yeah, it is only a couple of minutes but if you can avoid that, why not?
A tiny answer file specified during sysprep helps a lot. Of course, the recommended way to create that answer file is that you gotta install Windows SIM first. It takes time and has a learning curve to it.
I did that. Here are a couple of nice write-ups which I followed:
https://theitbros.com/sysprep-a-windows-7-machine-start-to-finish/
and
https://www.windowscentral.com/how-create-unattended-media-do-automated-installation-windows-10
However, I must add that those are written from the perspective of automating an fresh installation of Windows, not a simple VM cloning process. That does not need all the settings these guys talk about. So At the end of this post I am sharing a tiny answer file which will help you automate. It has the bare minimum stuff you need to automate a Windows Server 2016 VM cloning process.
Here is what it does:
- Skip showing OOBE screens
- Specify your company name, etc
- Set locale and time zone to EST
- Enable RDP
I use it by specifying it at sysprep time, like this:
c:\Windows\System32\Sysprep\./sysprep.exe /oobe /generalize /shutdown /mode:vm /unattend:c:\AdminTools\AutoUnattendServer2016Std.xml
Enjoy!
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="specialize">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<RegisteredOrganization>Your company name</RegisteredOrganization>
<RegisteredOwner>Designated person</RegisteredOwner>
<TimeZone>Eastern Standard Time</TimeZone>
</component>
<component name="Microsoft-Windows-TerminalServices-LocalSessionManager" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<fDenyTSConnections>false</fDenyTSConnections>
</component>
<component name="Networking-MPSSVC-Svc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<FirewallGroups>
<FirewallGroup wcm:action="add" wcm:keyValue="RemoteDesktop">
<Active>true</Active>
<Group>Remote Desktop</Group>
<Profile>all</Profile>
</FirewallGroup>
</FirewallGroups>
</component>
</settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<InputLocale>en-US</InputLocale>
<SystemLocale>en-US</SystemLocale>
<UILanguage>en-US</UILanguage>
<UserLocale>en-US</UserLocale>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<OOBE>
<VMModeOptimizations>
<SkipAdministratorProfileRemoval>true</SkipAdministratorProfileRemoval>
<SkipNotifyUILanguageChange>true</SkipNotifyUILanguageChange>
</VMModeOptimizations>
<HideEULAPage>true</HideEULAPage>
<HideLocalAccountScreen>true</HideLocalAccountScreen>
<HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
<HideOnlineAccountScreens>true</HideOnlineAccountScreens>
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
<ProtectYourPC>1</ProtectYourPC>
</OOBE>
</component>
</settings>
<cpi:offlineImage cpi:source="" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>