Milestone 11 HyperV - Oliver-Mustoe/Oliver-Mustoe-Tech-Journal GitHub Wiki
This page journals content related to SYS-350 milestone 11.
Table of contents
Windows Server 2019 installation
First I Flashed SERVER_2019 onto a USB with RUFUS.
Then signed into IPMI:

Then went to "Remote Control" > "iKVM/HTML5" > pressed the "iKVM/HTML5" button:



Then I clicked in the box and pressed F12:

Gave a password for root and pressed Enter:

Selected to terminate VMs with Space, then pressed F11:


I then used the Virtual Keyboard to repeatedly press F11 > once I got to the boot device screen selected the UEFI General UDisk:




Pressed "Next" > "Install now":


Selected Datacenter Desktop operating system:

Accepted the license and pressed Next;

Selected Custom install:

Deleted all of the drive partitions by selecting each and pressing "Delete":
Before:

After:

Selected Drive 1 then "Next":

This started the Windows installation:

After finishing it reboots a few times then it gets to this screen to create an administrator account (did not take a screenshot of this installations admin create screen so below is an equivalent screenshot from another Windows installation):


Then I used "Macro" > "Macro" > "Ctrl+Alt+Del":


Windows Server 2019 post-install tasks
I logged in > showed the following:

I selected yes > right clicked the ethernet:

On my Windows server I went to "Open Network & Internet settings" > "Change adapter options":

Right clicked Ethernet 8 > "Properties":

Selected IPv4:

Set it to the following:

Pressed OK and OK > Pressed Yes:

In Powershell checked the adapter:

Then I installed Google chrome with the following commands in Powershell:
(New-Object System.Net.WebClient).DownloadFile('https://dl.google.com/dl/chrome/install/googlechromestandaloneenterprise64.msi','chrome.msi')
.\chrome.msi

(NOTE: This auto-installs and does not require any button pressing, it shows it working once you can search for Google Chrome)

I then opened chrome > signed into my mymail account > went to Chrome Remote Desktop:

Pressed the download button:

Then added it to chrome:


Then accepted and installed:

Pressed OK:

Then installed manually:



Went back to the browser and set the name:

Set PIN > Start:

Then signed in from Google Remote desktop:

Hyper-V installation and configuration
Installing Hyper-V and setting hostname
In Powershell I ran the following to install Hyper-V:
Install-WindowsFeature -Name Hyper-V -IncludeManagementTools -Restart

(Ignore error, not related to command!)

(NOTE: Did need to press Enter as it seems Windows got stuck)
This caused the server to restart once or twice, I let it happen until it prompted me to login again which I needed to use Macro on KVM (could have used Google remote desktop for this!):


Then I searched and went to Hyper-V:

Then in Powershell I set the hostname:
Rename-Computer -NewName "Super10" -Restart
Then logged in:


Setting up WAN Switch in Hyper-V
Back in hyper-v manager > "Virtual Switch Manager...":

"New virtual network switch" > selected"External" then pressed "Create Virtual Switch":

Set the my adapter for the External (checked which adapter was Ethernet 8 as that was my WAN):

Then "Apply" > pressed "Yes" on the message:

Needed to use KVM to press Ok before the WAN changes broke:


New setup:

Setting up LAN Switch in Hyper-V
Back in the virtual switch manager > Internal type > "Create Virtual Switch":

Created following:

Apply > OK:

Setting up Remote Desktop
Then went to server manager > selected in properties "Remote Desktop" (click Disabled):

Then selected "Allow remote connections to this computer" to enable remote desktop (did press OK on the popup):

Then "Apply" > "OK":


Setting up nat switch
Created another virtual switch in the Virtual Switch Manager like the following:


(Apply, OK)
In server manager refresh > selected nat "IPv4 address assigned by DHCP, IPv6 enabled" on the vEthernet for "nat":


Went into the IPv4 settings:

Set to the following:

(Then OK > OK)
WAC setup
In Google Chrome went to https://aka.ms/WACDownload (this downloaded Windows Admin center) > then started it:
.\Downloads\WindowsAdminCenter2306.msi

Installed it with default settings:





Pressed install to start the installation:


After installing I pressed "Finish":

Then went to "https://Super10" and logged in:


I exited out of the pop and selected super10 > after all of the plugins reloaded > selected the gear wheel > "Extensions" > "Virtual machines and switches" was already installed:

Then I went back to all connections (dropdowns in the upper left) > selected super10:

Could scroll down and see the "Virtual machines" tab:

Formatting extra drive
I searched in the windows search for "Create and format hard disk partitions":


Right clicked "Disk 0" unallocated space > "New Simple Volume":

Went through the popup wizard with the following settings:






Creating fw-super10 VM in Hyper-V
Ran the following in Admin Powershell to make the needed folder structure in my new drive "F" drive and download the pfsense ISO:
mkdir "F:\ISO"
mkdir "F:\VM_FILES"
(New-Object System.Net.WebClient).DownloadFile('http://192.168.7.240/isos/pfSense-CE-2.7.0-RELEASE-amd64.iso','F:\ISO\pfsense.iso')
After that I created my fw-super10 hyper-V VM in an Admin Powershell session:
New-VM -Name "fw-super10" -MemoryStartupBytes 2GB -Path "F:\VM_FILES\fw-super10" -NewVHDPath "F:\VM_FILES\fw-super10\fw-super10.vhdx" -NewVHDSizeBytes 16GB -Generation 2 -SwitchName "HyperV-WAN"
And setup the processor count:
Set-VMProcessor "fw-super10" -Count 2
As well I added a network adapter named "LAN-INTERNAL" and connected it to the "LAN-INTERNAL" switch:
Add-VMNetworkAdapter -VMName "fw-super10" -Name "LAN-INTERNAL"
Connect-VMNetworkAdapter -VMName "fw-super10" -Name "LAN-INTERNAL" -SwitchName "LAN-INTERNAL"
And I added the pfsense ISO to the VM:
Add-VMDvdDrive -VMName "fw-super10" -Path "F:\ISO\pfsense.iso"
Turned off secure boot for the VM:
Set-VMFirmware -VMName "fw-super10" -DisableSecureBoot
Finally set the boot order on the VM:
Set-VMFirmware -VMName "fw-super10" -BootOrder $(Get-VMHardDiskDrive -VMName "fw-super10"), $(Get-VMDvdDrive -VMName "fw-super10")
Set up VM:

fw-super10 installation and configuration
Installation
From the Hyper-V manager I right clicked on the VM > "Start":


I selected the VM and pressed "Connect":


After pressing fullscreen (expand window button on the left) I accepted the warranty (pressed Enter to selected accept):

Then "Install":

Selected "Auto (UFS)":

And "Entire Disk":

Chose "GPT" partition scheme (tried "MBR" but it said it was not bootable):

Then pressed "Finish":

And selected "Commit":



After it was done was met with the following where I entered "exit" then pressed Enter:

After waiting this would cause pfsense to show up with its usual install!

configuration
Selected n to VLAN setup:

Selected hn0 as WAN:

Selected hn1 as LAN:

Continued


Then I entered option 2 > option 1 > n to DHCP configuration > set the IP address:

Set to 24 bit:

Entered an upstream:

Set to default gateway:

Set final settings (pressed enter on IPv6 setup):


Used option 8 to ping google.com:

Entered "exit" > used option 2 to setup the LAN address like the following:


Setup network:

Creating Windows 11 Hyper-V VM
Window 11 VM creation
On my Windows Server "Super10" I went to https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/:

And selected the "Hyper-V (Gen2)" option to install the iso:


Then I entered the following in a Admin Powershell to extract the zip file to my VMs drive quickly:
Add-Type -Assembly "System.IO.Compression.Filesystem"
[System.IO.Compression.ZipFile]::ExtractToDirectory("C:\Users\Administrator\Downloads\WinDev2311Eval.HyperV.zip","F:\VM_FILES\WinDev2311Eval")
After that I used the following Powershell commands in an Admin Powershell to create a new VM with the extracted zips hard drive file:
New-VM -Name "WinDev2311Eval" -MemoryStartupBytes 8GB -Path "F:\VM_FILES\WinDev2311Eval" -VHDPath "F:\VM_FILES\WinDev2311Eval\WinDev2311Eval.vhdx" -Generation 2 -SwitchName "LAN-INTERNAL"
Set-VMProcessor "WinDev2311Eval" -Count 2
Completed Windows VM:

And then started the VM:
Start-VM "WinDev2311Eval"

Then I used the "Connect..." button to access the Windows VM (it would take awhile for it to get ready):


Windows VM started:

Windows 11 VM networking setup
After it was finished getting ready, I changed the adapter settings by going to the network icon in the lower left corner > "Network and Internet settings":


Then in "Network & internet" I went to "Ethernet":

To the left of IP assignment I pressed "Edit" and filled it in with the following information:

Then I pressed "Save". With this I could ping out to the WAN!

fw-super10 DHCP setup
I used the browser on my Windows 11 VM to navigate to "https://10.0.5.2" (advanced past the HTTPs warning) to access pfsense:

I logged into pfsense with the default credentials > went through the setup wizard and set the following (only items shown are the ones changed from default settings):
In step 2 I set the hostname, domain DNS, and disabled override DNS:

In step 3 switched off blocking RFC1918 private addresses:

In step 6 I set the admin password. In step 7 reloaded pfsense.
Then I went to "Services" on the top > "DHCP Server"

Then in the LAN settings I enabled DHCP and set a range of 10.0.5.100 to 10.0.5.150 like the following (ALL OTHER SETTINGS WERE LEFT DEFAULT!):

Then I scrolled down and pressed "Save" (following shows that the settings were applied after pressing save):

With this I could go back to my Ethernet settings > set my adapter to DHCP:

DHCP set and I can still ping google.com:

Sources
-
https://learn.microsoft.com/en-us/powershell/module/hyper-v/new-vm?view=windowsserver2022-ps
-
https://4sysops.com/wiki/how-to-create-a-hyper-v-vm-with-powershell/
-
https://learn.microsoft.com/en-us/powershell/module/secureboot/?view=windowsserver2022-ps
-
https://learn.microsoft.com/lb-lu/powershell/module/hyper-v/set-vmprocessor?view=winserver2012-ps