In this chapter, we will discuss Microsoft Hyper-V along with its various modules.
Microsoft Hyper-V, known as Windows Server Virtualization, is a native (bare) hypervisor. It can create virtual machines on x86-64 systems running Windows OS, starting with Windows 8. Hyper-V supersedes Windows Virtual PC as the hardware virtualization component of the client editions of Windows NT. A server computer running Hyper-V can be configured to expose individual virtual machines to one or more networks.
Hyper-V was first released alongside Windows Server 2008 and Windows 7 and has been available without charge for all the Windows Server versions and some client operating systems since that time.
Let us see how to install a Hyper-V role in a Windows Server 2012 by following the steps given below.
Step 1 − To Install Hyper-V role go to “Server Manager” → Manage → Add Roles and Features.
Step 2 − Click on “Next”.
Step 3 − Select “Role-based or feature-based installation” option → click on “Next”.
Step 4 − We will locally install the Hyper-V role as such “Select a server from the server pool” → click “Next”.
Step 5 − From the Roles lists, check the “Hyper-V” Server role → click on Add Features on the popup window → click “Next”.
Step 6 − Click “Next”.
Step 7 − Choose your server’s physical network adapters that will take part in the virtualization and responsible for network switching → click on “Next”.
Step 8 − Under Migration, leave the default settings → click on “Next”.
Step 9 − Choose the path where you want to save the file → click on “Next”.
Step 10 − Click “Install” and wait for the installation bar to finish.
To install it in Windows 7, 8, 10 versions, you have to check if your computer supports virtualization. Following are the basic requirements −
In my case, we have a laptop HP Probook 450 G3, which supports it.
Before continuing with the installation, follow the steps given below.
Step 1 − Ensure that hardware virtualization support is turned on in the BIOS settings as shown below −
Step 2 − Type in the search bar “turn windows features on or off” and click on that feature as shown below.
Step 3 − Select and enable Hyper-V.
In this section, we will learn how to create a virtual machine. To begin with, we have to open the Hyper-V manager and then follow the steps given below.
Step 1 − Go to “Server Manager” → Click on “Hyper-V Manager”.
Step 2 − Click “New” on the left Panel or on the “Actions” button.
Step 3 − Double-click on “Virtual Machine…”
Step 4 − A new table will open → Type Name of your new machine → click “Next”.
Step 5 − A new table will be opened where you have to allocate the memory. Keep in mind you cannot choose more memory than you have physically.
Step 6 − In the “Connection” drop down box, choose your physical network adaptor → click on “Next”.
Step 7 − Now it is time to create a Virtual Hard disk, if you already have one, choose the second option.
Step 8 − Select the Image of ISO that has to be installed → click on “Finish”.
Step 9 − After clicking on finish, you would get the following message as shown in the screenshot below.
Step 10 − To connect to the Virtual machine, Right Click on the created machine → click on “Connect…”
Step 11 − After that, installation of your ISO will continue.
The Hyper-V vSwitch is a software, layer-2 Ethernet network-traffic switch. It allows administrators to connect VMs to either physical or virtual networks. It is available by default within the Hyper-V Manager installation and contains extended capabilities for security and resource tracking.
If you attempt to create a VM right after the set-up process, you will not be able to connect it to a network.
To set up a network environment, you will need to select the Virtual Switch Manager in the right hand side panel of Hyper-V Manager as shown in the screenshot below.
The Virtual Switch Manager helps configure the vSwitch and the Global Network Settings, which simply lets you change the default ‘MAC Address Range’, if you see any reason for that.
Creation of the virtual switch is easy and there are three vSwitch types available, which are described below −
External vSwitch will link a physical NIC of the Hyper-V host with a virtual one and then give your VMs access outside of the host. This means that your physical network and internet (if your physical network is connected to internet).
Internal vSwitch should be used for building an independent virtual network, when you need to connect VMs to each other and to a hypervisor as well.
Private vSwitch will create a virtual network where all connected VMs will see each other, but not the Hyper-V host. This will completely isolate the VMs in that sandbox.
Here, we have selected “External” and then “Create Virtual Switch”. The table with the setting of the vSwitch will be open where we will fill the fields as shown below
Name − is the name that we will put to identify the vSwitch.
Notes − is the description for us, generally, we put friendly descriptions to be understood.
Connection Type − is external as explained earlier and selects a physical network card on my server.
Once all this is entered, Click on “OK”.
In this section, we will see the task of allocating CPU, Memory and Disk Resources to the virtual machines that are running on a server. The key to allocating CPU or any other type of resource in Hyper-V is to remember that everything is relative.
For example, Microsoft has released some guidelines for Virtualizing Exchange Server. One of the things that was listed was that the overall system requirements for Exchange Server are identical whether Exchange is being run on a virtual machine or on a dedicated server.
To allocate one of the features mentioned above, we need to click on the “Settings…” tab in the right hand side panel.
To allocate more memory to the selected virtual machine, click on the “Memory” tab on the left hand side of the screen. You will also have “Startup RAM”, where you can allocate as much ram as you have physically to a VM machine → Click on “Ok”.
To allocate more processors, click on the “Processor” tab on the left hand side of the panel. Then you can enter the number of virtual processors for your machine.
If you need to expand, compress the capacity of the virtual hard disk. Click on the “IDE controller 0” on the left hand side panel → click on “Edit”.
Once all the above changes are done, Click on “Next”.
Select one of the options based on your need (all of them have their respective descriptions) and then click on “Next”.
Click on “Finish” and wait for the process to finish.
Checkpoints in Hyper-V are called snapshots and they help us to revert the machine in a desired state that we had in the past.
To create a checkpoint we should follow the steps given below.
Step 1 − Select the VM by clicking on it. On the left hand side panel, click on “Checkpoint”.
Step 2 − The following checkpoint will be created with the respective date and time in the main Hyper-V manager console.