2021-01-24 08:26:53 +00:00
|
|
|
{
|
|
|
|
"builders": [
|
|
|
|
{
|
|
|
|
"type": "vsphere-iso",
|
|
|
|
"name": "win10",
|
|
|
|
|
|
|
|
"vcenter_server": "{{user `vcenter_server`}}",
|
|
|
|
"username": "{{user `vsphere_username`}}",
|
|
|
|
"password": "{{user `vsphere_password`}}",
|
|
|
|
"insecure_connection": "true",
|
|
|
|
|
|
|
|
"vm_name": "{{user `vm_guestos`}}-{{user `vm_name`}}",
|
|
|
|
"datastore": "{{user `vsphere_datastore`}}",
|
|
|
|
"folder": "{{user `vsphere_folder`}}",
|
|
|
|
"datacenter": "{{user `vsphere_datacenter`}}",
|
|
|
|
"host": "{{user `vsphere_host`}}",
|
|
|
|
"boot_order": "disk,cdrom",
|
|
|
|
|
|
|
|
"guest_os_type": "windows9_64Guest",
|
|
|
|
|
|
|
|
"communicator": "winrm",
|
|
|
|
"winrm_username": "administrator",
|
|
|
|
"winrm_password": "{{user `winrm_password`}}",
|
|
|
|
"winrm_timeout": "10m",
|
|
|
|
|
|
|
|
"cpus": 2,
|
|
|
|
"RAM": 8192,
|
|
|
|
|
|
|
|
"network_adapters": [
|
|
|
|
{
|
|
|
|
"network": "{{user `vsphere_network`}}",
|
|
|
|
"network_card": "vmxnet3"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"storage": [
|
|
|
|
{
|
|
|
|
"disk_size": 20480,
|
|
|
|
"disk_thin_provisioned": true
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"disk_controller_type": "lsilogic-sas",
|
|
|
|
"usb_controller": "xhci",
|
|
|
|
|
2021-04-11 16:13:00 +00:00
|
|
|
"iso_url": "https://{{user `repo_username`}}:{{user `repo_password`}}@sn.itch.fyi/Repository/iso/Microsoft/Windows%2010/20H2/en_windows_10_enterprise_20H2_x64.iso",
|
|
|
|
"iso_checksum": "sha256:8D1663B71280533824CF95C7AB48ADAF5A187C38FCFF5B16A569F903688916D0",
|
2021-01-24 08:26:53 +00:00
|
|
|
"iso_paths": [
|
|
|
|
"ISO-files/VMware-tools-windows-11.2.1-17243207/VMware-tools-windows-11.2.1-17243207.iso"
|
|
|
|
],
|
|
|
|
|
|
|
|
"floppy_files": [
|
|
|
|
"packer/preseed/Windows10/Autounattend.xml",
|
|
|
|
"packer/preseed/Windows10/Sysprep_Unattend.xml",
|
|
|
|
"scripts/Set-NetworkProfile.ps1",
|
|
|
|
"scripts/Disable-WinRM.ps1",
|
|
|
|
"scripts/Enable-WinRM.ps1",
|
|
|
|
"scripts/Install-VMwareTools.cmd"
|
|
|
|
],
|
|
|
|
|
|
|
|
"boot_command": "",
|
|
|
|
"boot_wait": "5m",
|
|
|
|
|
|
|
|
"shutdown_command": "C:\\Windows\\System32\\Sysprep\\sysprep.exe /generalize /oobe /unattend:A:\\Sysprep_Unattend.xml",
|
|
|
|
"shutdown_timeout": "1h",
|
|
|
|
|
|
|
|
"export": {
|
2021-04-10 14:47:47 +00:00
|
|
|
"images": false,
|
|
|
|
"output_directory": "/scratch/win10"
|
2021-01-24 08:26:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"provisioners": [
|
|
|
|
{
|
2021-04-10 13:32:31 +00:00
|
|
|
"type": "windows-update",
|
|
|
|
"filters": [
|
|
|
|
"exclude:$_.Title -like '*Preview*'",
|
|
|
|
"include:$true"
|
|
|
|
]
|
2021-01-24 08:26:53 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "powershell",
|
|
|
|
"inline": [
|
|
|
|
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12",
|
|
|
|
"Invoke-Expression ((New-Object Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "powershell",
|
|
|
|
"inline": [
|
|
|
|
"choco config set --name=limit-output --value=LimitOutput",
|
|
|
|
"choco install -y 7zip.install",
|
2021-04-10 13:32:31 +00:00
|
|
|
"choco install -y sysinternals",
|
|
|
|
"choco install -y firefox"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "windows-update",
|
|
|
|
"filters": [
|
|
|
|
"exclude:$_.Title -like '*Preview*'",
|
|
|
|
"include:$true"
|
2021-01-24 08:26:53 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "powershell",
|
2021-04-10 13:32:31 +00:00
|
|
|
"inline": [
|
|
|
|
"New-Item -Path 'C:\\Payload\\Scripts' -ItemType 'Directory' -Force:$True -Confirm:$False"
|
2021-01-24 08:26:53 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2021-04-10 13:32:31 +00:00
|
|
|
"type": "file",
|
|
|
|
"source": "scripts/Windows10/payload/",
|
|
|
|
"destination": "C:\\Payload\\"
|
2021-01-24 08:26:53 +00:00
|
|
|
},
|
|
|
|
{
|
2021-04-10 13:32:31 +00:00
|
|
|
"type": "powershell",
|
|
|
|
"scripts": [
|
|
|
|
"scripts/Windows10/Register-ScheduledTask.ps1"
|
|
|
|
]
|
2021-01-24 08:26:53 +00:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"post-processors": [[
|
|
|
|
{
|
|
|
|
"type": "shell-local",
|
|
|
|
"inline": [
|
2021-04-10 13:32:31 +00:00
|
|
|
"pwsh -command \"& scripts/Update-OvfConfiguration.ps1 \\",
|
|
|
|
" -OVFFile '/scratch/win10/{{user `vm_guestos`}}-{{user `vm_name`}}.ovf' \\",
|
|
|
|
" -Parameter @{'appliance.name'='{{user `vm_guestos`}}';'appliance.version'='{{user `vm_name`}}'}\"",
|
2021-01-24 08:26:53 +00:00
|
|
|
"pwsh -file scripts/Update-Manifest.ps1 \\",
|
2021-04-10 13:32:31 +00:00
|
|
|
" -ManifestFileName '/scratch/win10/{{user `vm_guestos`}}-{{user `vm_name`}}.mf'",
|
2021-01-24 08:26:53 +00:00
|
|
|
"ovftool --acceptAllEulas --allowExtraConfig --overwrite \\",
|
2021-04-10 13:32:31 +00:00
|
|
|
" '/scratch/win10/{{user `vm_guestos`}}-{{user `vm_name`}}.ovf' \\",
|
2021-01-24 08:26:53 +00:00
|
|
|
" /output/Windows10.ova"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]]
|
|
|
|
}
|