How to Create a Template from a Virtual Hard Disk

Applies To: Virtual Machine Manager 2008, Virtual Machine Manager 2008 R2, Virtual Machine Manager 2008 R2 SP1

You can create a new virtual machine template from a generalized virtual hard disk stored in the Library.

Procedure

To create a virtual machine template from an existing virtual hard disk:

  1. Prepare the source virtual hard disk, which has the operating system installed, by removing computer identity information. With Windows operating systems, for example, you can prepare the virtual hard disk with the Sysprep tool.

  2. Add the source virtual hard disk file to the Library. For more information, see the How to Add Files to the Library.

  3. In Library view, in the Actions pane, click New Template.

  4. Complete the New Template Wizard.

Wizard Page Action

Select Source

  1. Click Use an existing template or virtual hard disk stored in the library and then click Browse.

  2. In the Select Virtual Machine Source dialog box, select the virtual hard disk that you want to use as the source, and then click OK.

Template Identity

Enter a template name and description, and specify the owner of the template. The template owner must have an Active Directory domain account. All VMM administrators and delegated administrators who have access to the library server with the template will be able to use the template. Templates are assigned to the scope of a user role and all self-service users in that self-service user role may use the assigned templates.

Note

By default, virtual machines created from the template are owned by the user who created them. Templates are assigned to self-service policies through the user role properties, which does not require the owner to be the same as the user.

Configure Hardware

Customize the hardware settings, as needed.

  • Startup Order—Specify the BIOS boot order by specifying the startup order of devices when starting the operating system.

  • CPU Requirements—Specify the processor requirements of a virtual machine on a host.

  • Memory—Specify the amount of memory to allocate on a host for a virtual machine, and whether to use Dynamic Memory.

    Note

    Support for Dynamic Memory was introduced in Virtual Machine Manager (VMM) 2008 R2 with Service Pack 1 (SP1).

  • Floppy Drive—Configure the virtual floppy drive to read a physical floppy disk on the host or to read a virtual floppy disk file stored in the library.

  • Video Adapter—Configure the virtual video adapter for a virtual machine.

    Note

    Support for video adapter settings was introduced in VMM 2008 R2 with SP1.

  • DVD or CD Drive—Add a virtual DVD or CD drive to an IDE bus.

  • Virtual Hard Disk—Add a virtual hard disk to an IDE device or a SCSI adapter.

  • Network Adapters—Configure one or more virtual network adapters for a virtual machine.

  • Priority and Availability—Configure how CPU and memory resources are allocated and whether virtual machines are highly available.

    Note

    Support for memory resource priority was introduced in VMM 2008 R2 with SP1.

Guest Operating System

Configure identity information, administrative credentials, and user access to computers based on the template.

  • General Settings: Enter the following settings:

    • Identity Information--Specify a computer name. To randomly generate a computer name for virtual machines based on the template, enter an asterisk in the Computer name field.

    • Admin Password: Specify the local Administrator password for the virtual machine. If virtual machines created with this template will not be in a domain, users must use this password to gain access to the local computer.

      Note

      To prompt for a password when the user creates a virtual machine with the template, enter an asterisk (*) in the Admin Password field. If you leave the field blank, virtual machine creation will fail.

    • Product key: If you want the template to provide a product key for virtual machines, enter a product key in the Product key field. To require users to provide their own product key when they create a virtual machine, leave the field blank.

      To provide the product key through a Sysprep answer file, use the Answer File setting under Scripts to specify a Sysprep answer file that contains the appropriate product key. Then select the Product key provided by answer file check box under Product key. When a virtual machine is created from the template, the product key will be imported from the Sysprep answer file.

      Important

      If you will provide a product key for the virtual machines created with the template, to enhance security during virtual machine creation, it is recommended that you provide the product key through an answer file instead of adding the product key directly to the template configuration.

    • Time Zone: Select the appropriate option from the Time Zone drop-down list box, or accept the default time zone.

    • Operating System: Select the operating system that will run on the virtual machine. This selection does not install an operating system.

  • Networking: Configure settings to determine network access for virtual machines:

    • Domain/Workgroup: If you want virtual machines that are created from this template to be in a domain, click Domain. Then specify a user account that will be used to add the computer to the domain at first logon. If the virtual machines that are created from this template will not be in a domain, click Workgroup, and then enter the name of the workgroup.

  • Scripts: Use the options under Scripts to provide additional settings for Sysprep:

    • Answer File: You can attach a Sysprep file (for Windows XP, Windows Server 2000, or Windows Server 2003) or an Unattend.xml file (for Windows Vista or Windows Server 2008) to the guest operating system profile. The answer file script must be stored on a library share.

      To select an answer file, click Browse to open the Select answer file dialog box, and then select the file.

      To add settings, in the Answer file field, specify the SysPrep or Unattend file to run. The settings in the answer file will be appended to those from the wizard.

    • [GUIRunOnce] Commands: If you want to specify one or more commands to run the first time a user logs on to a virtual machine, type a command that you want to add in the Command to add field, and then click Add. This action adds the command to the [GuiRunOnce] section of the SysPrep file and to the unattend.xml file.

Summary

Review your settings. To change the settings, click Previous. To create the template, click Create.

See Also

Concepts

Working with Virtual Machine Templates