Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Bob Tanner
packer-windows
Commits
69567f78
Commit
69567f78
authored
Oct 20, 2015
by
Stefan Scherer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch 2016 to WinRM
parent
89f4f270
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
155 additions
and
112 deletions
+155
-112
answer_files/2016/Autounattend.xml
answer_files/2016/Autounattend.xml
+13
-80
windows_2016.json
windows_2016.json
+33
-32
windows_2016_docker.json
windows_2016_docker.json
+109
-0
No files found.
answer_files/2016/Autounattend.xml
View file @
69567f78
...
...
@@ -121,125 +121,58 @@
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c
winrm quickconfig -q
</CommandLine>
<Description>
winrm quickconfig -q
</Description>
<CommandLine>
cmd.exe /c
reg add "HKLM\System\CurrentControlSet\Control\Network\NewNetworkWindowOff"
</CommandLine>
<Description>
Network prompt
</Description>
<Order>
3
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c winrm quickconfig -transport:http
</CommandLine>
<Description>
winrm quickconfig -transport:http
</Description>
<Order>
4
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c winrm set winrm/config @{MaxTimeoutms="1800000"}
</CommandLine>
<Description>
Win RM MaxTimoutms
</Description>
<CommandLine>
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\disable-winrm.ps1
</CommandLine>
<Description>
Disable WinRM
</Description>
<Order>
5
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c winrm set winrm/config/winrs @{MaxMemoryPerShellMB="800"}
</CommandLine>
<Description>
Win RM MaxMemoryPerShellMB
</Description>
<Order>
6
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c winrm set winrm/config/service @{AllowUnencrypted="true"}
</CommandLine>
<Description>
Win RM AllowUnencrypted
</Description>
<Order>
7
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c winrm set winrm/config/service/auth @{Basic="true"}
</CommandLine>
<Description>
Win RM auth Basic
</Description>
<Order>
8
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c winrm set winrm/config/client/auth @{Basic="true"}
</CommandLine>
<Description>
Win RM client auth Basic
</Description>
<Order>
9
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c winrm set winrm/config/listener?Address=*+Transport=HTTP @{Port="5985"}
</CommandLine>
<Description>
Win RM listener Address/Port
</Description>
<Order>
10
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c netsh advfirewall firewall set rule group="remote administration" new enable=yes
</CommandLine>
<Description>
Win RM adv firewall enable
</Description>
<Order>
11
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c netsh firewall add portopening TCP 5985 "Port 5985"
</CommandLine>
<Description>
Win RM port open
</Description>
<Order>
12
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c net stop winrm
</CommandLine>
<Description>
Stop Win RM Service
</Description>
<Order>
13
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c sc config winrm start= auto
</CommandLine>
<Description>
Win RM Autostart
</Description>
<Order>
14
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c net start winrm
</CommandLine>
<Description>
Start Win RM Service
</Description>
<Order>
15
</Order>
<RequiresUserInput>
true
</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v HideFileExt /t REG_DWORD /d 0 /f
</CommandLine>
<Order>
1
6
</Order>
<Order>
6
</Order>
<Description>
Show file extensions in Explorer
</Description>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
%SystemRoot%\System32\reg.exe ADD HKCU\Console /v QuickEdit /t REG_DWORD /d 1 /f
</CommandLine>
<Order>
1
7
</Order>
<Order>
7
</Order>
<Description>
Enable QuickEdit mode
</Description>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v Start_ShowRun /t REG_DWORD /d 1 /f
</CommandLine>
<Order>
1
8
</Order>
<Order>
8
</Order>
<Description>
Show Run command in Start Menu
</Description>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v StartMenuAdminTools /t REG_DWORD /d 1 /f
</CommandLine>
<Order>
1
9
</Order>
<Order>
9
</Order>
<Description>
Show Administrative Tools in Start Menu
</Description>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
%SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateFileSizePercent /t REG_DWORD /d 0 /f
</CommandLine>
<Order>
2
0
</Order>
<Order>
1
0
</Order>
<Description>
Zero Hibernation File
</Description>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
%SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateEnabled /t REG_DWORD /d 0 /f
</CommandLine>
<Order>
2
1
</Order>
<Order>
1
1
</Order>
<Description>
Disable Hibernation Mode
</Description>
</SynchronousCommand>
<SynchronousCommand
wcm:action=
"add"
>
<CommandLine>
cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE
</CommandLine>
<Order>
2
2
</Order>
<Order>
1
2
</Order>
<Description>
Disable password expiration for vagrant user
</Description>
</SynchronousCommand>
<!-- WITHOUT WINDOWS UPDATES -->
<!--
<SynchronousCommand wcm:action="add">
<CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\
openssh.ps1 -AutoStart
</CommandLine>
<Description>
Install OpenSSH
</Description>
<CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\
enable-winrm.ps1
</CommandLine>
<Description>
Enable WinRM
</Description>
<Order>99</Order>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
-->
<!-- END WITHOUT WINDOWS UPDATES -->
...
...
windows_2016.json
View file @
69567f78
...
...
@@ -2,25 +2,26 @@
"builders"
:
[
{
"type"
:
"vmware-iso"
,
"iso_url"
:
"http://care.dlservice.microsoft.com/dl/download/7/3/C/73C250BE-67C4-440B-A69B-D0E8EE77F01C/10514.0.150808-1529.TH2_RELEASE_SERVER_OEMRET_X64FRE_EN-US.ISO"
,
"iso_checksum_type"
:
"md5"
,
"iso_checksum"
:
"7003c2a4f9abe672c570ff018fbf3a27"
,
"communicator"
:
"winrm"
,
"iso_url"
:
"{{user `iso_url`}}"
,
"iso_checksum_type"
:
"{{user `iso_checksum_type`}}"
,
"iso_checksum"
:
"{{user `iso_checksum`}}"
,
"headless"
:
false
,
"boot_wait"
:
"2m"
,
"
ssh
_username"
:
"vagrant"
,
"
ssh
_password"
:
"vagrant"
,
"
ssh_wait
_timeout"
:
"6h"
,
"
winrm
_username"
:
"vagrant"
,
"
winrm
_password"
:
"vagrant"
,
"
winrm
_timeout"
:
"6h"
,
"shutdown_command"
:
"shutdown /s /t 10 /f /d p:4:1 /c
\"
Packer Shutdown
\"
"
,
"guest_os_type"
:
"windows8srv-64"
,
"tools_upload_flavor"
:
"windows"
,
"disk_size"
:
61440
,
"vnc_port_min"
:
5900
,
"vnc_port_max"
:
5980
,
"floppy_files"
:
[
"./answer_files/2016/Autounattend.xml"
,
"{{user `autounattend`}}"
,
"./scripts/disable-winrm.ps1"
,
"./scripts/enable-winrm.ps1"
,
"./scripts/microsoft-updates.bat"
,
"./scripts/win-updates.ps1"
,
"./scripts/openssh.ps1"
"./scripts/win-updates.ps1"
],
"vmx_data"
:
{
"RemoteDisplay.vnc.enabled"
:
"false"
,
...
...
@@ -32,22 +33,25 @@
},
{
"type"
:
"virtualbox-iso"
,
"iso_url"
:
"http://care.dlservice.microsoft.com/dl/download/7/3/C/73C250BE-67C4-440B-A69B-D0E8EE77F01C/10514.0.150808-1529.TH2_RELEASE_SERVER_OEMRET_X64FRE_EN-US.ISO"
,
"iso_checksum_type"
:
"md5"
,
"iso_checksum"
:
"7003c2a4f9abe672c570ff018fbf3a27"
,
"communicator"
:
"winrm"
,
"iso_url"
:
"{{user `iso_url`}}"
,
"iso_checksum_type"
:
"{{user `iso_checksum_type`}}"
,
"iso_checksum"
:
"{{user `iso_checksum`}}"
,
"headless"
:
false
,
"boot_wait"
:
"2m"
,
"
ssh
_username"
:
"vagrant"
,
"
ssh
_password"
:
"vagrant"
,
"
ssh_wait
_timeout"
:
"6h"
,
"
winrm
_username"
:
"vagrant"
,
"
winrm
_password"
:
"vagrant"
,
"
winrm
_timeout"
:
"6h"
,
"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"
:
[
"./answer_files/2016/Autounattend.xml"
,
"{{user `autounattend`}}"
,
"./scripts/disable-winrm.ps1"
,
"./scripts/enable-winrm.ps1"
,
"./scripts/microsoft-updates.bat"
,
"./scripts/win-updates.ps1"
,
"./scripts/openssh.ps1"
,
"./scripts/oracle-cert.cer"
],
"vboxmanage"
:
[
...
...
@@ -68,22 +72,13 @@
],
"provisioners"
:
[
{
"type"
:
"shell"
,
"remote_path"
:
"/tmp/script.bat"
,
"execute_command"
:
"{{.Vars}} cmd /c C:/Windows/Temp/script.bat"
,
"type"
:
"windows-shell"
,
"scripts"
:
[
"./scripts/vm-guest-tools.bat"
,
"./scripts/vagrant-ssh.bat"
,
"./scripts/enable-rdp.bat"
,
"./scripts/install-containers.bat"
,
"./scripts/install-docker.bat"
,
"./scripts/uac-enable.bat"
]
},
{
"type"
:
"shell"
,
"inline"
:
[
"rm -rf /tmp/*"
"./scripts/compile-dotnet-assemblies.bat"
,
"./scripts/uac-enable.bat"
,
"./scripts/compact.bat"
]
}
],
...
...
@@ -94,5 +89,11 @@
"output"
:
"windows_2016_{{.Provider}}.box"
,
"vagrantfile_template"
:
"vagrantfile-windows_2016.template"
}
]
],
"variables"
:
{
"iso_url"
:
"http://care.dlservice.microsoft.com/dl/download/7/3/C/73C250BE-67C4-440B-A69B-D0E8EE77F01C/10514.0.150808-1529.TH2_RELEASE_SERVER_OEMRET_X64FRE_EN-US.ISO"
,
"iso_checksum_type"
:
"md5"
,
"iso_checksum"
:
"7003c2a4f9abe672c570ff018fbf3a27"
,
"autounattend"
:
"./answer_files/2016/Autounattend.xml"
}
}
windows_2016_docker.json
0 → 100644
View file @
69567f78
{
"builders"
:
[
{
"type"
:
"vmware-iso"
,
"communicator"
:
"winrm"
,
"iso_url"
:
"{{user `iso_url`}}"
,
"iso_checksum_type"
:
"{{user `iso_checksum_type`}}"
,
"iso_checksum"
:
"{{user `iso_checksum`}}"
,
"headless"
:
false
,
"boot_wait"
:
"2m"
,
"winrm_username"
:
"vagrant"
,
"winrm_password"
:
"vagrant"
,
"winrm_timeout"
:
"6h"
,
"shutdown_command"
:
"shutdown /s /t 10 /f /d p:4:1 /c
\"
Packer Shutdown
\"
"
,
"guest_os_type"
:
"windows8srv-64"
,
"disk_size"
:
61440
,
"vnc_port_min"
:
5900
,
"vnc_port_max"
:
5980
,
"floppy_files"
:
[
"{{user `autounattend`}}"
,
"./scripts/disable-winrm.ps1"
,
"./scripts/enable-winrm.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"
}
},
{
"type"
:
"virtualbox-iso"
,
"communicator"
:
"winrm"
,
"iso_url"
:
"{{user `iso_url`}}"
,
"iso_checksum_type"
:
"{{user `iso_checksum_type`}}"
,
"iso_checksum"
:
"{{user `iso_checksum`}}"
,
"headless"
:
false
,
"boot_wait"
:
"2m"
,
"winrm_username"
:
"vagrant"
,
"winrm_password"
:
"vagrant"
,
"winrm_timeout"
:
"6h"
,
"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`}}"
,
"./scripts/disable-winrm.ps1"
,
"./scripts/enable-winrm.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"
,
"./scripts/compile-dotnet-assemblies.bat"
,
"./scripts/install-containers.bat"
,
]
},
{
"type"
:
"windows-restart"
},
{
"type"
:
"windows-shell"
,
"scripts"
:
[
"./scripts/install-docker.bat"
,
"./scripts/uac-enable.bat"
,
"./scripts/compact.bat"
]
}
],
"post-processors"
:
[
{
"type"
:
"vagrant"
,
"keep_input_artifact"
:
false
,
"output"
:
"windows_2016_docker_{{.Provider}}.box"
,
"vagrantfile_template"
:
"vagrantfile-windows_2016.template"
}
],
"variables"
:
{
"iso_url"
:
"http://care.dlservice.microsoft.com/dl/download/7/3/C/73C250BE-67C4-440B-A69B-D0E8EE77F01C/10514.0.150808-1529.TH2_RELEASE_SERVER_OEMRET_X64FRE_EN-US.ISO"
,
"iso_checksum_type"
:
"md5"
,
"iso_checksum"
:
"7003c2a4f9abe672c570ff018fbf3a27"
,
"autounattend"
:
"./answer_files/2016/Autounattend.xml"
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment