Milestone 6 - devinziegler/Devin-Tech-Journal GitHub Wiki

Milestone 6

Overview

  • Installing HyperV
  • HyperV Network Config
  • Installing WAC
  • Firewall Config (PFSense)
  • Importing A Host

Installing HyperV

To Install HyperV on Windows Server 2019 Run the following commands in an administrator command prompt:

Install-WindowsFeature -Name Hyper-V -ComputerName <computer_name> -IncludeManagementTools -Restart

Test the feature was installed using the following:

Get-WindowsFeature Hyper-V -ComputerName <computer_name>

Find More Resources For HyperV at Microsoft Learn.

Hyper V Network Configuration

When Creating a new VSwitch, we must firt take down the network adapter that is being used for the host:

Get-NetAdapter

In my case this was adapter 8

Now a WAN vswitch is needed run the following:

New-VMSwitch -Name HyperV-WAN -NetAdapterName "Ethernet 8"

Make sure the Net Adapter matches the one from the output of Get-NetAdapter

Now A lan Switch is needed to complete the network, it is much the same however a adapter is not needed:

New-VMSwitch -Name LAN-INTERNAL -SwitchType Internal

Again These steps can be found in more detail at Microsoft Learn.

Installing WAC

WAC or Windows Admin Center can be installed from a browser or wget from powershell:

wget https://aka.ms/WACDownload

If Downloading from IE, make sure internet downloads are available help

PFSense Configuration

PFSense Configuration has already been covered a number of times on this wiki

Config here

PFSense also has a web portal where it can be configurated with a GUI, for this lab I chose to use DHCP on the LAN network

Creating A VM with an existing VHD

This can be down in the HyperV manager however I find it more straight forward to use powershell:

# Create the VM
New-VM -Name "wks01-super26" -MemoryStartupBytes 4GB -BootDevice VHD -VHDPath "C:\VM Storage\wks01-super26.vhdx" -Path .\VMData -Generation 2 -Switch "LAN-INTERNAL"
# Disable Secure Boot
Set-VMFirmware -VMName "wks01-super26" -DisableSecureBoot
# Enable TPM
Enable-VMTPM -VMName "wks01-super26"

This is the command is specialized for my use case, file paths will be different for other deployments.