Compartir a través de


Step 5: Create a Base Virtual Machine

Applies To: Windows Server 2008 R2

After you create the virtual networks, you can create virtual machines and connect them to the virtual network that you want them to use. The first virtual machine that you create will be a base virtual machine that you can then use to create new virtual machines. You create the new virtual machines by exporting the base virtual machine, instead of creating each new virtual machine from scratch.

The procedure in this topic explains how to create the base virtual machine in Hyper-V Manager, how to install the Enterprise edition of Windows Server 2008 R2 on the virtual machine, and how to prepare the virtual machine to be exported. When you follow the steps in this procedure, you also take virtual machine snapshots of different states of the installation and preparation process of the base virtual machine. You can test these snapshots by following the steps in Step 6 (Optional): Test Snapshots, Pausing, and Saving later in this guide.

To create the base virtual machine

  1. Create a new virtual machine as follows:

    1. In Hyper-V Manager, in the Actions pane, click New, and then click Virtual Machine. The New Virtual Machine Wizard opens.

    2. On the Before You Begin page, click Next.

    3. On the Specify Name and Location page, in the Name box, type Base Virtual Machine, and then click Next.

    4. On the Assign Memory page, in the Memory box, type 512, and then click Next.

Note

If your virtualization server has enough RAM installed, you can assign more memory to the base virtual machine. Adding more memory might improve the performance of the base virtual machine. However, you might want to assign the minimum of 512 MB of memory to the base virtual machine, so that you can run several virtual machines on your virtualization server. It is important to note that the amount of memory assigned to each virtual machine can be adjusted later, according to the number of virtual machines that you want to run at the same time.

5.  On the **Configure Networking** page, in the **Connection** list, click **External Network**, and then click **Next**.  
      
6.  On the **Connect Virtual Hard Disk** page, leave all the default settings unchanged, and then click **Next**.  
      
7.  On the **Installation Options** page, ensure that **Install an operating system later** is selected, and then click **Next**.  
      
8.  On the **Completing the New Virtual Machine Wizard** page, click **Finish**. The new virtual machine is created and listed in Hyper-V Manager under **Virtual Machines**.  
      
  1. To connect to the new virtual machine, under Virtual Machines, double-click Base Virtual Machine. The Virtual Machine Connection window opens. This window displays the current state of the virtual machine (turned off), and it displays menus and a toolbar with actions that you can perform on the virtual machine.

  2. Install the Enterprise edition of Windows Server 2008 R2 on the new virtual machine as follows:

    1. Insert the installation media for Windows Server 2008 R2 in the DVD drive of the virtualization server, and then in the Virtual Machine Connection window, in the Media menu, point to DVD Drive, and then click Capture <drive>, where <drive> is the drive letter that is assigned to the DVD drive in the virtualization server (for example, D:).

      –OR–

      If you downloaded the ISO file to create the installation media for Windows Server 2008 R2, use a removable storage device or a network connection to copy the ISO file to a folder on the virtualization server. Then in the Virtual Machine Connection window, in the Media menu, point to DVD Drive, click Insert Disk, and then browse to the location of the ISO file.

      The two methods to access media that are previously described offer the same result: the installation media for Windows Server 2008 R2 is now available to the virtual machine, as if it was inserted in a virtual DVD drive that is attached to the virtual machine. The first method gives the virtual machine access to the physical media that is available in the DVD drive of the virtualization server. The second method mounts the ISO file as a virtual DVD disc.

    2. Turn on the virtual machine. In the Action menu, click Start. (Or, you can click the blue Start button on the toolbar.) The virtual machine goes through a brief boot process, and then the installation wizard starts.

Important

If the virtual machine fails to start and you see an error message stating that the hypervisor is not running, the computer that you selected as your virtualization server might not be able to run Hyper-V, or virtualization is not properly enabled in its system BIOS. For more information, see Before You Begin: Select a Computer to Test Hyper-V earlier in this guide, or the video titled Hypervisor is not running error: How to fix (https://go.microsoft.com/fwlink/?LinkId=163578).

3.  Follow the installation wizard to install Windows Server 2008 R2 for evaluation on the virtual machine, in the same way that you installed it on the virtualization server. This is explained in [Step 2: Prepare your Virtualization Server](ee256069\(v=ws.10\).md) earlier in this guide.  
      

Note

  • If you use your mouse to click the virtual machine while you are installing and configuring Windows Server 2008 R2, your mouse cursor is bound to the virtual machine area, within the Virtual Machine Connection window. To release your mouse cursor, press CTRL+ALT+LEFT ARROW or the combination of keys that you selected when you configured Hyper-V settings. To help you, every time that you might need to release the mouse the combination of keys is displayed at the bottom of the Virtual Machine Connection window.

  • If you need to press CTRL+ALT+DELETE on the virtual machine, press CTRL+ALT+END on your keyboard, or in the Action menu of the Virtual Machine Connection window, click Ctrl-Alt-Delete. You can also click the icon on the left end of toolbar in the Virtual Machine Connection window.

    1. Complete the networking configuration if needed, and then verify that the virtual machine is connected to the Internet. Install all available updates in the same way that you installed them on the virtualization server in Step 2: Prepare your Virtualization Server earlier in this guide.

    2. After the Enterprise edition of Windows Server 2008 R2 has been installed, configured, and updated in the virtual machine, take a first snapshot of the virtual machine as follows:

      1. In the Virtual Machine Connection window, in the Action menu, click Snapshot. (Or you can click the green Snapshot button on the toolbar.) While the snapshot is being created, the Snapshot Name dialog box appears.

      2. In the Snapshot Name dialog box, type After completing installation of Windows Server 2008 R2, and then click Yes.

      3. To view the snapshot that you created, minimize the Virtual Machine Connection window, and then in Hyper-V Manager, under Snapshots, you will see the After completing installation of Windows Server 2008 R2 snapshot listed.

        Now that you have a snapshot of the base virtual machine, in the future you can restore the virtual machine to this exact state. You can test this and the other snapshots that you will take in this procedure by following the steps in Step 6 (Optional): Test Snapshots, Pausing, and Saving later in this guide.

    3. After taking the first snapshot of the virtual machine, prepare the virtual machine to be exported by using System Preparation Tool that is available in Windows Server 2008 R2 (sysprep.exe) as follows:

      1. In the Virtual Machine Connection window, open a Command Prompt window in the virtual machine. Click Start, point to All Programs, click Accessories, and then click Command Prompt.

      2. To go to the folder where sysprep.exe is stored, type the following command:

        cd C:\Windows\System32\sysprep
        
      3. To start System Preparation Tool, type the following command:

        sysprep
        

        The System Preparation Tool dialog box appears.

      4. To prepare the virtual machine to be exported, ensure that Enter System Out-of-Box Experience (OOBE) is selected, and select the Generalize check box. In the Shutdown Options list, click Shutdown, and then click OK.

        System Preparation Tool makes all the necessary changes to Windows Server 2008 R2, and then shuts down the virtual machine. The virtual machine is then ready to export. You will use this virtual machine as your base virtual machine.

    4. After the virtual machine automatically shuts down, take a final snapshot of the virtual machine as follows:

      1. In the Virtual Machine Connection window, in the Action menu, click Snapshot. While the snapshot is being created, the Snapshot Name dialog box appears.

      2. In the Snapshot Name dialog box, type After running sysprep, and then click Yes.