Commit 3b71e115 authored by Stefan Scherer's avatar Stefan Scherer

Add Windows Server 1709

parent 0b8bbd63
This diff is collapsed.
#!/bin/bash
# MSDN 1709 ISO
packer build --only=virtualbox-iso --var iso_url=~/packer_cache/msdn/en_windows_server_version_1709_x64_dvd_100090904.iso --var iso_checksum=ca1108d5be2c091bfb57e8f3db3be1e8baa9c32802131f7a6e43e63f7b596591 --var iso_checksum_type=sha256 --var autounattend=./tmp/1709/Autounattend.xml windows_server_1709.json
function DockerPull {
Param ([string]$image)
Write-Host Installing $image ...
$j = Start-Job -ScriptBlock { docker pull $args[0] } -ArgumentList $image
while ( $j.JobStateInfo.state -ne "Completed" -And $j.JobStateInfo.state -ne "Failed" ) {
Write-Host $j.JobStateInfo.state
Start-Sleep 10
}
$results = Receive-Job -Job $j
$results
}
DockerPull microsoft/windowsservercore:1709
DockerPull microsoft/nanoserver:1709
{
"builders": [
{
"vm_name":"WindowsServer1709",
"type": "hyperv-iso",
"disk_size": 41440,
"boot_wait": "60s",
"guest_additions_mode":"disable",
"iso_url": "{{user `iso_url`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"floppy_files": [
"{{user `autounattend`}}",
"./floppy/WindowsPowershell.lnk",
"./floppy/PinTo10.exe",
"./scripts/disable-screensaver.ps1",
"./scripts/disable-winrm.ps1",
"./scripts/docker/enable-winrm.ps1",
"./scripts/docker/2016/install-containers-feature.ps1",
"./scripts/microsoft-updates.bat",
"./scripts/win-updates.ps1"
],
"communicator":"winrm",
"winrm_username": "vagrant",
"winrm_password": "vagrant",
"winrm_timeout" : "2h",
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
"ram_size": 2048,
"cpu": 2,
"switch_name":"{{user `hyperv_switchname`}}",
"enable_secure_boot":true,
"enable_virtualization_extensions":true
},
{
"vm_name":"WindowsServer1709",
"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",
"winrm_timeout": "2h",
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
"guest_os_type": "windows9srv-64",
"disk_size": 61440,
"vnc_port_min": 5900,
"vnc_port_max": 5980,
"floppy_files": [
"{{user `autounattend`}}",
"./floppy/WindowsPowershell.lnk",
"./floppy/PinTo10.exe",
"./scripts/disable-screensaver.ps1",
"./scripts/disable-winrm.ps1",
"./scripts/docker/enable-winrm.ps1",
"./scripts/docker/2016/install-containers-feature.ps1",
"./scripts/microsoft-updates.bat",
"./scripts/win-updates.ps1"
],
"vmx_data": {
"RemoteDisplay.vnc.enabled": "false",
"RemoteDisplay.vnc.port": "5900",
"memsize": "2048",
"numvcpus": "2",
"scsi0.virtualDev": "lsisas1068",
"virtualHW.version": "12"
}
},
{
"vm_name":"WindowsServer1709",
"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",
"winrm_timeout": "2h",
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
"guest_os_type": "Windows2012_64",
"guest_additions_mode": "disable",
"disk_size": 61440,
"floppy_files": [
"{{user `autounattend`}}",
"./floppy/WindowsPowershell.lnk",
"./floppy/PinTo10.exe",
"./scripts/disable-screensaver.ps1",
"./scripts/disable-winrm.ps1",
"./scripts/docker/enable-winrm.ps1",
"./scripts/docker/2016/install-containers-feature.ps1",
"./scripts/microsoft-updates.bat",
"./scripts/win-updates.ps1",
"./scripts/oracle-cert.cer"
],
"vboxmanage": [
[
"modifyvm",
"{{.Name}}",
"--memory",
"2048"
],
[
"modifyvm",
"{{.Name}}",
"--cpus",
"2"
]
]
}
],
"provisioners": [
{
"type": "windows-shell",
"scripts": [
"./scripts/vm-guest-tools.bat",
"./scripts/enable-rdp.bat"
]
},
{
"type": "powershell",
"scripts": [
"./scripts/docker/2016/install-containers-feature.ps1"
]
},
{
"type": "windows-restart"
},
{
"type": "powershell",
"scripts": [
"./scripts/docker/add-docker-group.ps1",
"./scripts/docker/2016/install-docker-ee-preview.ps1",
"./scripts/docker/docker-pull-1709-async.ps1",
"./scripts/docker/open-docker-insecure-port.ps1",
"./scripts/docker/remove-docker-key-json.ps1",
"./scripts/docker/disable-windows-defender.ps1"
]
},
{
"type": "windows-restart"
},
{
"type": "windows-shell",
"scripts": [
"./scripts/compile-dotnet-assemblies.bat",
"./scripts/compact.bat"
]
}
],
"post-processors": [
{
"type": "vagrant",
"keep_input_artifact": false,
"output": "windows_server_1709_{{.Provider}}.box",
"vagrantfile_template": "vagrantfile-windows_2016.template"
}
],
"variables": {
"headless": "false",
"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",
"iso_checksum_type": "sha256",
"iso_checksum": "ca1108d5be2c091bfb57e8f3db3be1e8baa9c32802131f7a6e43e63f7b596591",
"autounattend": "./answer_files/2016_core/Autounattend.xml"
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment