windows_server_1709.json 4.9 KB
Newer Older
Stefan Scherer's avatar
Stefan Scherer committed
1 2 3
{
  "builders": [
    {
Stefan Scherer's avatar
Stefan Scherer committed
4
      "vm_name": "WindowsServer1709",
Stefan Scherer's avatar
Stefan Scherer committed
5
      "type": "hyperv-iso",
6
      "disk_size": "{{user `disk_size`}}",
Stefan Scherer's avatar
Stefan Scherer committed
7
      "boot_wait": "60s",
Stefan Scherer's avatar
Stefan Scherer committed
8
      "guest_additions_mode": "disable",
Stefan Scherer's avatar
Stefan Scherer committed
9 10 11 12 13 14 15 16
      "iso_url": "{{user `iso_url`}}",
      "iso_checksum_type": "{{user `iso_checksum_type`}}",
      "iso_checksum": "{{user `iso_checksum`}}",
      "floppy_files": [
        "{{user `autounattend`}}",
        "./floppy/WindowsPowershell.lnk",
        "./scripts/disable-screensaver.ps1",
        "./scripts/disable-winrm.ps1",
Stefan Scherer's avatar
Stefan Scherer committed
17
        "./scripts/enable-winrm.ps1",
Stefan Scherer's avatar
Stefan Scherer committed
18 19 20
        "./scripts/microsoft-updates.bat",
        "./scripts/win-updates.ps1"
      ],
Stefan Scherer's avatar
Stefan Scherer committed
21
      "communicator": "winrm",
Stefan Scherer's avatar
Stefan Scherer committed
22 23
      "winrm_username": "vagrant",
      "winrm_password": "vagrant",
Stefan Scherer's avatar
Stefan Scherer committed
24 25 26
      "winrm_timeout": "{{user `winrm_timeout`}}",
      "shutdown_command":
        "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
Stefan Scherer's avatar
Stefan Scherer committed
27 28
      "ram_size": 2048,
      "cpu": 2,
Stefan Scherer's avatar
Stefan Scherer committed
29 30 31
      "switch_name": "{{user `hyperv_switchname`}}",
      "enable_secure_boot": true,
      "enable_virtualization_extensions": true
Stefan Scherer's avatar
Stefan Scherer committed
32 33
    },
    {
Stefan Scherer's avatar
Stefan Scherer committed
34
      "vm_name": "WindowsServer1709",
Stefan Scherer's avatar
Stefan Scherer committed
35 36 37 38 39 40 41 42 43
      "type": "vmware-iso",
      "communicator": "winrm",
      "iso_url": "{{user `iso_url`}}",
      "iso_checksum_type": "{{user `iso_checksum_type`}}",
      "iso_checksum": "{{user `iso_checksum`}}",
      "headless": "{{user `headless`}}",
      "boot_wait": "60s",
      "winrm_username": "vagrant",
      "winrm_password": "vagrant",
44
      "winrm_timeout": "{{user `winrm_timeout`}}",
Stefan Scherer's avatar
Stefan Scherer committed
45 46
      "shutdown_command":
        "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
Stefan Scherer's avatar
Stefan Scherer committed
47
      "guest_os_type": "windows9srv-64",
48 49
      "disk_size": "{{user `disk_size`}}",
      "version": 11,
Stefan Scherer's avatar
Stefan Scherer committed
50 51 52 53 54 55 56
      "vnc_port_min": 5900,
      "vnc_port_max": 5980,
      "floppy_files": [
        "{{user `autounattend`}}",
        "./floppy/WindowsPowershell.lnk",
        "./scripts/disable-screensaver.ps1",
        "./scripts/disable-winrm.ps1",
Stefan Scherer's avatar
Stefan Scherer committed
57
        "./scripts/enable-winrm.ps1",
Stefan Scherer's avatar
Stefan Scherer committed
58 59 60
        "./scripts/microsoft-updates.bat",
        "./scripts/win-updates.ps1"
      ],
61
      "vmx_remove_ethernet_interfaces": true,
Stefan Scherer's avatar
Stefan Scherer committed
62 63 64 65 66 67
      "vmx_data": {
        "RemoteDisplay.vnc.enabled": "false",
        "RemoteDisplay.vnc.port": "5900",
        "memsize": "2048",
        "numvcpus": "2",
        "scsi0.virtualDev": "lsisas1068",
68
        "vhv.enable": "{{user `vhv_enable`}}"
Stefan Scherer's avatar
Stefan Scherer committed
69 70 71
      }
    },
    {
Stefan Scherer's avatar
Stefan Scherer committed
72
      "vm_name": "WindowsServer1709",
Stefan Scherer's avatar
Stefan Scherer committed
73 74 75 76 77 78 79 80 81
      "type": "virtualbox-iso",
      "communicator": "winrm",
      "iso_url": "{{user `iso_url`}}",
      "iso_checksum_type": "{{user `iso_checksum_type`}}",
      "iso_checksum": "{{user `iso_checksum`}}",
      "headless": "{{user `headless`}}",
      "boot_wait": "60s",
      "winrm_username": "vagrant",
      "winrm_password": "vagrant",
82
      "winrm_timeout": "{{user `winrm_timeout`}}",
Stefan Scherer's avatar
Stefan Scherer committed
83 84
      "shutdown_command":
        "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
Stefan Scherer's avatar
Stefan Scherer committed
85 86
      "guest_os_type": "Windows2012_64",
      "guest_additions_mode": "disable",
87
      "disk_size": "{{user `disk_size`}}",
Stefan Scherer's avatar
Stefan Scherer committed
88 89 90 91 92
      "floppy_files": [
        "{{user `autounattend`}}",
        "./floppy/WindowsPowershell.lnk",
        "./scripts/disable-screensaver.ps1",
        "./scripts/disable-winrm.ps1",
Stefan Scherer's avatar
Stefan Scherer committed
93
        "./scripts/enable-winrm.ps1",
Stefan Scherer's avatar
Stefan Scherer committed
94
        "./scripts/microsoft-updates.bat",
Stefan Scherer's avatar
Stefan Scherer committed
95
        "./scripts/win-updates.ps1"
Stefan Scherer's avatar
Stefan Scherer committed
96 97
      ],
      "vboxmanage": [
Stefan Scherer's avatar
Stefan Scherer committed
98 99
        ["modifyvm", "{{.Name}}", "--memory", "2048"],
        ["modifyvm", "{{.Name}}", "--cpus", "2"]
Stefan Scherer's avatar
Stefan Scherer committed
100 101 102 103 104 105
      ]
    }
  ],
  "provisioners": [
    {
      "type": "windows-shell",
Stefan Scherer's avatar
Stefan Scherer committed
106 107
      "execute_command": "{{ .Vars }} cmd /c \"{{ .Path }}\"",
      "scripts": ["./scripts/vm-guest-tools.bat", "./scripts/enable-rdp.bat"]
Stefan Scherer's avatar
Stefan Scherer committed
108 109 110
    },
    {
      "type": "powershell",
Stefan Scherer's avatar
Stefan Scherer committed
111
      "scripts": ["./scripts/debloat-windows.ps1"]
Stefan Scherer's avatar
Stefan Scherer committed
112 113
    },
    {
114 115
      "type": "windows-restart",
      "restart_timeout": "{{user `restart_timeout`}}"
Stefan Scherer's avatar
Stefan Scherer committed
116 117 118
    },
    {
      "type": "windows-shell",
Stefan Scherer's avatar
Stefan Scherer committed
119
      "execute_command": "{{ .Vars }} cmd /c \"{{ .Path }}\"",
Stefan Scherer's avatar
Stefan Scherer committed
120
      "scripts": [
Stefan Scherer's avatar
Stefan Scherer committed
121
        "./scripts/set-winrm-automatic.bat",
Stefan Scherer's avatar
Stefan Scherer committed
122
        "./scripts/compile-dotnet-assemblies.bat",
Stefan Scherer's avatar
Stefan Scherer committed
123
        "./scripts/uac-enable.bat",
Stefan Scherer's avatar
Stefan Scherer committed
124 125 126 127 128 129 130 131 132
        "./scripts/compact.bat"
      ]
    }
  ],
  "post-processors": [
    {
      "type": "vagrant",
      "keep_input_artifact": false,
      "output": "windows_server_1709_{{.Provider}}.box",
133
      "vagrantfile_template": "vagrantfile-windows_2016_core.template"
Stefan Scherer's avatar
Stefan Scherer committed
134 135 136 137
    }
  ],
  "variables": {
    "headless": "false",
138 139 140
    "disk_size": "61440",
    "disk_type_id": "1",
    "vhv_enable": "false",
Stefan Scherer's avatar
Stefan Scherer committed
141 142 143 144
    "manually_download_iso_from":
      "https://my.visualstudio.com/downloads?pid=2347",
    "iso_url":
      "https://software-download.microsoft.com/pr/en_windows_server_version_1709_x64_dvd_100090904.iso",
Stefan Scherer's avatar
Stefan Scherer committed
145
    "iso_checksum_type": "sha256",
Stefan Scherer's avatar
Stefan Scherer committed
146 147 148
    "iso_checksum":
      "ca1108d5be2c091bfb57e8f3db3be1e8baa9c32802131f7a6e43e63f7b596591",
    "autounattend": "./answer_files/server_1709/Autounattend.xml",
149 150
    "restart_timeout": "5m",
    "winrm_timeout": "2h"
Stefan Scherer's avatar
Stefan Scherer committed
151 152
  }
}