Feb 01 2017

Nutanix AHV and Windows Server Guest Customisation

A while back i wrote a blog post about Nutanix AHV and Linux VM Guest Customization and based on that one i have had a few requests about how to do the same for Windows based VMs so that is the topic for this blog post.

For Windows based systems, if deploying VMs from base/template VMs and not performing clean installations via deployment tools you can use Microsoft sysprep to do VM customization. Sysprep is installed by default in the Windows installation directory (often c:\Windows) -> System32 -> Sysprep meaning C:\Windows\System32\Sysprep.

In my case i’ll use an AHV VM called base-win2012r2 as the template and it is running Windows Server 2012 R2.

Loggin in to that VM we can see it’s configured with Swedish regional settings including e.g. keyboard, time and time zone.

For any new VM i wanted to change and perform the following actions:

  • Hide ELUA Page
  • Local administrator password
  • Input Locale
  • System Locale
  • UI Language
  • User Locale
  • Computer Name
  • Registered Organization
  • Registered Owner
  • Time Zone
  • Product Key
  • Join a domain

Prepare The Base / Template VM

The following steps were taken to prepare the base/template VM before the clone process.

  • Log on to the Windows Server 2012 R2 VM
  • Open command prompt (cmd)
  • Navigate to the sysprep directory “c:\WIndows\System32\Sysprep
  • Run the sysprep command of your choice. Based on my customization requirements i ran the following command and hit enter:
    • sysprep /generalize /shutdown / oobe
    • Let sysprep do it’s magic and then the VM will be shutdown

Create VM From Base/Template VM

When the base/template VM is ready i took the following action to clone a new VM from the base/template VM

  • Highlight the VM you want to clone, in may case base-win2012r2, and click Clone
  • Provide the necessary information including the below and click Save:
    • Number of Clones – In my case just 1
    • Name – In my case vm-win2012r2-01
    • CPU configuration – I made no changes
    • RAM configuration – I made no changes
    • Click the Custom Script check box and select the source of your XML sysprep file. The options you have includes:
      • ADFS Path
      • Upload a file accessible from the client where you run PRISM
      • Type or paste the script – This is what i did
    • PowerOn the newly created VM

Verify the new VM

When the VM is created and the sysprep magic is finished you should verify the changes to the VM via:

    • Log on with the local administrator account to verify the new password
    • Verify the new VM name and that it is joined to the domain
  • Log on with a domain account see that the VM has joined the domain on the first screen.
  • Check Date, Time and Time Zone
  • Region Settings
  • All other potential changes you included in the sysprep file

Unattended Sysprep File

Below is the unattended sysprep file i used apart from the passwords and product key.





Skip to comment form

  1. Dave W

    Is there a way to make it use whatever you named the machine in Acropolis as the new computer name in the unattended sysprep?

  2. magander3

    yes you can name the AHV VM to XYZ and then set XYZ in the ComputerName config element instead of vm-win2012r2-01.


  3. Jeremy D

    Which config element in the sys prep file? Thanks in advance

  4. magander3

    Check the above which I just changed. The special chars was not allowed in the comments unfortunately.



Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">