${locale}
${locale}
${locale}
${locale}
${locale}
${virtio_drive}:\vioscsi\2k22\amd64
${virtio_drive}:\viostor\2k22\amd64
${virtio_drive}:\NetKVM\2k22\amd64
0
true
1
EFI
100
2
MSR
128
3
Primary
true
1
1
FAT32
2
3
NTFS
C
0
3
/IMAGE/INDEX
${image_index}
true
${product_key}
Never
${virtio_drive}:\vioscsi\2k22\amd64
${virtio_drive}:\viostor\2k22\amd64
${virtio_drive}:\NetKVM\2k22\amd64
${virtio_drive}:\Balloon\2k22\amd64
${virtio_drive}:\pvpanic\2k22\amd64
${virtio_drive}:\qxldod\2k22\amd64
${virtio_drive}:\vioserial\2k22\amd64
${virtio_drive}:\vioinput\2k22\amd64
${virtio_drive}:\viorng\2k22\amd64
*
${timezone}
false
true
${admin_password}
true
true
Administrator
${admin_password}
true
1
cmd /c "${virtio_drive}:\virtio-win-guest-tools.exe /install /norestart -q"
Install VirtIO drivers and QEMU Guest Agent
2
powershell -NoProfile -Command "Set-ExecutionPolicy Bypass -Scope LocalMachine -Force"
Set execution policy
3
powershell -NoProfile -Command "Get-NetConnectionProfile | Set-NetConnectionProfile -NetworkCategory Private"
Set network to Private
4
powershell -NoProfile -Command "Get-ChildItem WSMan:\localhost\Listener | Remove-Item -Recurse -ErrorAction SilentlyContinue"
Remove existing WinRM listeners
5
powershell -NoProfile -Command "New-WSManInstance -ResourceURI winrm/config/Listener -SelectorSet @{Address='*';Transport='HTTP'}"
Create WinRM HTTP listener
6
powershell -NoProfile -Command "Set-Item WSMan:\localhost\Service\AllowUnencrypted -Value True"
Allow unencrypted WinRM
7
powershell -NoProfile -Command "Set-Item WSMan:\localhost\Service\Auth\Basic -Value True"
Allow basic auth
8
powershell -NoProfile -Command "Set-Item WSMan:\localhost\MaxEnvelopeSizekb -Value 8192"
Increase max envelope size
9
powershell -NoProfile -Command "Set-Service WinRM -StartupType Automatic"
Set WinRM auto-start
10
powershell -NoProfile -Command "New-NetFirewallRule -DisplayName WinRM-HTTP -Direction Inbound -Action Allow -Protocol TCP -LocalPort 5985 -Profile Any"
Open firewall port 5985
11
powershell -NoProfile -Command "Restart-Service WinRM -Force"
Restart WinRM service
12
powershell -NoProfile -Command "Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0"
Install OpenSSH Server
13
powershell -NoProfile -Command "Set-Service sshd -StartupType Automatic; Start-Service sshd"
Enable and start sshd
14
powershell -NoProfile -Command "New-NetFirewallRule -DisplayName OpenSSH-Server -Direction Inbound -Action Allow -Protocol TCP -LocalPort 22 -Profile Any"
Open firewall port 22
15
powershell -NoProfile -Command "$conf = 'C:\ProgramData\ssh\sshd_config'; (Get-Content $conf) -replace '#PubkeyAuthentication yes','PubkeyAuthentication yes' -replace 'Match Group administrators','#Match Group administrators' -replace ' AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys','# AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys' | Set-Content $conf; Restart-Service sshd"
Configure sshd for pubkey auth
true
true
true
true
3
${locale}
${locale}
${locale}
${locale}