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</PlainText> - </AdministratorPassword> - <LocalAccounts> - <LocalAccount wcm:action="add"> - <Password> - <Value>vagrant</Value> - <PlainText>true</PlainText> - </Password> - <Description>Vagrant User</Description> - <DisplayName>vagrant</DisplayName> - <Group>administrators</Group> - <Name>vagrant</Name> - </LocalAccount> - </LocalAccounts> - </UserAccounts> - <OOBE> - <HideEULAPage>true</HideEULAPage> - <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> - <NetworkLocation>Home</NetworkLocation> - </OOBE> - <AutoLogon> - <Password> - <Value>vagrant</Value> - <PlainText>true</PlainText> - </Password> - <Username>vagrant</Username> - <Enabled>true</Enabled> - </AutoLogon> - <FirstLogonCommands> - <SynchronousCommand wcm:action="add"> - <CommandLine>cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> - <Description>Set Execution Policy 64 Bit</Description> - <Order>1</Order> - <RequiresUserInput>true</RequiresUserInput> - </SynchronousCommand> - <SynchronousCommand wcm:action="add"> - <CommandLine>C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> - <Description>Set Execution Policy 32 Bit</Description> - <Order>2</Order> - <RequiresUserInput>true</RequiresUserInput> - </SynchronousCommand> - <SynchronousCommand wcm:action="add"> - <CommandLine>cmd.exe /c winrm quickconfig -q</CommandLine> - <Description>winrm quickconfig -q</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> - <Order>5</Order> - <RequiresUserInput>true</RequiresUserInput> - </SynchronousCommand> - <SynchronousCommand wcm:action="add"> - <CommandLine>cmd.exe /c winrm set winrm/config/winrs @{MaxMemoryPerShellMB="300"}</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>16</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>17</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>18</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>19</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>20</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>21</Order> - <Description>Disable Hibernation Mode</Description> - </SynchronousCommand> - <SynchronousCommand wcm:action="add"> - <CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\openssh.ps1</CommandLine> + <servicing/> + <settings pass="windowsPE"> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <DiskConfiguration> + <Disk wcm:action="add"> + <CreatePartitions> + <CreatePartition wcm:action="add"> + <Order>1</Order> + <Type>Primary</Type> + <Size>60000</Size> + </CreatePartition> + </CreatePartitions> + <ModifyPartitions> + <ModifyPartition wcm:action="add"> + <Extend>false</Extend> + <Format>NTFS</Format> + <Letter>C</Letter> + <Order>1</Order> + <PartitionID>1</PartitionID> + <Label>Windows 2008R2</Label> + </ModifyPartition> + </ModifyPartitions> + <DiskID>0</DiskID> + <WillWipeDisk>true</WillWipeDisk> + </Disk> + <WillShowUI>OnError</WillShowUI> + </DiskConfiguration> + <UserData> + <AcceptEula>true</AcceptEula> + <FullName>Vagrant Administrator</FullName> + <Organization>Vagrant Inc.</Organization> + <!-- Product Key from http://technet.microsoft.com/en-us/library/ff793406.aspx --> + <ProductKey> + <WillShowUI>Never</WillShowUI> + </ProductKey> + </UserData> + <ImageInstall> + <OSImage> + <InstallTo> + <DiskID>0</DiskID> + <PartitionID>1</PartitionID> + </InstallTo> + <WillShowUI>OnError</WillShowUI> + <InstallToAvailablePartition>false</InstallToAvailablePartition> + <InstallFrom> + <MetaData wcm:action="add"> + <Key>/IMAGE/NAME</Key> + <Value>Windows Server 2008 R2 SERVERSTANDARD</Value> + </MetaData> + </InstallFrom> + </OSImage> + </ImageInstall> + </component> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <SetupUILanguage> + <UILanguage>en-US</UILanguage> + </SetupUILanguage> + <InputLocale>en-US</InputLocale> + <SystemLocale>en-US</SystemLocale> + <UILanguage>en-US</UILanguage> + <UILanguageFallback>en-US</UILanguageFallback> + <UserLocale>en-US</UserLocale> + </component> + </settings> + <settings pass="offlineServicing"> + <component name="Microsoft-Windows-LUA-Settings" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <EnableLUA>false</EnableLUA> + </component> + </settings> + <settings pass="oobeSystem"> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <UserAccounts> + <AdministratorPassword> + <Value>vagrant</Value> + <PlainText>true</PlainText> + </AdministratorPassword> + <LocalAccounts> + <LocalAccount wcm:action="add"> + <Password> + <Value>vagrant</Value> + <PlainText>true</PlainText> + </Password> + <Description>Vagrant User</Description> + <DisplayName>vagrant</DisplayName> + <Group>administrators</Group> + <Name>vagrant</Name> + </LocalAccount> + </LocalAccounts> + </UserAccounts> + <OOBE> + <HideEULAPage>true</HideEULAPage> + <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> + <NetworkLocation>Home</NetworkLocation> + </OOBE> + <AutoLogon> + <Password> + <Value>vagrant</Value> + <PlainText>true</PlainText> + </Password> + <Username>vagrant</Username> + <Enabled>true</Enabled> + </AutoLogon> + <FirstLogonCommands> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> + <Description>Set Execution Policy 64 Bit</Description> + <Order>1</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> + <Description>Set Execution Policy 32 Bit</Description> + <Order>2</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm quickconfig -q</CommandLine> + <Description>winrm quickconfig -q</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> + <Order>5</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm set winrm/config/winrs @{MaxMemoryPerShellMB="300"}</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>16</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>17</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>18</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>19</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>20</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>21</Order> + <Description>Disable Hibernation Mode</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> <Order>99</Order> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> - <SynchronousCommand wcm:action="add"> - <CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\win-updates.ps1</CommandLine> - <Description>Install Windows Updates</Description> - <Order>100</Order> - <RequiresUserInput>true</RequiresUserInput> - </SynchronousCommand> - </FirstLogonCommands> - <ShowWindowsLive>false</ShowWindowsLive> - </component> - </settings> - <settings pass="specialize"> - <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> - <OEMInformation> - <HelpCustomized>false</HelpCustomized> - </OEMInformation> - <!-- Rename computer here. --> - <ComputerName>vagrant-2008R2</ComputerName> - <TimeZone>Pacific Standard Time</TimeZone> - <RegisteredOwner/> - </component> - <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> - <DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon> - </component> - <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-IE-ESC" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> - <!-- Disable IE ESC. --> - <IEHardenAdmin>false</IEHardenAdmin> - <IEHardenUser>false</IEHardenUser> - </component> - <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> - <DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon> - </component> - <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> - <SkipAutoActivation>true</SkipAutoActivation> - </component> - </settings> - <cpi:offlineImage xmlns:cpi="urn:schemas-microsoft-com:cpi" cpi:source="catalog:d:/sources/install_windows server 2008 r2 serverdatacenter.clg"/> + --> + <!-- END WITHOUT WINDOWS UPDATES --> + <!-- WITH WINDOWS UPDATES --> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\openssh.ps1</CommandLine> + <Description>Install OpenSSH</Description> + <Order>99</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\win-updates.ps1</CommandLine> + <Description>Install Windows Updates</Description> + <Order>100</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <!-- END WITH WINDOWS UPDATES --> + </FirstLogonCommands> + <ShowWindowsLive>false</ShowWindowsLive> + </component> + </settings> + <settings pass="specialize"> + <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <OEMInformation> + <HelpCustomized>false</HelpCustomized> + </OEMInformation> + <!-- Rename computer here. --> + <ComputerName>vagrant-2008R2</ComputerName> + <TimeZone>Pacific Standard Time</TimeZone> + <RegisteredOwner/> + </component> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon> + </component> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-IE-ESC" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <!-- Disable IE ESC. --> + <IEHardenAdmin>false</IEHardenAdmin> + <IEHardenUser>false</IEHardenUser> + </component> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon> + </component> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <SkipAutoActivation>true</SkipAutoActivation> + </component> + </settings> + <cpi:offlineImage xmlns:cpi="urn:schemas-microsoft-com:cpi" cpi:source="catalog:d:/sources/install_windows server 2008 r2 serverdatacenter.clg"/> </unattend> 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 @@ <Order>21</Order> <Description>Disable Hibernation Mode</Description> </SynchronousCommand> - <SynchronousCommand wcm:action="add"> + <!-- 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> + <Order>99</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + --> + <!-- END WITHOUT WINDOWS UPDATES --> + <!-- WITH WINDOWS UPDATES --> + <SynchronousCommand wcm:action="add"> <CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\openssh.ps1</CommandLine> <Description>Install OpenSSH</Description> <Order>99</Order> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> - <SynchronousCommand wcm:action="add"> + <SynchronousCommand wcm:action="add"> <CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\win-updates.ps1</CommandLine> <Description>Install Windows Updates</Description> <Order>100</Order> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> + <!-- END WITH WINDOWS UPDATES --> </FirstLogonCommands> <ShowWindowsLive>false</ShowWindowsLive> </component> 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 @@ <Order>21</Order> <Description>Disable Hibernation Mode</Description> </SynchronousCommand> - <SynchronousCommand wcm:action="add"> + <!-- 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> + <Order>99</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + --> + <!-- END WITHOUT WINDOWS UPDATES --> + <!-- WITH WINDOWS UPDATES --> + <SynchronousCommand wcm:action="add"> <CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\openssh.ps1</CommandLine> <Description>Install OpenSSH</Description> <Order>99</Order> @@ -237,6 +248,7 @@ <Order>100</Order> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> + <!-- END WITH WINDOWS UPDATES --> </FirstLogonCommands> <OOBE> <HideEULAPage>true</HideEULAPage> 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",