[20740C] Module 05: Installing and Configuring Hyper-V and Virtual Machines
1. Lab: Installing and configuring Hyper-V
Scenario:
IT management at Adatum Corporation is concerned about the low utilization of many
of the physical servers that are deployed in the London datacenter. Adatum also is
exploring options for expanding into multiple branch offices and deploying servers
in public and private clouds. For this purpose, the organization is exploring the
use of virtual machines.
You will deploy the Hyper-V server role, configure virtual machine storage and
networking, and deploy the virtual machines.
Next Exercise
2. Exercise 1: Verifying installation of the Hyper-V server role
Task 1: Verify the presence of the Microsoft Hyper-V server role
On LON-HOST1, sign in as Administrator using the password Pa55w.rd.
Click Start, and then click Server Manager.
In Server Manager, click Tools, and then click Hyper-V Manager.
In Hyper-V Manager, click LON-HOST1, and then click Hyper-V Settings.
In the Hyper-V Settings for LON-HOST1 window, click each of the available options
in the left pane, and review the description.
Click Cancel.
Previous ExerciseNext Exercise
3. Exercise 2: Configuring Hyper-V networks
Task 1: Create an external network
Note- To perform this task, your computer must have physical network card (wired or
wireless) and be connected to a network.
In Hyper-V Manager, click LON-HOST1, and then in the Actions pane, click Virtual
Switch Manager.
In the Virtual Switch Manager for LON-HOST1 window, in the left pane, click New
virtual network switch.
In the Create virtual switch pane, click External, and then click Create Virtual
Switch.
In the Virtual switch properties pane, in the Name text box, type Physical Network.
In the Connection type area, click External network. Select the Allow management
operating system to share this network adapter check box, and then click OK.
In the Apply Networking Changes dialog box, read the warning that displays, and
then click Yes.
In Server Manager, click Local Server, and then verify that the name of the network
adapter has changed to vEthernet (Physical Network).
Previous ExerciseNext Exercise
4. Exercise 2: Configuring Hyper-V networks
Task 2: Create a private network
On LON-HOST1, in Hyper-V Manager, in the Actions pane, click Virtual Switch
Manager.
In the Virtual Switch Manager for LON-HOST1 window, in the left pane, click New
virtual network switch.
In the Create virtual switch pane, click Private, and then click Create Virtual
Switch.
In the Virtual Switch Properties pane, in the Name text box, type Isolated Network.
In the Connection type area, verify that Private network is selected, and then
click OK.
In Server Manager, verify that no new network adapters are visible.
Previous ExerciseNext Exercise
5. Exercise 2: Configuring Hyper-V networks
Task 3: Create an internal network
On LON-HOST1, in Hyper-V Manager, in the Actions pane, click Virtual Switch
Manager.
In the Virtual Switch Manager for LON-HOST1 window, in the left pane, click New
virtual network switch.
In the Create virtual switch pane, click Internal, and then click Create Virtual
Switch.
In the Virtual Switch Properties pane, in the Name text box, type Host Internal
Network.
In the Connection type area, verify that Internal network is selected, and then
click OK.
In Server Manager, verify that a new network adapter named vEthernet (Host Internal
Network) has been created.
Previous ExerciseNext Exercise
6. Exercise 3: Creating and configuring virtual machines
Task 1: Create a Generation 2 virtual machine
On LON-HOST1, on the taskbar, click File Explorer.
In File Explorer, go to E:\Program Files\Microsoft Learning\20740\Drives.
Note: The drive letter for this path might vary depending on the configuration of
the physical host.
In File Explorer, click the Home tab, and then click the New Folder icon twice to
create two new folders. Right-click each folder, and rename them:
LON-GUEST1
LON-GUEST2
Close File Explorer.
In Hyper-V Manager, in the Actions pane, click New, and then click Virtual Machine.
In the New Virtual Machine Wizard, on the Before You Begin page, click Next.
On the Specify Name and Location page, select Store the virtual machine in a
different location, enter the following values, and then click Next:
Name: LON-GUEST2
Location: E:\Program Files\Microsoft Learning\20740\Drives\LON-GUEST2\
On the Specify Generation page, click Generation 2, and then click Next.
On the Assign Memory page, in the Startup memory box, enter a value of 1024 MB, and
then click Next.
On the Configure Networking page, click Isolated Network, and then click Next.
On the Connect Virtual Hard Disk page, click Create a virtual hard disk.
In the Name text box, type LON-GUEST2.vhdx.
In the Location text box, type E:\Program Files\Microsoft
Learning\20740\Drives\LON-GUEST2.
In the Size text box, type 127, and then click Finish.
Right-click LON-GUEST2, and then click Settings.
In the Settings for LON-GUEST2 on LON-HOST1 window, in the Hardware area, click
SCSI Controller.
In the right pane, click DVD Drive, and then click Add.
In the DVD Drive area, click Image file.
In the Image file text box, type E:\Program Files\Microsoft
Learning\20740\Drives\WinServer2016_1607.iso, and then click Apply.
In the Hardware area, click Firmware.
In the Boot order area, click Network Adapter, click Move Down twice, and then
click OK.
Right-click LON-GUEST2, and then click Connect.
In the LON-GUEST2 on LON-HOST1 - Virtual Machine Connection window, click Start.
Press any key to boot from DVD.
In the Windows Setup window, click Next, and then click Install now.
On the Select the operating system you want to install page, click Windows Server
2016 Datacenter Evaluation (Desktop Experience), and then click Next.
On the Applicable notices and license terms page, select the I accept the license
terms check box, and then click Next.
On the Which type of installation do you want page, click Custom: Install Windows
only (advanced).
On the Where do you want to install Windows page, click Drive 0 Unallocated Space,
and then click Next.
Note: The Windows Server operating system installation requires an extended amount
of time. You can work on the next task while waiting for the installation to
complete.
On the Customize settings page, in the Password and Reenter password text boxes,
type Pa55w.rd, and then click Finish.
After the installation is complete, in the LON-GUEST2 on LON-HOST1 - Virtual
Machine Connection window, click Shut Down, and then click Shut Down again to
confirm.
Previous ExerciseNext Exercise
7. Exercise 3: Creating and configuring virtual machines
Task 2: Create a Generation 1 virtual machine
In Hyper-V Manager, in the Actions pane, click New, and then click Hard Disk.
In the New Virtual Hard Disk Wizard, on the Before You Begin page, click Next.
On the Choose Disk Format page, click VHD, and then click Next.
On the Choose Disk Type page, select Differencing, and then click Next.
Note: The drive letter for the file location path in the following steps might vary
depending on the configuration of the physical host.
On the Specify Name and Location page, specify the following details, and then
click Next:
Name: LON-GUEST1.vhd
Location: C:\Program Files\Microsoft Learning\Base\Base17C-WS16-1607.vhd
On the Configure Disk page, type E:\Program Files\Microsoft Learning\Base\Base17C-
WS16-1607.vhd as the location, and then click Finish.
Click Start, and then click the Windows PowerShell icon.
At the Windows PowerShell command prompt, type the following command to create a
new virtual machine named LON-GUEST1, and then press Enter:
New-VM -Name LON-GUEST1 -MemoryStartupBytes 1024MB -VHDPath "E:\Program
Files\Microsoft Learning\20740\Drives\LON-GUEST1\LON-GUEST1.vhd" -SwitchName
"Isolated Network"
Close the Windows PowerShell window.
Previous ExerciseNext Exercise
8. Exercise 3: Creating and configuring virtual machines
Task 3: Configure virtual machines
On LON-HOST1, in Hyper-V Manager, right-click LON-GUEST1, and then click Settings.
In the Settings for LON-GUEST1 on LON-HOST1 window, note the list of hardware for
LON-GUEST1.
In the Hardware area, click Memory.
Select the Enable Dynamic Memory check box.
In the Maximum RAM box, type 4096.
In the Hardware area, click Processor.
In the Number of virtual processors text box, type 2.
In the Hardware area, click Network Adapter.
In the Bandwidth Management area, select the Enable bandwidth management check box.
In the Minimum bandwidth textbox, type 10.
In the Maximum bandwidth text box, type 100.
In the Management area, click Integration Services.
Select the Guest services check box, and then click OK.
Note: You must have completed the previous tasks in this exercise before you can
continue. This includes shutting down LON-GUEST2.
In Hyper-V Manager, right-click LON-GUEST2, and then click Settings.
In the Settings for LON-GUEST2 on LON-HOST1 window, note the list of hardware for
LON-GUEST2. Note the differences from LON-GUEST1.
In the Hardware area, click Security, and then read the settings that are
available.
In the Hardware area, click Memory.
Verify that the Enable dynamic memory check box is not selected.
In the Hardware area, click Processor.
In the Number of virtual processors text box, type 2.
In the Hardware area, expand Hard Drive, and then click Quality of Service.
Select the Enable Quality of Service management check box.
In the Minimum text box, type 10.
In the Management area, click Integration Services.
Select the Guest services check box, and then click OK.
Previous ExerciseNext Exercise
9. Exercise 3: Creating and configuring virtual machines
Task 4: Create checkpoints
On LON-HOST1, in Hyper-V Manager, right-click LON-GUEST2, and then click
Checkpoint.
Right-click LON-GUEST2, and then click Start.
Right-click LON-GUEST2, and then click Connect.
Switch to LON-GUEST2.
On LON-GUEST2, sign in as Administrator using Pa55w.rd as the password.
In Server Manager, click Local Server, and verify that there is only one network
adapter.
Switch to LON-HOST1.
On LON-HOST1, in Hyper-V Manager, right-click LON-GUEST2, and then click Settings.
In the Settings for LON-GUEST2 on LON-HOST1 window, in the Hardware area, click Add
Hardware.
In the Add Hardware area, click Network Adapter, and then click Add.
In the Network adapter area, in the Virtual switch box, select Host Internal
Network, and then click OK.
Switch to LON-GUEST2.
On LON-GUEST2, in Server Manager, refresh the view and verify that a second network
adapter has been added.
Switch to LON-HOST1.
On LON-HOST1, in Hyper-V Manager, right-click LON-GUEST2, and then click
Checkpoint.
Read the information in the Virtual Machine Checkpoint window, and then click OK.
Right-click the most recent checkpoint, and then click Apply.
In the Apply Checkpoint dialog box, click Apply.
Verify that the Status for LON-GUEST2 is Off because it was a production
checkpoint.
Previous ExerciseNext Exercise
10. Exercise 3: Creating and configuring virtual machines
Task 5: Enable host resource protection
On LON-HOST1, click the Start button, and then click Windows PowerShell.
In Windows PowerShell, at the command prompt, type the following command, and then
press Enter:
Set-VMProcessor LON-GUEST2 -EnableHostResourceProtection $true
Close the Windows PowerShell window.
Previous ExerciseNext Exercise
11. Exercise 3: Creating and configuring virtual machines
Task 6: Export a virtual machine
On LON-HOST1, in Hyper-V Manager, right-click LON-GUEST2, and then click Export.
Note: The drive letter for the file location path in the following step might vary
depending on the configuration of the physical host.
In the Export Virtual Machine dialog box, in the Location text box, type E:\Program
Files\Microsoft Learning\20740\Drives\Guest2-Bak, and then click Export.
Previous ExerciseNext Exercise
12. Exercise 4: Enabling nested virtualization for a virtual machine
Task 1: Import LON-NVHOST2
Note- Before beginning this task, verify the location of the base drives and 20740
course drives. You need the drive letter for both locations in this exercise. The
exercise assumes that the drive letter E
On LON-HOST1, click Start, and then click Windows PowerShell.
Type the following script, and then press Enter:
& 'E:\Program Files\Microsoft Learning\20740\Drives\LON-HOST1_VM-Pre-Import-
20740C.ps1'
Type the drive letter for the base images, and then press Enter.
Type the drive letter for the course images, and then press Enter.
Press Enter to continue.
Previous ExerciseNext Exercise
13. Exercise 4: Enabling nested virtualization for a virtual machine
Task 2: Enable nested virtualization
On LON-HOST1, in Hyper-V Manager, in the Virtual Machines pane, verify that the
Configuration Version for 20740C-LON-NVHOST2 is 5.0.
Right-click 20740C-LON-NVHOST2, and then click Upgrade Configuration Version.
In the Upgrade Configuration Version dialog box, click Upgrade.
Verify that the Configuration Version for 20740C-LON-NVHOST2 is now 8.0.
At the Windows PowerShell prompt, type the following command, and then press Enter:
Set-VMProcessor -VMName 20740C-LON-NVHOST2 -ExposeVirtualizationExtensions $true
Type the following command, and then press Enter:
Get-VMNetworkAdapter -VMName 20740C-LON-NVHOST2 | Set-VMNetworkAdapter
-MacAddressSpoofing On
Type the following command, and then press Enter:
Set-VM -VMName 20740C-LON-NVHOST2 -MemoryStartupBytes 4GB
Previous ExerciseNext Exercise
14. Exercise 4: Enabling nested virtualization for a virtual machine
Task 3: Enable Hyper-V
On LON-HOST1, at the Windows PowerShell prompt, type the following command, and
then press Enter:
Start-VM 20740C-LON-NVHOST2
To view the activity on LON-NVHOST2, in Hyper-V Manager, right-click 20740C-LON-
NVHOST2, and then click Connect.
Wait until LON-NVHOST2 has started, type the following at the Windows PowerShell
prompt, and then press Enter.
Enter-PSSession -VMName 20740C-LON-NVHOST2
When you receive a prompt, sign in as Adatum\Administrator by using Pa55w.rd as the
password.
Type the following command, and then press Enter:
Install-WindowsFeature -Name Hyper-V -IncludeAllSubFeature -IncludeManagementTools
-Restart
Wait for LON-NVHOST2 to restart. The virtual machine might restart several times.
Switch to LON-NVHOST2.
Sign in to LON-NVHOST2 as Administrator by using Pa55w.rd as the password.
Click Start, and then click Server Manager.
In Server Manager, click Tools, and then click Hyper-V Manager.
Verify that LON-NVHOST2 is listed in Hyper-V Manager, and then close Hyper-V
Manager.
Previous Exercise