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