Вы находитесь на странице: 1из 44

Installing and Configuring Windows Server 2012 Hyper-V (Part 1)

Introduction
In Part I of this article, you learn about the different installation options available in Windows Server 2012. New options improve on the Server Core Installation and Full Installation scenarios that are also available in Windows Server 2008 R2. These new options allow you to remove the Server Graphical Shell from a Full Installation (renamed Server with a GUI in Windows Server 2012), and also a Features on Demand option to reduce the footprint of the Windows Server 2012 installation on the server.

Server Core Installation


Like Windows Server 2008 R2, the Server Core Installation option is available in Windows Server 2012. When you perform this type of installation, you elect to install Windows Server 2012 without the Server Graphical Shell. In this configuration, neither the Microsoft Management Console nor the Desktop Experience features are available. You can manage a Sever Core Installation server locally using the command line or Windows PowerShell, remotely from a server that was installed using the Server with a GUI installation, or from a workstation that is configured with the Windows 8 Remote Server Administration Tools (RSAT). The Server Core Installation option is the default option for Windows Server 2012. Because it does not load the Server Graphical Shell, it is the recommended installation method to minimize server update requirements, reduce operating system size on disk, and minimize the server attack footprint. You can still configure server roles on this type of installation. However, none of the associated GUI-based management consoles will be installed during the configuration process. As such, the Server Core Installation requires approximately 4 GB less of hard disk space than the Server with a GUI installation option. You can use the steps in the following procedure to perform a Windows Server 2012 Server Core Installation using the Windows Setup GUI: 1. Boot the physical server or virtual machine using the Windows Server 2012 media. 2. At the Windows Setup screen shown in Figure 1, select the appropriate Language, Time and Currency Format, and Keyboard or Input Method options using the pull-down menus, and then click Next.

Figure 1: Windows Server 2012 Setup Screen

3. As shown in Figure 2, select Install Now on the next screen.

Figure 2: Windows Server 2012 Installation Screen 4. The Windows Server 2012 Setup begins as shown in Figure 3.

Figure 3: Windows Server 2012 Setup screen after Install Now Selection 5. On the next Windows Setup screen (Figure 4), enter your Windows Server 2012 product key, and then click Next.

Figure 4: Windows Server 2012 Setup screen for Product Key Input 6. As shown in Figure 5, select the Server Core Installation option for your Windows Server 2012 edition (Windows Server 2012 Standard in Figure 5), and then click Next.

Figure 5: Windows Server 2012 Setup screen for Operating System Selection 7. After reading the License Terms on the next Windows Setup screen (Figure 6), click the I Accept the License Terms checkbox if you agree, and then click Next.

Figure 6: Windows Server 2012 Setup screen for License Terms 8. As shown in Figure 7, click on the Custom: Install Windows Only (Advanced) option to install a clean version of Windows Server 2012. Alternatively, you can select the Upgrade: Install Windows and Keep Files, Settings, and Applications option to update a previous Windows Server version in a supported upgrade scenario.

Figure 7: Windows Server 2012 Setup screen for Installation Type Selection 9. On the next Windows Setup screen (Figure 8), select the Drive and Partition where you want to install Windows Server 2012 operating system files, and then click Next.

Figure 8: Windows Server 2012 Setup screen for Drive and Partition Selection 10. As shown in Figure 9, the Windows Server 2012 installation begins. During installation, the system may reboot several times.

Figure 9: Windows Server 2012 Installation Snapshot 11. When the Windows Server 2012 Server Core Installation is complete, click Next to change the Administrator password (Figure 10).

Figure 10: Windows Server 2012 Administrator Password Screen 12. After you enter the new Administrator password and verify it, click OK to acknowledge the password change (Figure 11).

Figure 11: Windows Server 2012 Password Acknowledgment Screen 13. Because this is a Server Core Installation, only a command window is open after you are logged into the system (Figure 12).

Figure 12: Windows Server 2012 Server Core Installation Command Window After Windows Server 2012 is installed, you make the server useful by configuring network, firewall, domain, update, and other standard settings, as well as the roles and features for which it must provide service. With a Server Core installation, you can configure roles locally using the Windows PowerShell. You can use the steps in the following procedure to discover server roles and features, and install multiple roles and features using Windows PowerShell: 1. As shown in Figure 13, type in PowerShell in a command window.

Figure 13: Windows Server 2012 Command Windows Starting PowerShell

2. Type Get-WindowsFeature at the PowerShell Command Line (Figure 14) to view the server roles and features that are installed or available on the server.

Figure 14: Windows Server 2012 Get-WindowsFeature PowerShell Cmdlet 3. Type Install-WindowsFeature followed by the feature name (e.g., Hyper-V in Figure 15) listed in the GetWindowsFeature cmdlet output to install a role or feature.

Figure 15: Windows Server 2012 Install-WindowsFeature PowerShell Cmdlet 4. As shown in Figure 16, the installation begins and the progress updates throughout the operation.

Figure 16: Windows Server 2012 Role Installation in Windows PowerShell 5. After the installation is complete, the status of the operation is displayed as shown in Figure 17.

Figure 17: Windows Server Role Installation Status in Windows PowerShell It is possible to install multiple features at once by separating the feature names with commas. If you want to uninstall a server role or feature, you can use the Uninstall-WindowsFeature PowerShell cmdlet followed by the feature name. If you uninstall a role or feature, the installation files remain on disk to allow you to reinstall at a later time without needing original installation media.

Server with a GUI Installation


The process for the Server with a GUI installation is identical to the Server Core installation option, with the exception that you select the Server with a GUI option at the installation prompt (Figure 18).

Figure 18: Windows Server 2012 Server with a GUI Installation Selection After the Server with a GUI installation completes, you can configure the server and install roles and features using the Server Manager console shown in Figure 19, or using Windows PowerShell if you prefer to script the server configuration process.

Figure 19: Windows Server 2012 Server Manager Console Add Roles

Switching Between Server Core and Server with a GUI Installations In Windows Server 2012, you have the option to switch between a Server Core Installation and a Server with a GUI installation or vice-versa, based on changes in requirements for any particular server. Converting from a Server Core Installation to a Server with a GUI Installation The procedure to convert a Server Core to a Server with a GUI installation is simple using Windows PowerShell. However, it is a requirement that you issue the PowerShell cmdlets using elevated (Administrator) privileges. You can use the steps in the following procedure to convert a Server Core installation to a Server with a GUI installation using Windows PowerShell: 1. From a command window running with Administrator privileges, type PowerShell to invoke the Windows PowerShell environment. 2. As shown in Figure 20, type Get-WindowsImage -ImagePath <path to wim>\install.wim to determine the index number for the appropriate Server with a GUI image.

Figure 20: Windows Server 2012 Get-WindowsImage PowerShell Cmdlet 3. As shown in Figure 21, type Install-WindowsFeature Server-Gui-Mgmt-Infra,Server-Gui-Shell Restart Source wim:<path to wim>\install.wim:<Index#> at the PowerShell Command Line to install the Windows Server 2012 GUI components.

Figure 21: Windows Server 2012 Install-WindowsFeature PowerShell Cmdlet 4. If you prefer, you can use Windows Update as the source of the installation files by typing Install-WindowsFeature ServerGui-Mgmt-Infra,Server-Gui-Shell. 5. As shown in Figure 22, Windows Server 2012 restarts to complete the installation of the GUI components.

Figure 22: Windows Server 2012 Features Configuration Converting from a Server with a GUI Installation to a Server Core Installation Conversely, you can convert from a Server with a GUI installation to a Server Core installation (a restart is also required) using the Windows PowerShell cmdlet Uninstall-WindowsFeature Server-Gui-Mgmt-Infra restart, as shown in Figure 23.

Figure 23: Windows Server 2012 Uninstall-WindowsFeature PowerShell Cmdlet Minimal Server Interface Option Another Windows Server 2012 configuration option, Minimal Server Interface, allows you to remove some of the graphical components installed with a Server with a GUI installation. The components that are removed include: Internet Explorer 10 Windows Explorer Desktop Start Screen Control Panel Taskbar The Microsoft Management Console, Server Manager, and some Control Panel applets remain on the server. Converting to a Minimal Server Interface from a Server with a GUI Installation Both the Server Manager and Windows PowerShell can be used to convert a Server with a GUI installation to a Minimal Server Interface configuration. You can use the steps in the following procedure to convert a Server with a GUI installation to a Minimal Server Interface Configuration using Server Manager: 1. On the Windows Server 2012 system, open Server Manager as shown in Figure 24.

Figure 24: Windows Server 2012 Server Manager Console 2. As shown in Figure 25, click Manage and select Remove Roles and Features.

Figure 25: Server Manager Console Remove Roles and Features Selection 3. In the Remove Roles and Features Wizard (Figure 26), on the Before You Begin page, select Next.

Figure 26: Remove Roles and Features Wizard - Before You Begin Page 4. On the Select Destination Server page (Figure 27), select the server and click Next.

Figure 27: Remove Roles and Features Wizard Select Destination Server Page 5. On the Remove Server Roles page (Figure 28), click Next.

Figure 28: Remove Roles and Features Wizard Remove Server Roles Page 6. On the Remove Features page (Figure 29), scroll down to the User Interfaces and Infrastructure feature, click to expand it, unselect the Server Graphical Shell option, and then click Next.

Figure 29: Remove Roles and Features Wizard Remove Features Page 7. On the Confirmation Page (Figure 30), click Remove.

Figure 30: Remove Roles and Features Wizard Confirm Removal Selections Page 8. After the removal process completes (Figure 31), click Close and restart the server.

Figure 31: Remove Roles and Features Wizard Removal Progress Page 9. As shown in Figure 32, after the restart the Minimal Server Interface is enabled, and the Server Manager and a command window are displayed.

Figure 32: Windows Server 2012 Minimal Server Interface Configuration If you prefer, you can use the steps in the following procedure to convert a Server with a GUI installation to a Minimal Server Interface Configuration using Windows PowerShell: 1. On the Windows Server 2012 system, type Uninstall-WindowsFeature Server-Gui-Shell in a Windows PowerShell window with elevated privileges (Figure 33).

Figure 33: Windows Server 2012 Uninstall-WindowsFeature Cmdlet 2. When the removal process completes, restart the server using the Restart-Computer PowerShell cmdlet.

With a Minimal Server Interface configuration, you can continue to use the Server Manager to manage the server or use Windows PowerShell. It is also possible to achieve a Minimal Server Interface configuration by adding the Graphical Management Tools and Infrastructure feature to a Server Core installation. You can use the steps in the following procedure to convert a Server Core installation to a Minimal Server Interface Configuration using Windows PowerShell: 1. On the Windows Server 2012 system, type Install-WindowsFeature Server-Gui-Mgmt-Infra in a Windows PowerShell window with elevated privileges (Figure 34).

Figure 34: Windows Server 2012 Install-WindowsFeature Cmdlet 2. When the installation process completes, restart the server using the Restart-Computer PowerShell cmdlet. In this configuration, you can benefit from a Windows Server 2012 installation with a minimized attack surface, and smaller operating system footprint on disk while still being able to perform management tasks using the GUI management tools like Server Manager. Features on Demand Option On a Server Core installation, the installation files for graphical features are not copied to the local disk in order to minimize the operating system footprint. In Windows Server 2012, it is also possible to remove the binary files for other roles and features. If you want to install a role or feature whose files were removed from the Windows Server 2012 installation, you have to specify access to an installation source (e.g., WIM image) and the index number of the image to ensure that the component files are installed from the same version of Windows. Another option is to use Windows Update as the installation file source. For example, to uninstall the Graphical Server Shell files from a Windows Server 2012 installation, you can use the following Windows PowerShell cmdlet:

Uninstall-WindowsFeature Server-Gui-Shell Remove In order to install the Graphical Server Shell files using the Windows Update site as the installation source, you can use the following Windows PowerShell cmdlet: Install-WindowsFeature Server-Gui-Shell If you want to use a local installation source, you have to use the Source option followed by the path to the installation folders and the index of the Windows Server 2012 image. Conclusion In this article, you learned about the Server Core and Server with a GUI installation options that allow you to individually configure servers based on whether or not you have a requirement to use the graphical user interface components to manage a particular server. In Windows Server 2012, it is also possible to switch between these installation options as server requirements change, and to further configure the installation using either the Minimal Server Interface or Features on Demand options. In Part II of the article, you will learn the details about the configuration of the Hyper-V role in Windows Server 2012.

http://www.virtualizationadmin.com/articles-tutorials/microsoft-hyper-v-articles/installation-and-deployment/installingconfiguring-windows-server-2012-hyper-v-part1.html

Installing Hyper-V on a Server Core Installation


A Server Core installation entails the configuration of Windows Server 2012 without the Server Graphical Shell. In terms of system administration and configuration, this means that you either manage a server from the local console or remotely using a command line interface or Windows PowerShell, or you administer a server from a remote workstation using Microsoft Management Console based tools. Here are the basic steps to install the Hyper-V role on a Server Core Installation of Windows Server 2012 using Windows PowerShell: 1. At the Server Core installation console, a command line window opens after login (Figure 1).

Figure 1: Windows Server 2012 Server Core Installation Command Line 2. As shown in Figure 2, type PowerShell in the command window to access the Windows PowerShell interface.

Figure 2: Windows Server 2012 Command Windows Starting PowerShell

3. Type Get-WindowsFeature at the PowerShell Command Line (Figure 3) to view the server roles and features that are installed or available on the server.

Figure 3: Windows Server 2012 Get-WindowsFeature PowerShell Cmdlet 4. Type Install-WindowsFeature Name Hyper-V Restart to install the Hyper-V role and automatically restart the server after the installation of the role. (Figure 4).

Figure 4: Windows Server 2012 Install-WindowsFeature PowerShell Cmdlet 5. After the server restarts, start PowerShell from the command window, and type Get-WindowsFeature | where {$_.Installed eq $True} to verify the successful installation of the Hyper-V role (Figure 5).

Figure 5: Windows Server 2012 Hyper-V Role Verification in Windows PowerShell The command output is formatted to display only a list of the roles and features that are installed on the server, rather than the entire list of roles and features available. Using Windows PowerShell, roles and features can be installed individually as shown in this example, or you can install multiple roles and features using a single cmdlet. For example, you can install the Hyper-V and Web Server roles using the following syntax: Install-WindowsFeature Name Hyper-V, Web-Server Restart.

Installing Hyper-V on a Server with a GUI Installation


In order to install the Hyper-V role on a Server with a GUI installation, you can also use Windows PowerShell, or you can use the Server Manager if you prefer a graphical user interface: 1. On the server desktop, open Server Manager (Figure 6).

Figure 6: Windows Server 2012 Server Manager Console 2. In Server Manager, in the menu, click Manage, and then click Add Roles and Features (Figure 7).

Figure 7: Server Manager Console Add Roles and Features Selection 3. In the Add Roles and Features Wizard (Figure 8), on the Before You Begin page, select Next.

Figure 8: Add Roles and Features Wizard - Before You Begin Page 4. On the Select Installation Type page (Figure 9), select Role-based or feature-based installation, and click Next.

Figure 9: Add Roles and Features Wizard Select Installation Type Page 5. On the Select Destination Server page (Figure 10), select the server, and click Next.

Figure 10: Add Roles and Features Wizard Select Destination Server Page 6. On the Select Server Roles page (Figure 11), select Hyper-V, and then click Add Features in the dialog box.

Figure 11: Add Roles and Features Wizard Add Features Dialog 7. On the Select Server Roles page (Figure 12), click Next.

Figure 12: Add Roles and Features Wizard Select Server Roles Page 8. On the Select Features page (Figure 13), click Next.

Figure 13: Add Roles and Features Wizard Select Features Page 9. On the Hyper-V Page (Figure 14), click Next.

Figure 14: Add Roles and Features Wizard Hyper-V Page 10. On the Create Virtual Switches page (Figure 15), select a network adapter, and then click Next.

Figure 15: Add Roles and Features Wizard Create Virtual Switches Page 11. On the Virtual Machine Migration page (Figure 16), click Next.

Figure 16: Add Roles and Features Wizard Virtual Machine Migration Page 12. On the Default Stores page (Figure 17), click Next.

Figure 17: Add Roles and Features Wizard Default Stores Page 13. On the Confirmation page (Figure 18), check Restart the destination server automatically if required, and then click Yes in the restart dialog box.

Figure 18: Add Roles and Features Wizard Restart Dialog Box 14. On the Confirmation page (Figure 19), click Install.

Figure 19: Add Roles and Features Wizard Confirmation Page 15. On the Installation Progress page (Figure 20), you can monitor the Hyper-V role installation until the server automatically restarts.

Figure 20: Add Roles and Features Wizard Installation Progress Page 16. After the server restarts and opens the Server Manager, check the Installation Progress page (Figure 21) to ensure that the Hyper-V role installlation was successful, and then click Close.

Figure 21: Add Roles and Features Wizard Installation Progress Page Configuring Hyper-V Host Settings on a Server Core Installation After installing the Hyper-V role on a server, you can perform configuration of Hyper-V host settings. Basic settings include the following items: Configuration of the storage locations for virtual hard disk and virtual machine configuration files Configuration of physical GPUs for use with RemoteFX (if the Remote Desktop Virtualization Host role is installed) Configuration of NUMA spanning when the server has NUMA nodes to enhance virtual machine performance Configuration of Live Migration and the authentication protocol to use, the number of simultaneous live migrations to allow (default is 2), and the server networks to support live migration events Configuration of Storage Migration and configuring the number of simultaneous storage migrations to allow (default is 2) Configuration of Replication to support the server Replica functionality and the authentication protocol to use, as well as the servers authorized to replicate The following cmdlets provide examples of how to configure some of these basic Hyper-V host settings using Windows PowerShell: 1. Modify the Virtual Hard Disk storage location to use a folder named Virtual Machines on drive D (just as an example, of course, as you customize drive and folder locations to suit your requirements): Set-VMHost VirtualHardDiskPath D:\Virtual Machines 2. Modify the Virtual Machine files storage location to be the same as the Virtual Hard Disks path: Set-VMHost VirtualMachinePath D:\Virtual Machines 3. Modify NUMA Spanning to be enabled: Set-VMHost NumaSpanningEnabled $True 4. Modify the number of concurrent Live Migrations to 4 events: Set-VMHost MaximumVirtualMachineMigrations 4 5. Modify the number of concurrent Storage Migrations to 4 events: Set-VMHost MaximumStorageMigrations 4

In addition to basic Hyper-V host settings, you can also use Windows PowerShell to verify host network adapter settings, and configure Virtual Switch settings. The following cmdlets provide examples of how to list network adapter information and IP addresses on a Hyper-V host, as well as how to configure a Virtual Switch: 1. List the physical network adapters present in the Hyper-V host using Format-Table (ft in the cmdlet below) to list by name (Figure 22): Get-NetAdapter | ft Name

Figure 22: Format-Table Output for Get-NetAdapter | ft Name Cmdlet 2. List the settings of a network adapter using the Network Adapter name (Figure 23): Get-NetAdapter -Name NIC1 | Get-NetIPAddress

Figure 23: Output of Get-NetIPAddress cmdlet for Network Adapter NIC1 3. Create a new external Virtual Switch using the network adapter named NIC1, name the virtual switch Public, and allow the parent partition to have access to the network adapter bound to the virtual switch (Figure 24): New-VMSwitch -Name "Public" -NetAdapterName NIC1 -AllowManagementOS $True

Figure 24: Output of New-VMSwitch Cmdlet For a complete list of Windows PowerShell cmdlets that are available to script and automate Hyper-V related tasks, you can refer to the Microsoft Technet Hyper-V Cmdlet site here. Configuring Hyper-V Host Settings on a Server with a GUI Installation If Windows PowerShell cmdlets dont appeal to you, or you have access to a Server with a GUI installation, you can configure Hyper-V host settings using the Hyper-V Manage: 1. On the server desktop, open the Server Manager (Figure 25).

Figure 25: Windows Server 2012 Server Manager Console

2. In Server Manager, in the navigation pane, click Hyper-V, then right-click the server, and then select Hyper-V Manager from the list (Figure 26).

Figure 26: Server Manager Console Hyper-V Manager Selection 3. In Hyper-V Manager, in the Actions pane, click Hyper-V Settings (Figure 27).

Figure 27: Hyper-V Manager Console 4. On the Hyper-V Settings page, select Virtual Hard Disks to specify the default drive and folder to store virtual hard disk files, and then click Apply (Figure 28).

Figure 28: Hyper-V Manager Virtual Hard Disks Page 5. On the Hyper-V Settings page, select Virtual Machines to specify the default folder to store virtual machine configuration files, and then click Apply (Figure 29).

Figure 29: Hyper-V Manager Virtual Machines Page 6. On the Hyper-V Settings page, select NUMA Spanning to enable the setting, and then click Apply (Figure 30).

Figure 30: Hyper-V Manager NUMA Spanning Page 7. On the Hyper-V Settings page, select Live Migrations to set the number of simultaneous live migrations that are allowed, and then click Apply (Figure 31). Note that this setting requires the server to be a member of an Active Directory domain.

Figure 31: Hyper-V Manager Live Migrations Page 8. On the Hyper-V Settings page, select Storage Migrations to set the number of simultaneous storage migrations that are allowed, and then click Apply (Figure 32).

Figure 32: Hyper-V Manager Storage Migrations Page You can use the Virtual Switch Manager to create and manage virtual switches in Hyper-V: 1. In Hyper-V Manager, in the Actions pane, click Virtual Switch Manager (Figure 33).

Figure 33: Virtual Switch Manager Console 2. Create a new external Virtual Switch, name the virtual switch Public, allow the parent partition to have access to the network adapter bound to the virtual switch, and then click Apply (Figure 34).

Figure 34: Virtual Switch Manager New Virtual Switch Creation Conclusion In this article, you learned some basics about the Windows PowerShell and graphical console options available to install the Hyper-V role and configure Hyper-V host settings in Windows Server 2012. These tools can be used to configure a single server or multiple servers that require identical configurations. In addition, you can use these tools in combination to manage any type of Windows Server 2012 installation either locally or when necessary remotely as would be the case for a Server Core installation to be managed using Server Manager and Hyper-V Manager.

Вам также может понравиться