diff --git a/.gitignore b/.gitignore
index 1f84ee30..8c585593 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,11 @@
/iso/*
!/iso/README.md
/output-vmware/
+/output-vmware-iso/
+/output-vmware-vmx/
/output-virtualbox/
+/output-virtualbox-iso/
+/output-virtualbox-ovf/
/*.box
/packer_cache/
+
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ec6ef476..5b6c17c6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,8 @@
+## v1.4 (December 31, 2013)
+
+* Update .json files to work with Packer 0.5.0 (the `vmware` builder is renamed to `vmware-iso`, the `virtualbox` builder is renamed to `virtualbox-iso`)
+* Update README with better examples for using retail custom ISO files and disabling Windows Update installation
+
## v1.3 (December 18, 2013)
* Allow Packer to upload VMware Tools by default, but fall back to downloading the tools from VMware if required
diff --git a/README.md b/README.md
index 7476a020..a4c1a03b 100644
--- a/README.md
+++ b/README.md
@@ -6,6 +6,10 @@ This repository contains Windows templates that can be used to create boxes for
This repo began by borrowing bits from the VeeWee Windows templates (https://github.com/jedi4ever/veewee/tree/master/templates). Modifications were made to work with Packer and the VMware Fusion provider for Packer and Vagrant.
+### Packer Version
+
+[Packer](https://github.com/mitchellh/packer/blob/master/CHANGELOG.md) `0.5.0` or greater is required.
+
### Windows Versions
The following Windows versions are known to work (built with VMware Fusion 6.0.2):
@@ -26,15 +30,33 @@ All Windows Server versions are defaulted to the Server Standard edition. You ca
### Windows Updates
-The scripts in this repo will install all Windows updates – by default – during Windows Setup. This is a _very_ time consuming process, depending on the age of the OS and the quantity of updates released since the last service pack. You might want to do yourself a favor during development and disable this functionality, by commenting out this First Logon Command:
+The scripts in this repo will install all Windows updates – by default – during Windows Setup. This is a _very_ time consuming process, depending on the age of the OS and the quantity of updates released since the last service pack. You might want to do yourself a favor during development and disable this functionality, by commenting out the `WITH WINDOWS UPDATES` section and uncommenting the `WITHOUT WINDOWS UPDATES` section in `Autounattend.xml`:
-```
+```xml
+
+
+ cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\openssh.ps1 -AutoStart
+ Install OpenSSH
+ 99
+ true
+
+
+
+
+
```
Doing so will give you hours back in your day, which is a good thing.
@@ -55,17 +77,17 @@ If you are going to use the .box files produced by the project with Vagrant, you
### Getting Started
-Currently, this repo leverages trial versions of Windows 2008 R2 / 2012 / 2012 R2.
-
+Trial versions of Windows 2008 R2 / 2012 / 2012 R2 are used by default. These images can be used for 180 days without activation.
-Alternatively, if you have access to [MSDN](http://msdn.microsoft.com) or TechNet, you can download the ISO images Microsoft makes available there and place them in the `iso` directory. If you do so, you should update the relevent `.json` file, setting `iso_url` to `"./iso/.iso"` and `iso_checksum` to `` after following these instructions:
+Alternatively – if you have access to [MSDN](http://msdn.microsoft.com) or [TechNet](http://technet.microsoft.com/) – you can download retail or volume license ISO images and place them in the `iso` directory. If you do, you should update the relevent `.json` file, setting `iso_url` to `./iso/.iso` and `iso_checksum` to ``. For example, to use the Windows 2008 R2 (With SP1) retail ISO:
1. Download the Windows Server 2008 R2 with Service Pack 1 (x64) - DVD (English) ISO (`en_windows_server_2008_r2_with_sp1_x64_dvd_617601.iso`)
2. Verify that `en_windows_server_2008_r2_with_sp1_x64_dvd_617601.iso` has an MD5 hash of `8dcde01d0da526100869e2457aafb7ca` (Microsoft lists a SHA1 hash of `d3fd7bf85ee1d5bdd72de5b2c69a7b470733cd0a`, which is equivalent)
3. Clone this repo to a local directory
-4. Create a directory named `iso` in the root of the repo
-5. Move `en_windows_server_2008_r2_with_sp1_x64_dvd_617601.iso` to the `iso` directory
-6. Run `packer build windows_2008_r2.json`
+4. Move `en_windows_server_2008_r2_with_sp1_x64_dvd_617601.iso` to the `iso` directory
+5. Update `windows_2008_r2.json`, setting `iso_url` to `./iso/en_windows_server_2008_r2_with_sp1_x64_dvd_617601.iso`
+6. Update `windows_2008_r2.json`, setting `iso_checksum` to `8dcde01d0da526100869e2457aafb7ca`
+7. Run `packer build windows_2008_r2.json`
### Contributing
diff --git a/answer_files/2008_r2/Autounattend.xml b/answer_files/2008_r2/Autounattend.xml
index 7624b48d..dc59b184 100644
--- a/answer_files/2008_r2/Autounattend.xml
+++ b/answer_files/2008_r2/Autounattend.xml
@@ -1,268 +1,280 @@
-
-
-
-
-
-
-
- 1
- Primary
- 60000
-
-
-
-
- false
- NTFS
- C
- 1
- 1
-
-
-
- 0
- true
-
- OnError
-
-
- true
- Vagrant Administrator
- Vagrant Inc.
-
-
- Never
-
-
-
-
-
- 0
- 1
-
- OnError
- false
-
-
- /IMAGE/NAME
- Windows Server 2008 R2 SERVERSTANDARD
-
-
-
-
-
-
-
- en-US
-
- en-US
- en-US
- en-US
- en-US
- en-US
-
-
-
-
- false
-
-
-
-
-
-
- vagrant
- true
-
-
-
-
- vagrant
- true
-
- Vagrant User
- vagrant
- administrators
- vagrant
-
-
-
-
- true
- true
- Home
-
-
-
- vagrant
- true
-
- vagrant
- true
-
-
-
- cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"
- Set Execution Policy 64 Bit
- 1
- true
-
-
- C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"
- Set Execution Policy 32 Bit
- 2
- true
-
-
- cmd.exe /c winrm quickconfig -q
- winrm quickconfig -q
- 3
- true
-
-
- cmd.exe /c winrm quickconfig -transport:http
- winrm quickconfig -transport:http
- 4
- true
-
-
- cmd.exe /c winrm set winrm/config @{MaxTimeoutms="1800000"}
- Win RM MaxTimoutms
- 5
- true
-
-
- cmd.exe /c winrm set winrm/config/winrs @{MaxMemoryPerShellMB="300"}
- Win RM MaxMemoryPerShellMB
- 6
- true
-
-
- cmd.exe /c winrm set winrm/config/service @{AllowUnencrypted="true"}
- Win RM AllowUnencrypted
- 7
- true
-
-
- cmd.exe /c winrm set winrm/config/service/auth @{Basic="true"}
- Win RM auth Basic
- 8
- true
-
-
- cmd.exe /c winrm set winrm/config/client/auth @{Basic="true"}
- Win RM client auth Basic
- 9
- true
-
-
- cmd.exe /c winrm set winrm/config/listener?Address=*+Transport=HTTP @{Port="5985"}
- Win RM listener Address/Port
- 10
- true
-
-
- cmd.exe /c netsh advfirewall firewall set rule group="remote administration" new enable=yes
- Win RM adv firewall enable
- 11
- true
-
-
- cmd.exe /c netsh firewall add portopening TCP 5985 "Port 5985"
- Win RM port open
- 12
- true
-
-
- cmd.exe /c net stop winrm
- Stop Win RM Service
- 13
- true
-
-
- cmd.exe /c sc config winrm start=auto
- Win RM Autostart
- 14
- true
-
-
- cmd.exe /c net start winrm
- Start Win RM Service
- 15
- true
-
-
- %SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v HideFileExt /t REG_DWORD /d 0 /f
- 16
- Show file extensions in Explorer
-
-
- %SystemRoot%\System32\reg.exe ADD HKCU\Console /v QuickEdit /t REG_DWORD /d 1 /f
- 17
- Enable QuickEdit mode
-
-
- %SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v Start_ShowRun /t REG_DWORD /d 1 /f
- 18
- Show Run command in Start Menu
-
-
- %SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v StartMenuAdminTools /t REG_DWORD /d 1 /f
- 19
- Show Administrative Tools in Start Menu
-
-
- %SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateFileSizePercent /t REG_DWORD /d 0 /f
- 20
- Zero Hibernation File
-
-
- %SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateEnabled /t REG_DWORD /d 0 /f
- 21
- Disable Hibernation Mode
-
-
- cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\openssh.ps1
+
+
+
+
+
+
+
+ 1
+ Primary
+ 60000
+
+
+
+
+ false
+ NTFS
+ C
+ 1
+ 1
+
+
+
+ 0
+ true
+
+ OnError
+
+
+ true
+ Vagrant Administrator
+ Vagrant Inc.
+
+
+ Never
+
+
+
+
+
+ 0
+ 1
+
+ OnError
+ false
+
+
+ /IMAGE/NAME
+ Windows Server 2008 R2 SERVERSTANDARD
+
+
+
+
+
+
+
+ en-US
+
+ en-US
+ en-US
+ en-US
+ en-US
+ en-US
+
+
+
+
+ false
+
+
+
+
+
+
+ vagrant
+ true
+
+
+
+
+ vagrant
+ true
+
+ Vagrant User
+ vagrant
+ administrators
+ vagrant
+
+
+
+
+ true
+ true
+ Home
+
+
+
+ vagrant
+ true
+
+ vagrant
+ true
+
+
+
+ cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"
+ Set Execution Policy 64 Bit
+ 1
+ true
+
+
+ C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"
+ Set Execution Policy 32 Bit
+ 2
+ true
+
+
+ cmd.exe /c winrm quickconfig -q
+ winrm quickconfig -q
+ 3
+ true
+
+
+ cmd.exe /c winrm quickconfig -transport:http
+ winrm quickconfig -transport:http
+ 4
+ true
+
+
+ cmd.exe /c winrm set winrm/config @{MaxTimeoutms="1800000"}
+ Win RM MaxTimoutms
+ 5
+ true
+
+
+ cmd.exe /c winrm set winrm/config/winrs @{MaxMemoryPerShellMB="300"}
+ Win RM MaxMemoryPerShellMB
+ 6
+ true
+
+
+ cmd.exe /c winrm set winrm/config/service @{AllowUnencrypted="true"}
+ Win RM AllowUnencrypted
+ 7
+ true
+
+
+ cmd.exe /c winrm set winrm/config/service/auth @{Basic="true"}
+ Win RM auth Basic
+ 8
+ true
+
+
+ cmd.exe /c winrm set winrm/config/client/auth @{Basic="true"}
+ Win RM client auth Basic
+ 9
+ true
+
+
+ cmd.exe /c winrm set winrm/config/listener?Address=*+Transport=HTTP @{Port="5985"}
+ Win RM listener Address/Port
+ 10
+ true
+
+
+ cmd.exe /c netsh advfirewall firewall set rule group="remote administration" new enable=yes
+ Win RM adv firewall enable
+ 11
+ true
+
+
+ cmd.exe /c netsh firewall add portopening TCP 5985 "Port 5985"
+ Win RM port open
+ 12
+ true
+
+
+ cmd.exe /c net stop winrm
+ Stop Win RM Service
+ 13
+ true
+
+
+ cmd.exe /c sc config winrm start=auto
+ Win RM Autostart
+ 14
+ true
+
+
+ cmd.exe /c net start winrm
+ Start Win RM Service
+ 15
+ true
+
+
+ %SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v HideFileExt /t REG_DWORD /d 0 /f
+ 16
+ Show file extensions in Explorer
+
+
+ %SystemRoot%\System32\reg.exe ADD HKCU\Console /v QuickEdit /t REG_DWORD /d 1 /f
+ 17
+ Enable QuickEdit mode
+
+
+ %SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v Start_ShowRun /t REG_DWORD /d 1 /f
+ 18
+ Show Run command in Start Menu
+
+
+ %SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v StartMenuAdminTools /t REG_DWORD /d 1 /f
+ 19
+ Show Administrative Tools in Start Menu
+
+
+ %SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateFileSizePercent /t REG_DWORD /d 0 /f
+ 20
+ Zero Hibernation File
+
+
+ %SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateEnabled /t REG_DWORD /d 0 /f
+ 21
+ Disable Hibernation Mode
+
+
+
- vagrant-2008R2
- Pacific Standard Time
-
-
-
- true
-
-
-
- false
- false
-
-
- true
-
-
- true
-
-
-
+ -->
+
+
+
+ cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\openssh.ps1
+ Install OpenSSH
+ 99
+ true
+
+
+ cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\win-updates.ps1
+ Install Windows Updates
+ 100
+ true
+
+
+
+ false
+
+
+
+
+
+ false
+
+
+ vagrant-2008R2
+ Pacific Standard Time
+
+
+
+ true
+
+
+
+ false
+ false
+
+
+ true
+
+
+ true
+
+
+
diff --git a/answer_files/2012/Autounattend.xml b/answer_files/2012/Autounattend.xml
index 7e28e256..dc986410 100644
--- a/answer_files/2012/Autounattend.xml
+++ b/answer_files/2012/Autounattend.xml
@@ -228,18 +228,30 @@
21
Disable Hibernation Mode
-
+
+
+
+
+
cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\openssh.ps1
Install OpenSSH
99
true
-
+
cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\win-updates.ps1
Install Windows Updates
100
true
+
false
diff --git a/answer_files/2012_r2/Autounattend.xml b/answer_files/2012_r2/Autounattend.xml
index abc59770..e29695ee 100644
--- a/answer_files/2012_r2/Autounattend.xml
+++ b/answer_files/2012_r2/Autounattend.xml
@@ -225,7 +225,18 @@
21
Disable Hibernation Mode
-
+
+
+
+
+
cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\openssh.ps1
Install OpenSSH
99
@@ -237,6 +248,7 @@
100
true
+
true
diff --git a/scripts/openssh.ps1 b/scripts/openssh.ps1
index b7dc47e8..aef9176b 100644
--- a/scripts/openssh.ps1
+++ b/scripts/openssh.ps1
@@ -1,7 +1,7 @@
param (
[switch]$AutoStart = $false
)
-
+Write-Host "AutoStart: $AutoStart"
$is_64bit = [IntPtr]::size -eq 8
# setup openssh
diff --git a/windows_2008_r2.json b/windows_2008_r2.json
index a6410379..7066ad8b 100644
--- a/windows_2008_r2.json
+++ b/windows_2008_r2.json
@@ -1,11 +1,11 @@
{
"builders": [{
- "type": "vmware",
+ "type": "vmware-iso",
"iso_url": "http://care.dlservice.microsoft.com/dl/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",
"headless": true,
- "boot_wait": "5m",
+ "boot_wait": "2m",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_wait_timeout": "2h",
@@ -28,12 +28,12 @@
"scsi0.virtualDev": "lsisas1068"
}
}, {
- "type": "virtualbox",
+ "type": "virtualbox-iso",
"iso_url": "http://care.dlservice.microsoft.com/dl/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",
"headless": true,
- "boot_wait": "5m",
+ "boot_wait": "2m",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_wait_timeout": "2h",
diff --git a/windows_2012.json b/windows_2012.json
index f5bdc235..ee2a5323 100644
--- a/windows_2012.json
+++ b/windows_2012.json
@@ -1,11 +1,11 @@
{
"builders": [{
- "type": "vmware",
+ "type": "vmware-iso",
"iso_url": "http://care.dlservice.microsoft.com/dl/download/6/D/A/6DAB58BA-F939-451D-9101-7DE07DC09C03/9200.16384.WIN8_RTM.120725-1247_X64FRE_SERVER_EVAL_EN-US-HRM_SSS_X64FREE_EN-US_DV5.ISO",
"iso_checksum_type": "md5",
"iso_checksum": "8503997171f731d9bd1cb0b0edc31f3d",
"headless": true,
- "boot_wait": "5m",
+ "boot_wait": "2m",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_wait_timeout": "2h",
@@ -28,12 +28,12 @@
"scsi0.virtualDev": "lsisas1068"
}
}, {
- "type": "virtualbox",
+ "type": "virtualbox-iso",
"iso_url": "http://care.dlservice.microsoft.com/dl/download/6/D/A/6DAB58BA-F939-451D-9101-7DE07DC09C03/9200.16384.WIN8_RTM.120725-1247_X64FRE_SERVER_EVAL_EN-US-HRM_SSS_X64FREE_EN-US_DV5.ISO",
"iso_checksum_type": "md5",
"iso_checksum": "8503997171f731d9bd1cb0b0edc31f3d",
"headless": true,
- "boot_wait": "5m",
+ "boot_wait": "2m",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_wait_timeout": "2h",
diff --git a/windows_2012_r2.json b/windows_2012_r2.json
index 28e65529..116030ca 100644
--- a/windows_2012_r2.json
+++ b/windows_2012_r2.json
@@ -1,11 +1,11 @@
{
"builders": [{
- "type": "vmware",
+ "type": "vmware-iso",
"iso_url": "http://care.dlservice.microsoft.com/dl/download/6/2/A/62A76ABB-9990-4EFC-A4FE-C7D698DAEB96/9600.16384.WINBLUE_RTM.130821-1623_X64FRE_SERVER_EVAL_EN-US-IRM_SSS_X64FREE_EN-US_DV5.ISO",
"iso_checksum_type": "md5",
"iso_checksum": "458ff91f8abc21b75cb544744bf92e6a",
"headless": true,
- "boot_wait": "5m",
+ "boot_wait": "2m",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_wait_timeout": "2h",
@@ -28,12 +28,12 @@
"scsi0.virtualDev": "lsisas1068"
}
}, {
- "type": "virtualbox",
+ "type": "virtualbox-iso",
"iso_url": "http://care.dlservice.microsoft.com/dl/download/6/2/A/62A76ABB-9990-4EFC-A4FE-C7D698DAEB96/9600.16384.WINBLUE_RTM.130821-1623_X64FRE_SERVER_EVAL_EN-US-IRM_SSS_X64FREE_EN-US_DV5.ISO",
"iso_checksum_type": "md5",
"iso_checksum": "458ff91f8abc21b75cb544744bf92e6a",
"headless": true,
- "boot_wait": "5m",
+ "boot_wait": "2m",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_wait_timeout": "2h",