Creating a Server 2012 Golden Image with Sysprep and VMWare Workstation: Part 2 of 2

Part: 2 of 2

Ready…Set…Syspr-WAIT!

In my last post, I walked through how I got my “Golden Image” ready for Sysprep by updating through Windows Updates, and also went through and customized the system to my preferences, including adding BGInfo and getting my icons in place.

Now before we begin, there’s one last thing we want to do before we Sysprep this system…


“I just spent a good amount of time customizing my environment, and if I Sysprep the system…won’t it wipe out the profile settings?”

By default, yes it would. But we can add a couple items to an XML file and make sure all those settings stay with the image after being Sysprepped…

CopyProfile Setting

So according to TechNet, there is a setting called CopyProfile that can be overridden from it’s default (false) by using a special XML tag in the unattend file.
Note:
If you want these settings to be copied to default the easiest way is to be logged on as THE “Administrator” account. Once logged in, make your customizations, then proceed.

Hrmmm…lets use this simple “Autoattend.xml” file below as our test.  You can add many other options, but we’re doing only a little bit since we wanna keep the code short and get to the point:

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<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>
		<UILanguageFallback>en-US</UILanguageFallback>
		<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>
			<HideEULAPage>true</HideEULAPage>
			<NetworkLocation>Work</NetworkLocation>
			<ProtectYourPC>1</ProtectYourPC>
		</OOBE>
		<TimeZone>Pacific Standard Time</TimeZone>
	</component>
</settings>
<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">
		<ProductKey>XXXXX-XXXXX-XXXXX-XXXXX-XXXXX</ProductKey>
		<CopyProfile>true</CopyProfile>
	</component>
</settings>
</unattend>

Placing the Autounattend.xml file

Take the code above (and of course put in your own key and other settings as you would wish) and place it in the same directory as the sysprep executable: C:\Windows\System32\Sysprep (shown below):

Running Sysprep

Once I had my unattend.xml file in place, I opened up an administrative command prompt via the Server 2012 shortcut key Win+X. This opens up little “Power User” menu that you can easily access some common tools for the everyday Systems Administrator (shown below):

server2012_winX

Then I ran the fateful command, held my breath, and prayed:

commandForSysprep

DID IT WORK!??!?!?

So now the test. I just flat straight up copied that sumbitch to another location on a different drive.

Now I wanna be able to keep track of these VMs as I clone them, so I’m gonna edit the settings of my freshly copied clone in VMWare Workstation to “DEVSQL12” (shown below):

Next, when I powered it up, I was asked if this was moved or copied, and I selected “I copied it” (shown below):

This is a good sign, it’s asking me for a new admin password…

VOILA! My new server ready to roll and freshly updated and customized!!!

All Done!!

Now you can copy this Golden Template off into new folders, fire it up, and you have a new, updated server ready for config!!! That’s it! This was just a quick tutorial. Hopefully it helps set the stage for you to get familiar with Windows Server 2012, while at the same time guides you in finding your way around quickly to set up some of the features and custom settings you want with minimal headache.

Till next time!!

Advertisements

8 comments on “Creating a Server 2012 Golden Image with Sysprep and VMWare Workstation: Part 2 of 2

  1. Magroll says:

    Hi have you ever tried to do the Sysprep via VMWare VCenter? I tried to import the unattend.xml to a vSphere Windows Guest Cusomization. But than the Sysprep Specification don’t work as excepted. 😦

    • Yea I will dig around in a bit and see if I can find reference links, but from what I remember you should stick to the sysprep files that are available through vcenter. The tricks I’ve found that were usually skipped when an ESX template deployment fails to “fully” provision itself are:
      1) Make sure your key is right, be it KMS or VL or whatnot

      2) Make sure your server is iin a clean shutdown state before sysprepping. (Google it, there’s a reg key and (I think) one other thing to check)
      3) Make sure you are changing the network on the NIC (if different from the vSwitch/VLAN your template was created on) and then edit the network settings during a customized deployment to reflect the actual network/IP the new server should reside on.

      This of course allows the post sysprepped machine to connect to the domain and the kms server (or internet) to join the domain, activate, etc.

      That’s just from my experience though, and as mentioned in the beginning, I’ve found sysprepping following the KBs on vmware’s site.

      Ps: sorry for not including links I’m posting this from my phone

  2. […] tenemos un VHD con una instalación de Windows personalizada y generalizada, que podemos usar como Imagen Maestra para crear nuevas máquinas […]

  3. As an addition to your posts: You could also shut the VM down after sysprepping it and set the VM to cloning mode withing VMWare Workstation through Settings –> Options tab –> Advanced –> Check Ënable Template Mode”. This way you can quickly generate linked clones / full clones for a quick lab setup 🙂

  4. […] Creating a Server 2012 Golden Image with Sysprep and VMWare Workstation: Part 2 of 2 […]

  5. Flemdawg says:

    I like how you said copy that sumbitch. haha. Thanks for the guide was a good refresher.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s