Once you are done with the installation of Hyper-V, the creation of VMs is an easy procedure. First, you'll have to locate the Hyper-V manager icon and I suggest you place it in an easily accessible spot:
Now, all you have to do is start the Hyper-V manager and you'll be presented with an interface apparently identical to the one previously available in Server 2012.
However, this modern hypervisor has at least one option worthy of separate explanation and that is the Second Generation Virtual Machines.
Generation 2 Virtual Machines
The concept of Generation 2 VMs was first introduced in Windows Server 2012 R2 Hyper-V. These VMs can boot from a virtual UEFI instead of booting from a traditional BIOS allowing for, among other things, Secure Boot. This also enables the use of BitLocker inside the VM's virtual disks.
Generation 2 new functionalities:
- PXE boot by using a standard network adapter.
- Previously, this could only be done with the use of a legacy network adapter
- Boot from a SCSI virtual hard disk or SCSI virtual DVD
- In the previous hypervisor, you could not boot a VM from a SCSI-attached virtual hard disk or from a DVD
- Boot only from .vhdx files
- UEFI firmware support
- Secure Boot (enabled by default)
Generation 2 removed functionalities:
- The virtual IDE controller is not available.
- Legacy network adapters are not available
- No floppy controller support
- No support to physical CD or DVD drives
- The virtual DVD drive in generation 2 VMs only supports ISO image files
- No support for vhd files
- And can't boot from vhdx converted from vhd
- No support to 64-bit versions of Windows Server 2008 R2 and Windows 7
- These operation systems depend on a programmable interrupt controller (PIC), which is not present in generation 2 VM hardware
Several Linux distributions can take advantage of Generation 2 VM settings and Secure Boot in Windows 2010. I’ll demonstrate this in a future post.
Creating a Windows Server 2016 Virtual Machine
I'm going to start testing Server 2016 Technical Preview 4 and for that, I'll be using a number of VMs created inside Windows 10 Client Hyper-V
The procedure to create a VM inside Hyper-V is pretty much straight forward:
- Choose a name: LAB-DC2016 it will be my domain controller;
- Specify generation: Generation 2 (obviously)
- Assign memory (RAM): 1024 Mb (but using the Dynamic Memory option);
- Configure networking: I'll take care of this later;
- Connect a virtual hard disk: I’ll attach a virtual hard disk later;
Now, instead of installing a full system and clone it, like I did before, this time I'll be using one .vhdx file as a parent disk and create my VMs using child differencing disks.
Create multiple VMs using differencing disks
A differencing disk is a virtual hard disk associated with another virtual hard disk that you select when you create the differencing disk. Thus, the disk to which you want to associate the differencing disk must exist first and is called the "parent" disk. The differencing disk is the "child" disk and you use it to isolate changes to a virtual hard disk or the guest operating system by storing them in a separate file. The differencing disk expands dynamically as data is written to it and can grow as large as the maximum size allocated for the parent disk when the this disk was created.
This is a very different approach with advantages and disadvantages:
- It saves a lot of space (this is good, right?)
- Each VM is always dependent on two virtual disks: the parent and the child (this is not so good…)
I already have a Windows Server 2016 Technical Preview VM installed, updated and ready to be used as a parent for as many children as I want.
Create the differencing disks
Open the wizard to create the new disks and then:
- Choose disk format: .vhdx because the parent is also in this format
- Choose disk type: Differencing
- Name and location: In a folder in one of my SSDs
- Configure disk: The location of the parent disk
I repeated this process to create two more disks because I want to create two more Server 2016 VMs. Now, all I had to do was to add a new hard drive to each of the MVs.
And select the previously created differencing disks:
As you can see, now I have 3 VMs running simultaneously and all of them are using child differencing disks from the same parent disk.