windows_10.json 8.42 KB
Newer Older
1
2
{
  "builders": [
3
    {
4
      "accelerator": "kvm",
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
      "boot_wait": "6m",
      "communicator": "winrm",
      "cpus": "2",
      "disk_size": "{{user `disk_size`}}",
      "floppy_files": [
        "{{user `autounattend`}}",
        "./floppy/WindowsPowershell.lnk",
        "./floppy/PinTo10.exe",
        "./scripts/fixnetwork.ps1",
        "./scripts/disable-screensaver.ps1",
        "./scripts/disable-winrm.ps1",
        "./scripts/enable-winrm.ps1",
        "./scripts/microsoft-updates.bat",
        "./scripts/win-updates.ps1"
      ],
      "headless": true,
      "iso_checksum": "{{user `iso_checksum`}}",
Kocoji's avatar
Kocoji committed
22
      "iso_url": "{{user `iso_url`}}",      
Frederik Carlier's avatar
Frederik Carlier committed
23
      "memory": "{{user `memory`}}",
24
25
      "output_directory": "windows_10-qemu",
      "qemuargs": [
26
27
28
29
        [
          "-drive",
          "file=windows_10-qemu/{{ .Name }},if=virtio,cache=writeback,discard=ignore,format=qcow2,index=1"
        ],
Kocoji's avatar
Kocoji committed
30
31
32
33
        [
          "-drive",
          "file={{ user `iso_url` }},media=cdrom,index=2"
        ],
34
35
36
37
        [
          "-drive",
          "file={{ user `virtio_win_iso` }},media=cdrom,index=3"
        ]
38
      ],
39
40
      "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
      "type": "qemu",
41
      "vm_name": "{{user `vm_name`}}",
42
43
44
45
      "winrm_password": "vagrant",
      "winrm_timeout": "{{user `winrm_timeout`}}",
      "winrm_username": "vagrant"
    },
Pascal Beutels's avatar
Pascal Beutels committed
46
47
    {
      "boot_wait": "6m",
48
      "communicator": "winrm",
Stefan Scherer's avatar
Stefan Scherer committed
49
      "configuration_version": "8.0",
50
      "cpus": "2",
Pascal Beutels's avatar
Pascal Beutels committed
51
52
53
54
55
56
57
58
59
60
61
      "disk_size": "{{user `disk_size`}}",
      "floppy_files": [
        "{{user `autounattend`}}",
        "./floppy/WindowsPowershell.lnk",
        "./floppy/PinTo10.exe",
        "./scripts/fixnetwork.ps1",
        "./scripts/disable-screensaver.ps1",
        "./scripts/disable-winrm.ps1",
        "./scripts/enable-winrm.ps1",
        "./scripts/microsoft-updates.bat",
        "./scripts/win-updates.ps1"
62
63
64
65
      ],
      "guest_additions_mode": "none",
      "iso_checksum": "{{user `iso_checksum`}}",
      "iso_url": "{{user `iso_url`}}",
Frederik Carlier's avatar
Frederik Carlier committed
66
      "memory": "{{user `memory`}}",
67
68
69
      "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
      "switch_name": "{{user `switch_name`}}",
      "type": "hyperv-iso",
70
      "vm_name": "{{user `vm_name`}}",
71
72
73
      "winrm_password": "vagrant",
      "winrm_timeout": "{{user `winrm_timeout`}}",
      "winrm_username": "vagrant"
Pascal Beutels's avatar
Pascal Beutels committed
74
    },
75
    {
Stefan Scherer's avatar
Stefan Scherer committed
76
      "boot_command": "",
77
78
      "boot_wait": "6m",
      "communicator": "winrm",
79
80
      "cpus": 2,
      "disk_adapter_type": "lsisas1068",
Stefan Scherer's avatar
Stefan Scherer committed
81
      "disk_size": "{{user `disk_size`}}",
Stefan Scherer's avatar
Stefan Scherer committed
82
      "disk_type_id": "{{user `disk_type_id`}}",
83
      "floppy_files": [
Stefan Scherer's avatar
Stefan Scherer committed
84
        "{{user `autounattend`}}",
85
        "./floppy/WindowsPowershell.lnk",
Stefan Scherer's avatar
Stefan Scherer committed
86
        "./floppy/PinTo10.exe",
87
        "./scripts/fixnetwork.ps1",
Stefan Scherer's avatar
Stefan Scherer committed
88
        "./scripts/disable-screensaver.ps1",
Stefan Scherer's avatar
Stefan Scherer committed
89
90
        "./scripts/disable-winrm.ps1",
        "./scripts/enable-winrm.ps1",
91
        "./scripts/microsoft-updates.bat",
Stefan Scherer's avatar
Stefan Scherer committed
92
        "./scripts/win-updates.ps1"
93
      ],
94
95
96
97
      "guest_os_type": "windows9-64",
      "headless": "{{user `headless`}}",
      "iso_checksum": "{{user `iso_checksum`}}",
      "iso_url": "{{user `iso_url`}}",
Frederik Carlier's avatar
Frederik Carlier committed
98
      "memory": "{{user `memory`}}",
99
100
      "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
      "type": "vmware-iso",
101
      "version": 14,
102
      "vm_name": "{{user `vm_name`}}",
103
104
      "vmx_data": {
        "RemoteDisplay.vnc.enabled": "false",
105
        "RemoteDisplay.vnc.port": "5900"
106
107
108
109
110
111
112
      },
      "vmx_remove_ethernet_interfaces": true,
      "vnc_port_max": 5980,
      "vnc_port_min": 5900,
      "winrm_password": "vagrant",
      "winrm_timeout": "{{user `winrm_timeout`}}",
      "winrm_username": "vagrant"
113
114
    },
    {
Stefan Scherer's avatar
Stefan Scherer committed
115
      "boot_command": "",
116
117
      "boot_wait": "6m",
      "communicator": "winrm",
118
      "cpus": 2,
Stefan Scherer's avatar
Stefan Scherer committed
119
      "disk_size": "{{user `disk_size`}}",
120
      "floppy_files": [
Stefan Scherer's avatar
Stefan Scherer committed
121
        "{{user `autounattend`}}",
122
        "./floppy/WindowsPowershell.lnk",
Stefan Scherer's avatar
Stefan Scherer committed
123
        "./floppy/PinTo10.exe",
124
        "./scripts/fixnetwork.ps1",
Stefan Scherer's avatar
Stefan Scherer committed
125
        "./scripts/disable-screensaver.ps1",
Stefan Scherer's avatar
Stefan Scherer committed
126
127
        "./scripts/disable-winrm.ps1",
        "./scripts/enable-winrm.ps1",
128
        "./scripts/microsoft-updates.bat",
Stefan Scherer's avatar
Stefan Scherer committed
129
        "./scripts/win-updates.ps1"
130
      ],
131
132
133
134
135
      "guest_additions_mode": "disable",
      "guest_os_type": "Windows10_64",
      "headless": "{{user `headless`}}",
      "iso_checksum": "{{user `iso_checksum`}}",
      "iso_url": "{{user `iso_url`}}",
Frederik Carlier's avatar
Frederik Carlier committed
136
      "memory": "{{user `memory`}}",
137
138
      "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
      "type": "virtualbox-iso",
139
      "vm_name": "{{user `vm_name`}}",
140
141
142
      "winrm_password": "vagrant",
      "winrm_timeout": "{{user `winrm_timeout`}}",
      "winrm_username": "vagrant"
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
    },
    {
      "boot_command": "",
      "boot_wait": "6m",
      "communicator": "winrm",
      "cpus": 2,
      "disk_size": "{{user `disk_size`}}",
      "floppy_files": [
        "{{user `autounattend`}}",
        "./floppy/WindowsPowershell.lnk",
        "./floppy/PinTo10.exe",
        "./scripts/fixnetwork.ps1",
        "./scripts/disable-screensaver.ps1",
        "./scripts/disable-winrm.ps1",
        "./scripts/enable-winrm.ps1",
        "./scripts/microsoft-updates.bat",
        "./scripts/win-updates.ps1"
      ],
      "guest_os_type": "win-10",
      "iso_checksum": "{{user `iso_checksum`}}",
      "iso_url": "{{user `iso_url`}}",
Frederik Carlier's avatar
Frederik Carlier committed
164
      "memory": "{{user `memory`}}",
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
      "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
      "type": "parallels-iso",
      "parallels_tools_flavor": "win",
      "parallels_tools_mode": "disable",
      "prlctl": [
        [
          "set",
          "{{.Name}}",
          "--adaptive-hypervisor",
          "on"
        ],
        [
          "set",
          "{{.Name}}",
          "--efi-boot",
          "off"
        ]
      ],
      "vm_name": "{{user `vm_name`}}",
      "winrm_password": "vagrant",
      "winrm_timeout": "{{user `winrm_timeout`}}",
      "winrm_username": "vagrant"
187
188
189
190
    }
  ],
  "post-processors": [
    {
191
      "keep_input_artifact": true,
192
193
      "output": "windows_10_{{.Provider}}.box",
      "type": "vagrant",
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
      "vagrantfile_template": "vagrantfile-windows_10.template",
      "only": [
        "virtualbox-iso"
      ]
    },
    {
      "keep_input_artifact": true,
      "type": "vsphere",
      "cluster": "{{user `vsphere_cluster`}}",
      "datacenter": "{{user `vsphere_datacenter`}}",
      "datastore": "{{user `vsphere_datastore`}}",
      "host": "{{user `vsphere_host`}}",
      "password": "{{user `vsphere_password`}}",
      "username": "{{user `vsphere_username`}}",
      "vm_name": "{{user `vsphere_vm_name`}}",
      "vm_network": "{{user `vsphere_vm_network`}}",
      "insecure": "{{user `vsphere_insecure`}}",
      "disk_mode": "{{user `vsphere_disk_mode`}}",
      "only": [
        "vmware-iso"
      ]
215
216
    }
  ],
Stefan Scherer's avatar
Stefan Scherer committed
217
  "provisioners": [
Stefan Scherer's avatar
Stefan Scherer committed
218
219
    {
      "execute_command": "{{ .Vars }} cmd /c \"{{ .Path }}\"",
220
      "remote_path": "/tmp/script.bat",
Stefan Scherer's avatar
Stefan Scherer committed
221
      "scripts": [
Stefan Scherer's avatar
Stefan Scherer committed
222
        "./scripts/enable-rdp.bat"
223
224
      ],
      "type": "windows-shell"
Stefan Scherer's avatar
Stefan Scherer committed
225
    },
Stefan Scherer's avatar
Stefan Scherer committed
226
227
    {
      "scripts": [
228
        "./scripts/vm-guest-tools.ps1",
Stefan Scherer's avatar
Stefan Scherer committed
229
        "./scripts/debloat-windows.ps1"
230
231
      ],
      "type": "powershell"
Stefan Scherer's avatar
Stefan Scherer committed
232
    },
Stefan Scherer's avatar
Stefan Scherer committed
233
    {
234
235
      "restart_timeout": "{{user `restart_timeout`}}",
      "type": "windows-restart"
Stefan Scherer's avatar
Stefan Scherer committed
236
    },
237
238
    {
      "scripts": [
Stefan Scherer's avatar
Cleanup    
Stefan Scherer committed
239
240
        "./scripts/set-powerplan.ps1",
        "./scripts/docker/disable-windows-defender.ps1"
241
242
      ],
      "type": "powershell"
243
    },
Stefan Scherer's avatar
Stefan Scherer committed
244
245
    {
      "execute_command": "{{ .Vars }} cmd /c \"{{ .Path }}\"",
246
      "remote_path": "/tmp/script.bat",
Stefan Scherer's avatar
Stefan Scherer committed
247
      "scripts": [
Stefan Scherer's avatar
Stefan Scherer committed
248
        "./scripts/pin-powershell.bat",
249
        "./scripts/compile-dotnet-assemblies.bat",
Stefan Scherer's avatar
Cleanup    
Stefan Scherer committed
250
        "./scripts/set-winrm-automatic.bat",
Stefan Scherer's avatar
Stefan Scherer committed
251
252
        "./scripts/uac-enable.bat",
        "./scripts/dis-updates.bat",
Stefan Scherer's avatar
Cleanup    
Stefan Scherer committed
253
        "./scripts/compact.bat"
254
255
      ],
      "type": "windows-shell"
256
    }
Stefan Scherer's avatar
Stefan Scherer committed
257
258
  ],
  "variables": {
259
    "autounattend": "./answer_files/10/Autounattend.xml",
Stefan Scherer's avatar
Stefan Scherer committed
260
261
    "disk_size": "61440",
    "disk_type_id": "1",
Frederik Carlier's avatar
Frederik Carlier committed
262
    "memory": "2048",
263
    "headless": "false",
Stefan Scherer's avatar
Stefan Scherer committed
264
    "iso_checksum": "sha256:f1a4f2176259167cd2c8bf83f3f5a4039753b6cc28c35ac624da95a36e9620fc",
Stefan Scherer's avatar
Stefan Scherer committed
265
    "iso_url": "https://software-download.microsoft.com/download/pr/19041.264.200511-0456.vb_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso",
Stefan Scherer's avatar
Stefan Scherer committed
266
    "restart_timeout": "5m",
267
    "vhv_enable": "false",
268
    "virtio_win_iso": "~/virtio-win.iso",
269
    "vm_name": "windows_10",
270
    "winrm_timeout": "6h"
Stefan Scherer's avatar
Stefan Scherer committed
271
  }
272
}