Server 2012: Make your magic virtual machine image/disc with Sysprep

The purpose of this post is to illustrate how to make a “base” image/virtual disc/vhdx file for use as your Hyper-V or other virtualization platform.

The reason is simple: so much time can be saved if we don’t have to actually install a new virtual machine and manually update it everytime we need a new virtual machine.

So, unless you actually have set up some sort of deployment service, the simple solution is to use the build in “SysPrep” from Server 2012.

Getting started:

  • Make sure you have set up the machine as you want it, this could include the following, but is not limited to:
    • Make sure it is fully updated!
    • Region/localization settings.
    • Enable Remote Desktop.
    • IE Enhanced Security (IE ESC) (can be relevant for lab testing)
    • Other changes you might like, which you always use.
  • Things to note:
    • Not always an advantage to install programs as you have to remember to update them to keep the image up to date. Forgetting to do this is just another security risk.
    • IPs, computername and other defining settings will be resest once Sysprep has run.
    • Shortcuts to desktop, startmenu or taskbar does not carry over.
    • Settings for Windows Update does not carry over.
    • Any settings to InternetExplorer or File Explorer will be reset.

Running Sysprep:

  1. In Server 2012 you simply navigate to “C:\Windows\System32\Sysprep” and execute the “sysprep” file.
    01
  2. Under System Cleanup Action, you want to keep it at (OOBE) and remember to put a mark into “Generalize“. This is very imporant, or you will end up with conflicting virtual machines.
    The other option under System Cleanup Action is “Enter System Audit Mode“.
    Under Shutdown Options you should choose “Shutdown“, unless you want to test your setting. Just remember you have to run Sysprep again if you Reboot.
    02
  3. Hit Ok and wait a bit.
    03
  4. The machine will now automatically Shutdown and your image is ready for use.

 Using new image:

  • On startup you are prompted for localization, which you might have specified.
  • Serial key for your OS.
  • Accept UELA
  • Administrator Password
  • Note: Sysprep removes any serial keys you might have entered, including the key to your OS, Office etc.
  • Any entered serials will have to be authenticated again as normal.
Posted in Server 2012

Leave a Reply