Fully unattended Windows 11 Pro build using Autounattend.xml, swtpm for TPM 2.0 emulation, and VirtIO drivers. Five PowerShell provisioners strip bloatware, telemetry, unused services, and apply performance tuning for a resource-constrained host. Output is a compressed QCOW2 image. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
33 lines
1.4 KiB
PowerShell
33 lines
1.4 KiB
PowerShell
#Requires -RunAsAdministrator
|
|
|
|
# Services that consume resources without adding value in a minimal VM
|
|
$disable = @{
|
|
"DiagTrack" = "Connected User Experiences and Telemetry"
|
|
"dmwappushservice" = "WAP Push Message Routing"
|
|
"SysMain" = "Superfetch — causes high I/O in VMs"
|
|
"WSearch" = "Windows Search indexer — CPU/disk heavy"
|
|
"MapsBroker" = "Downloaded Maps Manager"
|
|
"lfsvc" = "Geolocation Service"
|
|
"XblAuthManager" = "Xbox Live Auth Manager"
|
|
"XblGameSave" = "Xbox Live Game Save"
|
|
"XboxGipSvc" = "Xbox Accessory Management"
|
|
"XboxNetApiSvc" = "Xbox Live Networking"
|
|
"RetailDemo" = "Retail Demo"
|
|
"Fax" = "Fax"
|
|
"WbioSrvc" = "Windows Biometric (no fingerprint reader in VM)"
|
|
"WMPNetworkSvc" = "Windows Media Player Network Sharing"
|
|
"icssvc" = "Mobile Hotspot"
|
|
"SharedAccess" = "Internet Connection Sharing"
|
|
"wisvc" = "Windows Insider Service"
|
|
"PcaSvc" = "Program Compatibility Assistant"
|
|
"wercplsupport" = "Problem Reports control panel support"
|
|
}
|
|
|
|
foreach ($name in $disable.Keys) {
|
|
$svc = Get-Service -Name $name -ErrorAction SilentlyContinue
|
|
if ($svc) {
|
|
Stop-Service -Name $name -Force -ErrorAction SilentlyContinue
|
|
Set-Service -Name $name -StartupType Disabled -ErrorAction SilentlyContinue
|
|
}
|
|
}
|