-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scripts to setup and install Windows 7, 8.1, 08 R2, and 2012 R2, Closes
- Loading branch information
Showing
14 changed files
with
1,230 additions
and
24 deletions.
There are no files selected for viewing
287 changes: 287 additions & 0 deletions
287
Packer/windows_x64/answer_files/2008_r2/Autounattend.xml
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
:: Windows 7 SP1 require KB3102810 hotfix | ||
:: Installing and searching for updates is slow and high CPU usage occurs in Windows 7. | ||
:: https://support.microsoft.com/en-us/kb/3102810 | ||
|
||
@echo off | ||
|
||
@powershell -NoProfile -ExecutionPolicy Bypass -Command "((new-object net.webclient).DownloadFile('https://download.microsoft.com/download/F/A/A/FAABD5C2-4600-45F8-96F1-B25B137E3C87/Windows6.1-KB3102810-x64.msu', 'C:\Windows\Temp\Windows6.1-KB3102810-x64.msu'))" | ||
|
||
set hotfix="C:\Windows\Temp\Windows6.1-KB3102810-x64.msu" | ||
if not exist %hotfix% goto :eof | ||
|
||
:: get windows version | ||
for /f "tokens=2 delims=[]" %%G in ('ver') do (set _version=%%G) | ||
for /f "tokens=2,3,4 delims=. " %%G in ('echo %_version%') do (set _major=%%G& set _minor=%%H& set _build=%%I) | ||
|
||
:: 6.1 | ||
if %_major% neq 6 goto :eof | ||
if %_minor% lss 1 goto :eof | ||
|
||
@echo on | ||
start /wait wusa "%hotfix%" /quiet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
"builders": [{ | ||
"type": "virtualbox-iso", | ||
"vm_name": "windows_7", | ||
"communicator": "winrm", | ||
"iso_url": "{{user `iso_url`}}", | ||
"iso_checksum_type": "{{user `iso_checksum_type`}}", | ||
"iso_checksum": "{{user `iso_checksum`}}", | ||
"headless": false, | ||
"boot_wait": "4m", | ||
"boot_command": "", | ||
"winrm_username": "vagrant", | ||
"winrm_password": "vagrant", | ||
"winrm_timeout": "8h", | ||
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"", | ||
"guest_os_type": "Windows7_64", | ||
"guest_additions_mode": "disable", | ||
"disk_size": "{{user `disk_size`}}", | ||
"floppy_files": [ | ||
"{{user `autounattend`}}", | ||
"./scripts/disable-screensaver.ps1", | ||
"./scripts/disable-winrm.ps1", | ||
"./scripts/enable-winrm.ps1", | ||
"./scripts/hotfix-KB3102810.bat", | ||
"./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", | ||
"execute_command": "{{ .Vars }} cmd /c \"{{ .Path }}\"", | ||
"scripts": [ | ||
"./scripts/vm-guest-tools.bat", | ||
"./scripts/enable-rdp.bat" | ||
] | ||
}, | ||
{ | ||
"type": "windows-restart" | ||
}, | ||
{ | ||
"type": "windows-shell", | ||
"execute_command": "{{ .Vars }} cmd /c \"{{ .Path }}\"", | ||
"scripts": [ | ||
"./scripts/set-winrm-automatic.bat", | ||
"./scripts/uac-enable.bat", | ||
"./scripts/compact.bat" | ||
] | ||
} | ||
], | ||
"post-processors": [ | ||
{ | ||
"type": "vagrant", | ||
"keep_input_artifact": false, | ||
"output": "../../Boxes/windows_x64/windows_7_{{.Provider}}.box", | ||
"vagrantfile_template": "windows_7_vagrantfile.template" | ||
} | ||
], | ||
"variables": { | ||
"iso_url": "http://care.dlservice.microsoft.com/dl/download/evalx/win7/x64/EN/7600.16385.090713-1255_x64fre_enterprise_en-us_EVAL_Eval_Enterprise-GRMCENXEVAL_EN_DVD.iso", | ||
"iso_checksum_type": "md5", | ||
"iso_checksum": "1d0d239a252cb53e466d39e752b17c28", | ||
"autounattend": "./answer_files/7/Autounattend.xml", | ||
"disk_size": "61440" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
Vagrant.require_version ">= 1.6.2" | ||
|
||
Vagrant.configure("2") do |config| | ||
config.vm.define "vagrant-windows-7" | ||
config.vm.box = "windows_7" | ||
config.vm.communicator = "winrm" | ||
|
||
# Admin user name and password | ||
config.winrm.username = "vagrant" | ||
config.winrm.password = "vagrant" | ||
|
||
config.vm.guest = :windows | ||
config.windows.halt_timeout = 15 | ||
|
||
config.vm.network :forwarded_port, guest: 3389, host: 3389, id: "rdp", auto_correct: true | ||
config.vm.network :forwarded_port, guest: 22, host: 2222, id: "ssh", auto_correct: true | ||
|
||
config.vm.provider :virtualbox do |v, override| | ||
#v.gui = true | ||
v.customize ["modifyvm", :id, "--memory", 2048] | ||
v.customize ["modifyvm", :id, "--cpus", 2] | ||
v.customize ["setextradata", "global", "GUI/SuppressMessages", "all" ] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
"builders": [{ | ||
"type": "virtualbox-iso", | ||
"vm_name": "windows_81", | ||
"communicator": "winrm", | ||
"iso_url": "{{user `iso_url`}}", | ||
"iso_checksum_type": "{{user `iso_checksum_type`}}", | ||
"iso_checksum": "{{user `iso_checksum`}}", | ||
"headless": false, | ||
"boot_wait": "4m", | ||
"boot_command": "", | ||
"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": "Windows81_64", | ||
"guest_additions_mode": "disable", | ||
"disk_size": "{{user `disk_size`}}", | ||
"floppy_files": [ | ||
"{{user `autounattend`}}", | ||
"./scripts/disable-screensaver.ps1", | ||
"./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", | ||
"execute_command": "{{ .Vars }} cmd /c \"{{ .Path }}\"", | ||
"scripts": [ | ||
"./scripts/vm-guest-tools.bat", | ||
"./scripts/enable-rdp.bat" | ||
] | ||
}, | ||
{ | ||
"type": "windows-restart" | ||
}, | ||
{ | ||
"type": "windows-shell", | ||
"execute_command": "{{ .Vars }} cmd /c \"{{ .Path }}\"", | ||
"scripts": [ | ||
"./scripts/set-winrm-automatic.bat", | ||
"./scripts/compile-dotnet-assemblies.bat", | ||
"./scripts/uac-enable.bat", | ||
"./scripts/compact.bat" | ||
] | ||
} | ||
], | ||
"post-processors": [ | ||
{ | ||
"type": "vagrant", | ||
"keep_input_artifact": false, | ||
"output": "../../Boxes/windows_x64/windows_81_{{.Provider}}.box", | ||
"vagrantfile_template": "windows_81_vagrantfile.template" | ||
} | ||
], | ||
"variables": { | ||
"iso_url": "http://download.microsoft.com/download/B/9/9/B999286E-0A47-406D-8B3D-5B5AD7373A4A/9600.16384.WINBLUE_RTM.130821-1623_X64FRE_ENTERPRISE_EVAL_EN-US-IRM_CENA_X64FREE_EN-US_DV5.ISO", | ||
"iso_checksum_type": "md5", | ||
"iso_checksum": "5e4ecb86fd8619641f1d58f96e8561ec", | ||
"autounattend": "./answer_files/81/Autounattend.xml", | ||
"disk_size": "61440" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
Vagrant.require_version ">= 1.6.2" | ||
|
||
Vagrant.configure("2") do |config| | ||
config.vm.define "vagrant-windows-81" | ||
config.vm.box = "windows_81" | ||
config.vm.communicator = "winrm" | ||
|
||
# Admin user name and password | ||
config.winrm.username = "vagrant" | ||
config.winrm.password = "vagrant" | ||
|
||
config.vm.guest = :windows | ||
config.windows.halt_timeout = 15 | ||
|
||
config.vm.network :forwarded_port, guest: 3389, host: 3389, id: "rdp", auto_correct: true | ||
config.vm.network :forwarded_port, guest: 22, host: 2222, id: "ssh", auto_correct: true | ||
|
||
config.vm.provider :virtualbox do |v, override| | ||
#v.gui = true | ||
v.customize ["modifyvm", :id, "--memory", 2048] | ||
v.customize ["modifyvm", :id, "--cpus", 2] | ||
v.customize ["setextradata", "global", "GUI/SuppressMessages", "all" ] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{ | ||
"builders": [{ | ||
"type": "virtualbox-iso", | ||
"vm_name": "windows_server_2008_r2", | ||
"communicator": "winrm", | ||
"iso_url": "{{user `iso_url`}}", | ||
"iso_checksum_type": "{{user `iso_checksum_type`}}", | ||
"iso_checksum": "{{user `iso_checksum`}}", | ||
"headless": false, | ||
"boot_wait": "4m", | ||
"boot_command": "", | ||
"winrm_username": "vagrant", | ||
"winrm_password": "vagrant", | ||
"winrm_timeout": "8h", | ||
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"", | ||
"guest_os_type": "Windows2008_64", | ||
"guest_additions_mode": "disable", | ||
"disk_size": "{{user `disk_size`}}", | ||
"floppy_files": [ | ||
"{{user `autounattend`}}", | ||
"./scripts/disable-screensaver.ps1", | ||
"./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", | ||
"execute_command": "{{ .Vars }} cmd /c \"{{ .Path }}\"", | ||
"scripts": [ | ||
"./scripts/vm-guest-tools.bat", | ||
"./scripts/enable-rdp.bat" | ||
] | ||
}, | ||
{ | ||
"type": "windows-restart" | ||
}, | ||
{ | ||
"type": "windows-shell", | ||
"execute_command": "{{ .Vars }} cmd /c \"{{ .Path }}\"", | ||
"scripts": [ | ||
"./scripts/set-winrm-automatic.bat", | ||
"./scripts/uac-enable.bat", | ||
"./scripts/compact.bat" | ||
] | ||
} | ||
], | ||
"post-processors": [{ | ||
"type": "vagrant", | ||
"keep_input_artifact": false, | ||
"output": "../../Boxes/windows_x64/windows_server_2008_r2_{{.Provider}}.box", | ||
"vagrantfile_template": "windows_server_2008_r2_vagrantfile.template" | ||
}], | ||
"variables": { | ||
"iso_url": "http://download.microsoft.com/download/7/5/E/75EC4E54-5B02-42D6-8879-D8D3A25FBEF7/7601.17514.101119-1850_x64fre_server_eval_en-us-GRMSXEVAL_EN_DVD.iso", | ||
"iso_checksum_type": "md5", | ||
"iso_checksum": "4263be2cf3c59177c45085c0a7bc6ca5", | ||
"autounattend": "./answer_files/2008_r2/Autounattend.xml", | ||
"disk_size": "61440" | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
Packer/windows_x64/windows_server_2008_r2_vagrantfile.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
Vagrant.require_version ">= 1.6.2" | ||
|
||
Vagrant.configure("2") do |config| | ||
config.vm.define "vagrant-windows-2008-r2" | ||
config.vm.box = "windows_server_2008_r2" | ||
config.vm.communicator = "winrm" | ||
|
||
# Admin user name and password | ||
config.winrm.username = "vagrant" | ||
config.winrm.password = "vagrant" | ||
|
||
config.vm.guest = :windows | ||
config.windows.halt_timeout = 15 | ||
|
||
config.vm.network :forwarded_port, guest: 3389, host: 3389, id: "rdp", auto_correct: true | ||
config.vm.network :forwarded_port, guest: 22, host: 2222, id: "ssh", auto_correct: true | ||
|
||
config.vm.provider :virtualbox do |v, override| | ||
#v.gui = true | ||
v.customize ["modifyvm", :id, "--memory", 2048] | ||
v.customize ["modifyvm", :id, "--cpus", 2] | ||
v.customize ["setextradata", "global", "GUI/SuppressMessages", "all" ] | ||
end | ||
end |
Oops, something went wrong.