<<

Module 5: Installing and configuring Hyper-V and virtual machines

Lab: Installing and configuring Hyper-V Exercise 1: Verifying installation of the Hyper-V role Task 1: Verify the presence of the Hyper-V server role 1. On LON-HOST1, sign in as Administrator using the password Pa55w.rd. 2. Click Start, and then click Server Manager. 3. In Server Manager, click Tools, and then click Hyper-V Manager. 4. In Hyper-V Manager, click LON-HOST1, and then click Hyper-V . 5. In the Hyper-V Settings for LON-HOST1 , click each of the available options in the left pane, and review the description. 6. Click Cancel. Results: After completing this exercise, you should have successfully verified the presence and configuration of the Hyper-V server role on a physical server. Exercise 2: Configuring Hyper-V networks Task 1: Create an external network Note: To perform this task, your must have physical network card (wired or wireless) and be connected to a network. 1. In Hyper-V Manager, click LON-HOST1, and then in the Actions pane, click Virtual Switch Manager. 2. In the Virtual Switch Manager for LON-HOST1 window, in the left pane, click New virtual network switch. 3. In the Create virtual switch pane, click External, and then click Create Virtual Switch. 4. In the Virtual switch properties pane, in the Name text box, type Physical Network 5. In the Connection type area, click External network. Select the Allow management to share this network adapter check box, and then click OK. 6. In the Apply Networking Changes , read the warning that displays, and then click Yes. 7. In Server Manager, click Local Server, and then verify that the name of the network adapter has changed to vEthernet (Physical Network). Task 2: Create a private network 1. On LON-HOST1, in Hyper-V Manager, in the Actions pane, click Virtual Switch Manager. 2. In the Virtual Switch Manager for LON-HOST1 window, in the left pane, click New virtual network switch. 3. In the Create virtual switch pane, click Private, and then click Create Virtual Switch. 4. In the Virtual Switch Properties pane, in the Name text box, type Isolated Network. 5. In the Connection type area, verify that Private network is selected, and then click OK. 6. In Server Manager, verify that no new network adapters are visible. Task 3: Create an internal network 1. On LON-HOST1, in Hyper-V Manager, in the Actions pane, click Virtual Switch Manager. 2. In the Virtual Switch Manager for LON-HOST1 window, in the left pane, click New virtual network switch. 3. In the Create virtual switch pane, click Internal, and then click Create Virtual Switch. 4. In the Virtual Switch Properties pane, in the Name text box, type Host Internal Network 5. In the Connection type area, verify that Internal network is selected, and then click OK. 6. In Server Manager, verify that a new network adapter named vEthernet (Host Internal Network) has been created. Results: After completing this exercise, you should have successfully configured an external, internal, and private network. Exercise 3: Creating and configuring virtual machines Task 1: Create a Generation 2 virtual machine 1. On LON-HOST1, on the , click . 2. In File Explorer, go to E:\Program Files\Microsoft Learning\20740\Drives. Note: The drive letter for this might vary depending on the configuration of the physical host. 3. In File Explorer, click the Home , and then click the New Folder twice to create two new folders. Right-click each folder and rename them: o LON-GUEST1 o LON-GUEST2 4. Close File Explorer. 5. In Hyper-V Manager, in the Actions pane, click New, and then click Virtual Machine. 6. In the New Virtual Machine Wizard, on the Before You Begin page, click Next. 7. On the Specify Name and Location page, select Store the virtual machine in a different location, enter the following values, and then click Next: o Name: LON-GUEST2 o Location: E:\Program Files\Microsoft Learning\20740\Drives\LON-GUEST2\ 8. On the Specify Generation page, click Generation 2, and then click Next. 9. On the Assign Memory page, in the Startup memory box, enter a value of 1024 MB, and then click Next. 10. On the Configure Networking page, click Isolated Network, and then click Next. 11. On the Connect Virtual Hard Disk page, click Create a virtual hard disk. 12. In the Name text box, type LON-GUEST2.vhdx 13. In the Location text box, type E:\Program Files\Microsoft Learning\20740\Drives\LON-GUEST2 14. In the Size text box, type 127 and then click Finish. 15. Right-click LON-GUEST2, and then click Settings. 16. In the Settings for LON-GUEST2 on LON-HOST1 window, in the Hardware area, click SCSI Controller. 17. In the right pane, click DVD Drive, and then click Add. 18. In the DVD Drive area, click Image file. 19. In the Image file text box, type: E:\Program Files\Microsoft Learning\20740\Drives\WinServer2016_1607.iso and then click Apply. 20. In the Hardware area, click Firmware. 21. In the Boot order area, click Network Adapter, click Move Down twice, and then click OK. 22. Right-click LON-GUEST2, and then click Connect. 23. In the LON-GUEST2 on LON-HOST1 – Virtual Machine Connection window, click Start. 24. Press any key to boot from DVD. 25. In the Windows Setup window, click Next, and then click Install now. 26. On the Select the operating system you want to install page, click Windows Server 2016 Datacenter Evaluation (Desktop Experience), and then click Next. 27. On the Applicable notices and license terms page, select the I accept the license terms check box, and then click Next. 28. On the Which type of installation do you want page, click Custom: Install Windows only (advanced). 29. 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 task while waiting for the installation to complete. 30. On the Customize settings page, in the Password and Reenter password text boxes, type Pa55w.rd and then click Finish. 31. 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. Task 2: Create a Generation 1 virtual machine 1. In Hyper-V Manager, in the Actions pane, click New, and then click Hard Disk. 2. In the New Virtual Hard Disk Wizard, on the Before You Begin page, click Next. 3. On the Choose Disk Format page, click VHD, and then click Next. 4. On the Choose Disk Type page, select Differencing, and then click Next. 5. On the Specify Name and Location page, specify the following details, and then click Next: o Name: LON-GUEST1.vhd o Location: E:\Program Files\Microsoft Learning\20740\Drives\LON-GUEST1\ 6. On the Configure Disk page, type: E:\Program Files\Microsoft Learning\Base\Base17C-WS16-1607.vhd as the location, and then click Finish. 7. Click Start, and then click the Windows PowerShell icon. 8. 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” 9. Close the Windows PowerShell window. Task 3: Configure virtual machines 1. On LON-HOST1, in Hyper-V Manager, right-click LON-GUEST1, and then click Settings. 2. In the Settings for LON-GUEST1 on LON-HOST1 window, note the list of hardware for LON-GUEST1. 3. In the Hardware area, click Memory. 4. Select the Enable Dynamic Memory check box. 5. In the Maximum RAM box, type 4096 6. In the Hardware area, click Processor. 7. In the Number of virtual processors text box, type 2 8. In the Hardware area, click Network Adapter. 9. In the Bandwidth Management area, select the Enable bandwidth management check box. 10. In the Minimum bandwidth text box, type 10 11. In the Maximum bandwidth text box, type 100 12. In the Management area, click Integration Services. 13. 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. 14. In Hyper-V Manager, right-click LON-GUEST2, and then click Settings. 15. In the Settings for LON-GUEST2 on LON-HOST1 window, note the list of hardware for LON-GUEST2. Note the differences from LON-GUEST1. 16. In the Hardware area, click Security, and then read the settings that are available. 17. In the Hardware area, click Memory. 18. Verify that the Enable dynamic memory check box is not selected. 19. In the Hardware area, click Processor. 20. In the Number of virtual processors text box, type 2 21. In the Hardware area, expand Hard Drive, and then click Quality of Service. 22. Select the Enable Quality of Service management check box. 23. In the Minimum text box, type 10 24. In the Management area, click Integration Services. 25. Select the Guest services check box, and then click OK. Task 4: Create checkpoints 1. On LON-HOST1, in Hyper-V Manager, right-click LON-GUEST2, and then click Checkpoint. 2. Right-click LON-GUEST2, and then click Start. 3. Right-click LON-GUEST2, and then click Connect. 4. Switch to LON-GUEST2. 5. On LON-GUEST2, sign in as Administrator using Pa55w.rd as the password. 6. In Server Manager, click Local Server, and verify that there is only one network adapter. 7. Switch to LON-HOST1. 8. On LON-HOST1, in Hyper-V Manager, right-click LON-GUEST2, and then click Settings. 9. In the Settings for LON-GUEST2 on LON-HOST1 window, in the Hardware area, click Add Hardware. 10. In the Add Hardware area, click Network Adapter, and then click Add. 11. In the Network adapter area, in the Virtual switch box, select Host Internal Network, and then click OK. 12. Switch to LON-GUEST2. 13. On LON-GUEST2, in Server Manager, refresh the view and verify that a second network adapter has been added. 14. Switch to LON-HOST1. 15. On LON-HOST1, in Hyper-V Manager, right-click LON-GUEST2, and then click Checkpoint. 16. Read the information in the Virtual Machine Checkpoint window, and then click OK. 17. Right-click the most recent checkpoint, and then click Apply. 18. In the Apply Checkpoint dialog box, click Apply. 19. Verify that the Status for LON-GUEST2 is Off because it was a production checkpoint. Task 5: Enable host resource protection 1. On LON-HOST1, click the Start , and then click Windows PowerShell. 2. In Windows PowerShell, at the command prompt, type the following command, and then press Enter: Set-VMProcessor LON-GUEST2 -EnableHostResourceProtection $true 3. Close the Windows PowerShell window. Task 6: Export a virtual machine 1. On LON-HOST1, in Hyper-V Manager, right-click LON-GUEST2, and then click Export. 2. 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. Results: After completing this exercise, you should have successfully created and configured both a Generation 1 virtual machine and a Generation 2 virtual machine. 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: is used for both but substitute the correct drive letter as necessary. 1. On LON-HOST1, click Start, and then click Windows PowerShell. 2. At the Windows PowerShell prompt, type the following script, and then press Enter: & ‘E:\Program Files\Microsoft Learning\20740\Drives\CreateVirtualSwitches.ps1’ 3. Type the following script, and then press Enter: & ‘E:\Program Files\Microsoft Learning\20740\Drives\LON-HOST1_VM-Pre- Import-20740C.ps1’ 4. Type the drive letter for the base images, and then press Enter. 5. Type the drive letter for the course images, and then press Enter. 6. Press Enter to continue. Task 2: Enable nested virtualization 1. On LON-HOST1, in Hyper-V Manager, in the Virtual Machines pane, verify that the Configuration Version for 20740C-LON-NVHOST2 is 5.0. 2. Right-click 20740C-LON-NVHOST2, and then click Upgrade Configuration Version. 3. In the Upgrade Configuration Version dialog box, click Upgrade. 4. Verify that the Configuration Version for 20740C-LON-NVHOST2 is now 8.0. 5. At the Windows PowerShell prompt, type the following command, and then press Enter: Set-VMProcessor -VMName 20740C-LON-NVHOST2 - ExposeVirtualizationExtensions $true 6. Type the following command, and then press Enter: Get-VMNetworkAdapter -VMName 20740C-LON-NVHOST2 | Set- VMNetworkAdapter -MacAddressSpoofing On 7. Type the following command, and then press Enter: Set-VM -VMName 20740C-LON-NVHOST2 -MemoryStartupBytes 4GB Task 3: Enable Hyper-V 1. On LON-HOST1, at the Windows PowerShell prompt, type the following command, and then press Enter: Start-VM 20740C-LON-NVHOST2 2. To view the activity on LON-NVHOST2, in Hyper-V Manager, right-click 20740C- LON-NVHOST2, and then click Connect. 3. Wait until LON-NVHOST2 has started, type the following at the Windows PowerShell prompt, and then press Enter: Enter-PSSession -VMName 20740C-LON-NVHOST2 4. When you receive a prompt, sign in as Adatum\Administrator by using Pa55w.rd as the password. 5. Type the following command, and then press Enter: Install-WindowsFeature -Name Hyper-V -IncludeAllSubFeature - IncludeManagementTools -Restart 6. Wait for LON-NVHOST2 to restart. The virtual machine might restart several times. 7. Switch to LON-NVHOST2. 8. Sign into LON-NVHOST2 as Administrator by using Pa55w.rd as the password. 9. Click Start, and then click Server Manager. 10. In Server Manager, click Tools, and then click Hyper-V Manager. 11. Verify that LON-NVHOST2 is listed in Hyper-V Manager, and then close Hyper- V Manager. Task 4: Prepare for the next module • Leave your host computer LON-HOST1 started. Results: After completing this exercise, you should have successfully configured a virtual machine for nested virtualization.