In my previous blog post Part 1 I did a quick hardware configuration walk-through and installed Windows 10 on my host. In Part 2, I will walk you through the Hyper-V configuration and build a Virtual Machine for my Domain Controller (DC) where we in Part 3 will be setting up Active Directory, DHCP, and DNS.
After finishing the Windows 10 installation the first thing I want to do is change the computer name to eg. OSDSUNE-LAB-01 and then check for Windows Updates. Since my Windows 10 image is offline serviced every month, Windows Updates won't find anything exciting!
If you don't offline servicing your Windows 10 image, my recommendation is that you run Windows Updates and get the latest cumulative and other updates installed before moving forward with the configuration.
Log into the host we created in Part 1.
Step 1. Type "Check for updates" in the search line next to the start button, and click "Check for updates"
Step 2. Click "Check for updates" and wait.
Step 3. After a few seconds it should start downloading and install required updates for the host.
Step 4. When it's done, reboot the host.
After a reboot, log into the host again and we will now be adding the Hyper-V feature role to the host.
Step 1. In the search line, type "Add features" and click "Turn Windows features on or off"
Step 2. Check the "Hyper-V" box and click "OK"
Step 3. Click "Restart now"
Step 4. After a reboot, log into the host and check for Windows Updates once again. In the search line, type "Check for updates" and click "Check for updates". The reason for this is that since we have add a new feature to Windows it need to re-apply the cumulative update in order for the feature to function correct.
Step 5. As mentioned it will re-apply the latest cumulative update. (And yes I has gone to the dark side...) reboot the host when it's done.
After a reboot, log into the host again and we will start setting up the Hyper-V role.
I will be using Windows PowerShell to create a Virtual Switch that uses Network Address Translation (NAT), this will keep the LAB environment separate from the rest of the network, but still provide internet access to the Virtual Machines.
Step 1. Open Windows PowerShell in Administrator elevated mode.
Step 2. To create the Virtual Switch run the below New-VMSwitch command.
New-VMSwitch -SwitchName "NAT Switch" -SwitchType Internal
Step 3. The below New-NetIPAddress command, assigns an IP address to the Virtual NIC. Which also will be the default gateway IP address for the NAT Network that we are creating.
New-NetIPAddress -IPAddress 192.168.0.1 -PrefixLength 24 -InterfaceAlias "vEthernet (NAT Switch)"
Step 4. The below New-NetNAT command assigns a private range of IP addresses that the Virtual Machines will use on the Virtual Switch we have just created.
New-NetNAT -Name "NAT Network" -InternalIPInterfaceAddressPrefix 192.168.0.0/24
We have now create a NAT Virtual Switch that will keep the LAB environment separate from the rest of the network, but still provide internet access to the Virtual Machines - Now That's Awesome!😎
Now that we have configured the Virtual Switch, it's time to launch the Hyper-V Manager and configure a Virtual Machine for the Domain Controller.
Step 1. In the search line, type "Hyper-V" and click "Hyper-V Manager"
Step 2. Right-click on the Hyper-V Server and click "Hyper-V Settings..."
Step 3. You don't have to perform this step, but by habit I like to change the default path for Virtual Hard Disks and Virtual Machines. Leave the rest as default and click "OK"
Step 4. Open File Explorer and go to "C:\Hyper-V", confirm that the folders has been created.
Step 5. Right-click on the Hyper-V Server again, but this time you click "New" and then "Virtual Machine..."
Step 6. Click "Next"
Step 7. Enter a name for the Virtual Machine (DC) and leave "Location" as default and click "Next"
Step 8. Select "Generation 2" and click "Next"
Step 9. Type in the amount of memory (RAM) you want to dedicate to the Virtual Machine (I'll give a DC server, 4 GB of memory). Uncheck "Use Dynamic Memory for this virtual machine" and click "Next"
Step 10. Now select the newly created "NAT Switch" from the drop-down menu and click "Next"
Step 11. Select "Create a virtual hard disk" and enter a name (DC.vhdx). Leave the "Location" and "Size" as default and click "Next"
Step 12. Select "Install an operating system from a bootable image file". Enter a path or browse to the "Windows Server 2019" ISO file and click "Next"
Step 13. Review the settings and click "Finish" to create the Virtual Machine.
Step 14. We should now see a new Virtual Machine in the Hyper-V Manager.
Step 15. Right-click on the Virtual Machine and then click "Connect"
Step 16. Select "File" and click "Settings..." or click Ctrl+O to enter the settings for the Virtual Machine.
Step 17. Select "Processor" and change the "Number of virtual processors" to at least 2 and click "OK"
Step 18. Now click "Start"
Step 19. Windows Server 2019 are now ready to be installed on the Virtual Machine in Part 3.
And that's it, folks! This should conclude the host and Hyper-V configuration. In Part 3 I will walk you through the installation of Windows Server 2019 on my Domain Controller and we will be setting up a basic Active Directory, DHCP, and DNS configuration.
If you have any questions regarding this topic, feel free to reach out to me. I am most active on Twitter!