windows_10.json 7.77 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
      "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,
Kocoji's avatar
Kocoji committed
21
22
      "iso_checksum": "{{user `iso_checksum`}}",
      "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
      ],
      "guest_additions_mode": "none",
Stefan Scherer's avatar
Stefan Scherer committed
64
      "iso_checksum": "{{user `iso_checksum`}}",
65
      "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
      "guest_os_type": "windows9-64",
      "headless": "{{user `headless`}}",
Stefan Scherer's avatar
Stefan Scherer committed
96
      "iso_checksum": "{{user `iso_checksum`}}",
97
      "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
      "guest_additions_mode": "disable",
      "guest_os_type": "Windows10_64",
      "headless": "{{user `headless`}}",
Stefan Scherer's avatar
Stefan Scherer committed
134
      "iso_checksum": "{{user `iso_checksum`}}",
135
      "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
191
192
193
194
    }
  ],
  "post-processors": [
    {
      "keep_input_artifact": false,
      "output": "windows_10_{{.Provider}}.box",
      "type": "vagrant",
      "vagrantfile_template": "vagrantfile-windows_10.template"
195
196
    }
  ],
Stefan Scherer's avatar
Stefan Scherer committed
197
  "provisioners": [
Stefan Scherer's avatar
Stefan Scherer committed
198
199
    {
      "execute_command": "{{ .Vars }} cmd /c \"{{ .Path }}\"",
200
      "remote_path": "/tmp/script.bat",
Stefan Scherer's avatar
Stefan Scherer committed
201
      "scripts": [
Stefan Scherer's avatar
Stefan Scherer committed
202
        "./scripts/enable-rdp.bat"
203
204
      ],
      "type": "windows-shell"
Stefan Scherer's avatar
Stefan Scherer committed
205
    },
Stefan Scherer's avatar
Stefan Scherer committed
206
207
    {
      "scripts": [
208
        "./scripts/vm-guest-tools.ps1",
Stefan Scherer's avatar
Stefan Scherer committed
209
        "./scripts/debloat-windows.ps1"
210
211
      ],
      "type": "powershell"
Stefan Scherer's avatar
Stefan Scherer committed
212
    },
Stefan Scherer's avatar
Stefan Scherer committed
213
    {
214
215
      "restart_timeout": "{{user `restart_timeout`}}",
      "type": "windows-restart"
Stefan Scherer's avatar
Stefan Scherer committed
216
    },
217
218
    {
      "scripts": [
Stefan Scherer's avatar
Cleanup    
Stefan Scherer committed
219
220
        "./scripts/set-powerplan.ps1",
        "./scripts/docker/disable-windows-defender.ps1"
221
222
      ],
      "type": "powershell"
223
    },
Stefan Scherer's avatar
Stefan Scherer committed
224
225
    {
      "execute_command": "{{ .Vars }} cmd /c \"{{ .Path }}\"",
226
      "remote_path": "/tmp/script.bat",
Stefan Scherer's avatar
Stefan Scherer committed
227
      "scripts": [
Stefan Scherer's avatar
Stefan Scherer committed
228
        "./scripts/pin-powershell.bat",
229
        "./scripts/compile-dotnet-assemblies.bat",
Stefan Scherer's avatar
Cleanup    
Stefan Scherer committed
230
        "./scripts/set-winrm-automatic.bat",
Stefan Scherer's avatar
Stefan Scherer committed
231
232
        "./scripts/uac-enable.bat",
        "./scripts/dis-updates.bat",
Stefan Scherer's avatar
Cleanup    
Stefan Scherer committed
233
        "./scripts/compact.bat"
234
235
      ],
      "type": "windows-shell"
236
    }
Stefan Scherer's avatar
Stefan Scherer committed
237
238
  ],
  "variables": {
239
    "autounattend": "./answer_files/10/Autounattend.xml",
Stefan Scherer's avatar
Stefan Scherer committed
240
241
    "disk_size": "61440",
    "disk_type_id": "1",
Frederik Carlier's avatar
Frederik Carlier committed
242
    "memory": "2048",
243
    "headless": "false",
Stefan Scherer's avatar
Stefan Scherer committed
244
    "iso_checksum": "sha256:f1a4f2176259167cd2c8bf83f3f5a4039753b6cc28c35ac624da95a36e9620fc",
Stefan Scherer's avatar
Stefan Scherer committed
245
    "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
246
    "restart_timeout": "5m",
247
    "vhv_enable": "false",
248
    "virtio_win_iso": "~/virtio-win.iso",
249
    "vm_name": "windows_10",
250
    "winrm_timeout": "6h"
Stefan Scherer's avatar
Stefan Scherer committed
251
  }
Stefan Scherer's avatar
Stefan Scherer committed
252
}