Lab 1 — Build the Virtual Lab
Goal: stand up the virtual environment every other lab depends on. Time: ~90 minutes.
Check your hardware first
systeminfo | Select-String -Pattern "Hyper-V Requirements" -Context 0,6
Get-ComputerInfo | Select-Object HyperVisorPresent, CsTotalPhysicalMemory
Hyper-V requires Pro, Enterprise or Education. If systeminfo lists a
requirement as "No", you need the Pro upgrade or a different hypervisor —
VirtualBox works on Home and is fine for this lab.
Step 1 — Enable Hyper-V
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
Restart-Computer
# Verify after reboot
Get-Service vmms
Get-VMHost | Select-Object VirtualMachineProcessorPerformanceCount,
AvailableMemoryMB
Step 2 — Plan the addressing
Write this down before you build anything. When DHCP misbehaves later, this sheet is what you check the options against.
| VM | Host | Purpose |
|---|---|---|
DC01 | 192.168.10.10/24 | Domain controller — AD DS, DNS, DHCP |
SRV01 | 192.168.10.11/24 | Member server — file shares, print |
CLI01 | DHCP → 192.168.10.50+ | Windows client |
FW01 | 192.168.10.1 | pfSense firewall/router |
LINUX01 | DHCP | Ubuntu, joined to the domain |
Common mask: 255.255.255.0 · Gateway: 192.168.10.1 · DNS: 192.168.10.10
Step 3 — Create a virtual switch
External networking so the VMs can reach the internet:
New-VMSwitch -Name "External" -NetAdapterName "Ethernet"
Get-VMSwitch
Enable it on the external switch only if you intend to sniff traffic between VMs. Otherwise traffic between VMs on the same host is handled by the internal switch without touching the physical NIC.
Step 4 — Create the VMs
# Domain controller — needs a good chunk of RAM for the AD database
New-VM -Name "DC01" -Generation 2 -MemoryStartupBytes 4GB `
-NewVHDPath "C:\VMs\DC01.vhdx" -NewVHDSizeBytes 40GB `
-SwitchName "External"
# Member server
New-VM -Name "SRV01" -Generation 2 -MemoryStartupBytes 2GB `
-NewVHDPath "C:\VMs\SRV01.vhdx" -NewVHDSizeBytes 40GB `
-SwitchName "External"
# Client
New-VM -Name "CLI01" -Generation 2 -MemoryStartupBytes 4GB `
-NewVHDPath "C:\VMs\CLI01.vhdx" -NewVHDSizeBytes 40GB `
-SwitchName "External"
Then install Windows Server 2022 on DC01 and SRV01, and Windows 11 Pro on
CLI01.
Step 5 — Configure them
On each server, set a static address:
Get-NetAdapter | Set-NetIPInterface -Dhcp Disabled
New-NetIPAddress -InterfaceAlias "Ethernet" `
-IPAddress 192.168.10.10 -PrefixLength 24 `
-DefaultGateway 192.168.10.1
Set-DnsClientServerAddress -InterfaceAlias "Ethernet" `
-ServerAddresses 192.168.10.10
# Confirm — this is the exact command you will be asked about
ipconfig /all
Step 6 — Learn snapshots properly
New-VMSnapshot -VMName "DC01" -Name "Before AD promotion"
Get-VMSnapshot -VMName "DC01"
Restore-VMSnapshot -VMName "DC01" -Name "Before AD promotion" -Confirm:$false
A snapshot is a differential record kept on the same storage as the parent disk. If that storage fails, the snapshot dies with it. Left too long, a snapshot also causes a growing .avhdx and a read/write penalty on every disk operation — a VM with a months-old snapshot gets mysteriously slow.
Snapshots are for "roll back before I patch". They are not for recovery.
Step 7 — Document it
Create a repository with a README:
# Homelab
Windows Server lab for IT support interview preparation.
## Environment
- DC01 — 192.168.10.10/24 — AD DS, DNS, DHCP
- SRV01 — 192.168.10.11/24 — file and print services
- CLI01 — DHCP — Windows client
- FW01 — 192.168.10.1 — pfSense firewall
## Screenshots
- ad-forest.png
- ou-structure.png
- gpresult.png
Verification
Hints
Details
VMs have no network
CheckGet-VMSwitch — is there a switch, and does its NetAdapterName match
your real NIC? Then confirm Get-VMNetworkAdapter -VMName DC01 is attached to
it.Details
Hyper-V will not install
Runsysteminfo | Select-String "A hypervisor has been detected" — if VirtualBox or
VMware is running with an older hypervisor, it blocks Hyper-V.Solution
Show the full build sequence
# 1. Enable
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
Restart-Computer
# 2. Switch
New-VMSwitch -Name "External" -NetAdapterName "Ethernet"
# 3. VMs
New-VM -Name "DC01" -Generation 2 -MemoryStartupBytes 4GB `
-NewVHDPath "C:\VMs\DC01.vhdx" -NewVHDSizeBytes 40GB -SwitchName "External"
New-VM -Name "SRV01" -Generation 2 -MemoryStartupBytes 2GB `
-NewVHDPath "C:\VMs\SRV01.vhdx" -NewVHDSizeBytes 40GB -SwitchName "External"
New-VM -Name "CLI01" -Generation 2 -MemoryStartupBytes 4GB `
-NewVHDPath "C:\VMs\CLI01.vhdx" -NewVHDSizeBytes 40GB -SwitchName "External"
# 4. Static addressing on DC01
Get-NetAdapter | Set-NetIPInterface -Dhcp Disabled
New-NetIPAddress -InterfaceAlias "Ethernet" -IPAddress 192.168.10.10 -PrefixLength 24
Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ServerAddresses 192.168.10.10
# 5. Snapshots
New-VMSnapshot -VMName "DC01" -Name "Clean build"
Get-VMSnapshot -VMName "DC01"