Tip of the Day: Sysprep’s new /mode:vm switch

Today’s tip…


Windows 8 and Windows Server 2012 Sysprep.exe supports a new command line switch called /mode:vm. 


This switch is useful if you are installing Windows 8 or Windows Server 2012 in virtual environment like Hyper-V and you are going to deploy the image back to the same virtualization environment.  For example let’s say you have a Hyper-V server and you want to be able to deploy new VM’S quickly.  Here are the steps you would go through


  1. Install Windows 8
  2. Configure it the way you want
  3. Optional:  Create
         c:\windows\system32\sysprep\unattend.xml to automate OOBE
  4. Run
         %windir%\system32\sysprep\sysprep.exe /oobe /generalize /shutdown /mode:vm
  5. Back up the .VHD for the VM to location
  6. Create a new VM and attach copy of the .VHD


Note:  This switch is only supported for virtual machines.  You can’t mix and match Hyper-V VMs and VMWare VMs.  Also, you cannot deploy this image to physical machine. 


Additional Information:  http://technet.microsoft.com/en-us/library/hh825033.aspx

Comments (5)

  1. Scott: You can run this on other Hypervisors but the sysprepped image should not be interchanged between hypervisors.

  2. Scott Chamberlain says:

    Does /mode:vm work with other hypervisors other than Hyper-V? For example if I am syprepping a image currently running on VMWare ESXi and I plan I deploying the new images based off of that image to the same ESXi server, can I use the /mode:vm switch or should I omit it and have it do a full detection?

  3. Robert says:

    Robert, does the "Create Template from VM" functionality in SCVMM 2012/SP1/R2 make use of the mode:vm switch?

  4. Bjorn Houben says:

    I don't get the advantage of using /mode:vm . To me it seems like omitting it provides more flexibility. Can you please elaborate on use cases?

  5. Anonymous says:

    Bjorn.  Since we have identified the source as being a VM, we don't have to do nearly as much hardware detection as we would have with physical (and therefore more diverse) hardware.  Since it is a VM, we only have to detect the enumerated and synthetic devices that are possible in a VM.

Skip to main content