How to: Installing the Hyper-V role in Windows Server 2012 R2
Jul 17, 2014

I am making the following assumptions as we start this tutorial:


You have installed Windows Server 2012/2012R2, applied the most recent patches, connected to storage, renamed your network adapters to enable easy identification (and teamed them, if required), and configured IP addresses.


The next step is to enable the Hyper-V role. This task can be performed graphically, through Server Manager, using the same process that you use to add any other role or feature. Or you can use Windows PowerShell:


NOTE:  In Windows PowerShell, unlike in the Add Roles and Features Wizard, management tools and snap-ins for a role are not included by default. To include management tools as part of a role installation, add the -IncludeManagementTools parameter to the cmdlet. If you are installing roles and features on a server that is running the Server Core installation option of Windows Server 2012, and you add a role’s management tools to an installation, you are prompted to change the installation option to a minimal-shell option that allows the management tools to run. Otherwise, management tools and snap-ins cannot be installed on servers that are running the Server Core installation option of Windows Server.

Do one of the following to open a Windows PowerShell session with elevated user rights.

◦ On the Windows desktop, right-click Windows PowerShell on the taskbar, and then click Run as Administrator.

◦ On the Windows Start page, type any part of the name Windows PowerShell. Right-click the shortcut for Windows PowerShell when it is displayed on the Start page in the Apps results, click Advanced, and then click Run as Administrator. To pin the Windows PowerShell shortcut to the Start page, right-click the shortcut, and then click Pin to Start.


Type the following, and then press Enter, where computer_name represents a remote computer on which you want to install Hyper-V.

To install Hyper-V directly from a console session, do not include -ComputerName <computer_name> in the command.


Install-WindowsFeature –Name Hyper-V -ComputerName <computer_name> -IncludeManagementTools -Restart


The benefit of using the Server Manager GUI is that it also prompts you to create a virtual switch on a selected network adapter in the server. The virtual network adapters that you configure on your VMs connect to this switch to access the external network. By default, a virtual network adapter is also created on the host OS so that the OS can use that adapter for VM traffic. If you have a dedicated management network adapter, disable the shared adapter after you complete the installation process.


The following are the basic steps for using Server Manager:

1. Log on, as an account with administrative credentials, to the server that will be the Hyper-V host and launch Server Manager. Or remotely launch Server Manager with an account that has administrative credentials on the server that will be the Hyper-V host.

2. Select Add Roles and Features from the Manage menu.

3. Click Next on the Before You Begin page.

4. On the Installation Type page, choose the Role-based installation type and click Next.

5. On the Server Selection page, from the list of servers in the server pool, choose the server on which to install the Hyper-V role and click Next.

6. Under Server Roles, select Hyper-V and accept the option to automatically install the management tools.

7. On the Create Virtual Switches page, select the network adapter that you want to use for VM traffic and click Next.

8. Leave the check box for the option to enable live migrations cleared and click Next. Live migration can easily be added later.

9. Choose new locations for VM storage, or accept the defaults, and click Next.

10. Select the check box to enable automatic restart of the server if required, and click Yes in the displayed confirmation box. Click the Install button.


Congratulations !!!! You have successfully installed the Hyper-V Role. Once the Windows Server restarts, log back in. Once you have logged in, Server Manager will start. Form within Server Manager, under Tools, choose Hyper-V Manager and navigate to your server. Note that there are no VMs. However, if you click the Virtual Switch Manager action, you’ll see a single virtual switch that has the name of the network adapter controller; for example, Realtek PCIe GBE Family Controller.

You should consider renaming the virtual switch to something more descriptive, such as External Switch, to represent the network to which it connects. Using consistent naming for switches across your Hyper-V hosts is important: If you move VMs between hosts, a switch of the same name must exist on both the target and source hosts if the VM is to maintain its network connectivity. Also, clear the check box for the Allow management operating system to share this network adapter option. That option is needed only if you do not have a separate network adapter for management of the host or if you have only one network adapter that is shared for VM and host traffic. You can also use this interface to create additional switches, as required.

You are now ready to start creating VMs on your standalone host.


To create a virtual machine:

1. Open Hyper-V Manager.

2. From the navigation pane of Hyper-V Manager, select the computer running Hyper-V.

3. From the Actions pane, click New and then click Virtual Machine.

4. The New Virtual Machine wizard opens. Click Next.

5. On the Specify Name and Location page, type an appropriate name.

6. On the Assign Memory page, specify enough memory to start the guest operating system.

7. On the Configure Networking page, connect the virtual machine to the switch you created when you installed Hyper-V.

8. On the Connect Virtual Hard Disk and Installation Options pages, choose the option that is appropriate for how you plan to install the guest operating system:

◦ If you will install the guest operating system from a DVD or an image file (an .ISO file), choose Create a virtual hard disk. Click Next, and then click the option that describes the type of media you will use. For example, to use an .iso file, click Install an operating system from a boot CD/DVD and then specify the path to the .iso file.

◦ If the guest operating system is already installed in a virtual hard disk, choose Use an existing virtual hard disk and click Next. Then, choose Install an operating system later.

9. On the Summary page, verify your selections and then click Finish.


Windows PowerShell equivalent commands 

The following Windows PowerShell cmdlet or cmdlets perform the same function as the preceding procedure. Enter each cmdlet on a single line, even though they may appear word-wrapped across several lines here because of formatting constraints.

Run the following command to create a virtual machine named web server with 1 GB of startup memory and use an existing virtual hard disk in which a guest operating system has already been installed.

New-VM –Name “web server” –MemoryStartupBytes 1GB –VHDPath d:\vhd\BaseImage.vhdx

To install the guest operating system into the VM:

1. From Hyper-V Manager, in the Virtual Machines section of the results pane, right-click the name of the virtual machine and click Connect.

2. The Virtual Machine Connection tool opens.

3. From the Action menu in the Virtual Machine Connection window, click Start.

4. The virtual machine starts, searches the startup devices, and loads the installation package.

5. Proceed through the installation.



No comment found.

Leave a new comment


Please enter a keyword.

Recent Posts


Copyright © 2020 New Horizons Worldwid, Inc. All rights reserved.