From 1603e2ca62e6affade864872f0caf9b20ad32acf Mon Sep 17 00:00:00 2001 From: Hippie Hacker Date: Mon, 18 Mar 2013 07:44:31 -0700 Subject: [PATCH 1/5] Changed default kickstart port so that vms can be build simultaneously --- definitions/windows-2008r2-standard/definition.rb | 4 +++- definitions/windows-7-enterprise/definition.rb | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/definitions/windows-2008r2-standard/definition.rb b/definitions/windows-2008r2-standard/definition.rb index 31a37278b..31dc7e185 100644 --- a/definitions/windows-2008r2-standard/definition.rb +++ b/definitions/windows-2008r2-standard/definition.rb @@ -8,7 +8,9 @@ :iso_download_instructions => "Download and install full featured software for 180-day trial at http://technet.microsoft.com/en-us/evalcenter/dd459137.aspx", :iso_src => iso_src, :iso_file => File.basename(iso_src), - :iso_md5 => "4263be2cf3c59177c45085c0a7bc6ca5" + :iso_md5 => "4263be2cf3c59177c45085c0a7bc6ca5", + :kickstart_port => "7150" + }) Veewee::Session.declare session diff --git a/definitions/windows-7-enterprise/definition.rb b/definitions/windows-7-enterprise/definition.rb index 8f0f4a30a..9b799bc24 100644 --- a/definitions/windows-7-enterprise/definition.rb +++ b/definitions/windows-7-enterprise/definition.rb @@ -8,7 +8,9 @@ :iso_download_instructions => "Download Windows 7 Enterprise 90-day Trial at http://technet.microsoft.com/en-us/evalcenter/cc442495.aspx", :iso_file => File.basename(iso_src), :iso_src => iso_src, - :iso_md5 => "1d0d239a252cb53e466d39e752b17c28" + :iso_md5 => "1d0d239a252cb53e466d39e752b17c28", + :kickstart_port => "7150" + }) Veewee::Session.declare session From f78790441114bca224566ea5db86ca3e8ebc88fc Mon Sep 17 00:00:00 2001 From: Hippie Hacker Date: Mon, 18 Mar 2013 07:44:49 -0700 Subject: [PATCH 2/5] Add windows 2012 and 8 --- .../windows-2012-standard/Autounattend.xml | 230 +++++++++++++++++ definitions/windows-2012-standard/README.md | 87 +++++++ .../windows-2012-standard/definition.rb | 17 ++ .../windows-2012-standard/install-chef.bat | 1 + .../windows-2012-standard/install-vbox.bat | 1 + .../mount-validation.bat | 1 + .../windows-2012-standard/oracle-cert.cer | 1 + .../windows-8-enterprise/Autounattend.xml | 235 ++++++++++++++++++ definitions/windows-8-enterprise/README.md | 87 +++++++ .../windows-8-enterprise/definition.rb | 15 ++ .../windows-8-enterprise/install-chef.bat | 1 + .../windows-8-enterprise/install-vbox.bat | 1 + .../windows-8-enterprise/mount-validation.bat | 1 + .../windows-8-enterprise/oracle-cert.cer | 1 + 14 files changed, 679 insertions(+) create mode 100644 definitions/windows-2012-standard/Autounattend.xml create mode 100644 definitions/windows-2012-standard/README.md create mode 100644 definitions/windows-2012-standard/definition.rb create mode 120000 definitions/windows-2012-standard/install-chef.bat create mode 120000 definitions/windows-2012-standard/install-vbox.bat create mode 120000 definitions/windows-2012-standard/mount-validation.bat create mode 120000 definitions/windows-2012-standard/oracle-cert.cer create mode 100644 definitions/windows-8-enterprise/Autounattend.xml create mode 100644 definitions/windows-8-enterprise/README.md create mode 100644 definitions/windows-8-enterprise/definition.rb create mode 120000 definitions/windows-8-enterprise/install-chef.bat create mode 120000 definitions/windows-8-enterprise/install-vbox.bat create mode 120000 definitions/windows-8-enterprise/mount-validation.bat create mode 120000 definitions/windows-8-enterprise/oracle-cert.cer diff --git a/definitions/windows-2012-standard/Autounattend.xml b/definitions/windows-2012-standard/Autounattend.xml new file mode 100644 index 000000000..3f3d0ef9f --- /dev/null +++ b/definitions/windows-2012-standard/Autounattend.xml @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + 1 + Primary + 20000 + + + + + + false + NTFS + C + 1 + 1 + + + + + 0 + true + + + OnError + + + + + YC6KT-GKW9T-YTKYR-T4X34-R7VHC + Never + + + true + Vagrant Fullname + Vagrant Inc + + + + + + 0 + 1 + + OnError + false + + + /IMAGE/NAME + Windows Server 2008 R2 SERVERSTANDARD + + + + + + + + + + en-US + + en-US + en-US + en-US + en-US + en-US + + + + + + + + + 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>administrator</Username> + <Enabled>true</Enabled> + </AutoLogon> + <FirstLogonCommands> + <!-- <SynchronousCommand wcm:action="add"> --> + <!-- <CommandLine>cmd.exe /c a:install-cygwin-sshd.bat</CommandLine> --> + <!-- <Description>Install Cygwin SSH</Description> --> + <!-- <Order>1</Order> --> + <!-- <RequiresUserInput>true</RequiresUserInput> --> + <!-- </SynchronousCommand> --> + <!-- <SynchronousCommand wcm:action="add"> --> + <!-- <CommandLine>cmd.exe /c a:install-winrm.bat</CommandLine> --> + <!-- <Description>Install Win RM</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>1</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>2</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>3</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>4</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>5</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>6</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 auth Basic</Description> + <Order>7</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>8</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>9</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>10</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c net stop winrm </CommandLine> + <Description>Stop Win RM Service </Description> + <Order>11</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>12</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c net start winrm </CommandLine> + <Description>Start Win RM Service</Description> + <Order>13</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> + <Description>Start Win RM Service</Description> + <Order>14</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></RegisteredOwner> + </component> + <component name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <SkipAutoActivation>true</SkipAutoActivation> + </component> + </settings> + <cpi:offlineImage cpi:source="catalog:d:/sources/install_windows server 2008 r2 serverdatacenter.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" /> +</unattend> diff --git a/definitions/windows-2012-standard/README.md b/definitions/windows-2012-standard/README.md new file mode 100644 index 000000000..be39b6e15 --- /dev/null +++ b/definitions/windows-2012-standard/README.md @@ -0,0 +1,87 @@ +You can download a free trial of Windows Server 2008 R2 with Service Pack 1 from two different locations manually: + +* url: http://technet.microsoft.com/en-us/evalcenter/dd459137.aspx +* url: http://msdn.microsoft.com/en-us/evalcenter/ee175713.aspx + +But they seem to always generate the same url of 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 + +* 64bit +* filename: 7601.17514.101119-1850_x64fre_server_eval_en-us-GRMSXEVAL_EN_DVD.iso +* md5sum: 4263be2cf3c59177c45085c0a7bc6ca5 + + +The installation uses the Standard Windows Unattended installation. The XML file was created using the Windows AIK kit, but the file can also be edited by hand. + +To edit the Autounattend.xml and validate it you can download The Windows® Automated Installation Kit (AIK) for Windows® 7: + +* url: http://www.microsoft.com/download/en/details.aspx?id=5753 +* file: KB3AIK_EN.iso +* md5sum: 1e73b24a89eceab9d50585b92db5482f + +AIK also includes dism, which will allow you to choose a specific version: + +If you want to install a different version, edit Autoattended.xml and replace the /IMAGE/NAME value with +one of the names listed in the 2008r2 install.wim on the install DVD .iso + + +```xml +<InstallFrom> + <MetaData wcm:action="add"> + <Key>/IMAGE/NAME</Key> + <Value>Windows Server 2008 R2 SERVERSTANDARD</Value> + </MetaData> +</InstallFrom> +``` + + +``` +PS C:\Users\Administrator> Dism /Get-WIMInfo /WimFile:d:\sources\install.wim + +Deployment Image Servicing and Management tool +Version: 6.1.7600.16385 + +Details for image : d:\sources\install.wim + +Index : 1 +Name : Windows Server 2008 R2 SERVERSTANDARD +Description : Windows Server 2008 R2 SERVERSTANDARD +Size : 10,510,643,622 bytes + +Index : 2 +Name : Windows Server 2008 R2 SERVERSTANDARDCORE +Description : Windows Server 2008 R2 SERVERSTANDARDCORE +Size : 3,564,132,307 bytes + +Index : 3 +Name : Windows Server 2008 R2 SERVERENTERPRISE +Description : Windows Server 2008 R2 SERVERENTERPRISE +Size : 10,511,024,733 bytes + +Index : 4 +Name : Windows Server 2008 R2 SERVERENTERPRISECORE +Description : Windows Server 2008 R2 SERVERENTERPRISECORE +Size : 3,564,106,331 bytes + +Index : 5 +Name : Windows Server 2008 R2 SERVERDATACENTER +Description : Windows Server 2008 R2 SERVERDATACENTER +Size : 10,511,131,897 bytes + +Index : 6 +Name : Windows Server 2008 R2 SERVERDATACENTERCORE +Description : Windows Server 2008 R2 SERVERDATACENTERCORE +Size : 3,564,144,547 bytes + +Index : 7 +Name : Windows Server 2008 R2 SERVERWEB +Description : Windows Server 2008 R2 SERVERWEB +Size : 10,520,222,743 bytes + +Index : 8 +Name : Windows Server 2008 R2 SERVERWEBCORE +Description : Windows Server 2008 R2 SERVERWEBCORE +Size : 3,562,750,400 bytes + +The operation completed successfully. +``` + diff --git a/definitions/windows-2012-standard/definition.rb b/definitions/windows-2012-standard/definition.rb new file mode 100644 index 000000000..552e58708 --- /dev/null +++ b/definitions/windows-2012-standard/definition.rb @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- +require File.dirname(__FILE__) + "/../.windows/session.rb" + +iso_src = "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" + +session = WINDOWS_SESSION.merge({ + :os_type_id => 'Windows2008_64', + :iso_download_instructions => "Download and install full featured software for 180-day trial at http://technet.microsoft.com/en-us/evalcenter/dd459137.aspx", + :iso_src => iso_src, + :iso_file => File.basename(iso_src), + :iso_md5 => "4263be2cf3c59177c45085c0a7bc6ca5", + :kickstart_port => "7140" + }) + +Veewee::Session.declare session + + diff --git a/definitions/windows-2012-standard/install-chef.bat b/definitions/windows-2012-standard/install-chef.bat new file mode 120000 index 000000000..0494fd4af --- /dev/null +++ b/definitions/windows-2012-standard/install-chef.bat @@ -0,0 +1 @@ +../.windows/install-chef.bat \ No newline at end of file diff --git a/definitions/windows-2012-standard/install-vbox.bat b/definitions/windows-2012-standard/install-vbox.bat new file mode 120000 index 000000000..2ff5531e3 --- /dev/null +++ b/definitions/windows-2012-standard/install-vbox.bat @@ -0,0 +1 @@ +../.windows/install-vbox.bat \ No newline at end of file diff --git a/definitions/windows-2012-standard/mount-validation.bat b/definitions/windows-2012-standard/mount-validation.bat new file mode 120000 index 000000000..e137688e8 --- /dev/null +++ b/definitions/windows-2012-standard/mount-validation.bat @@ -0,0 +1 @@ +../.windows/mount-validation.bat \ No newline at end of file diff --git a/definitions/windows-2012-standard/oracle-cert.cer b/definitions/windows-2012-standard/oracle-cert.cer new file mode 120000 index 000000000..5fbb0d341 --- /dev/null +++ b/definitions/windows-2012-standard/oracle-cert.cer @@ -0,0 +1 @@ +../.windows/oracle-cert.cer \ No newline at end of file diff --git a/definitions/windows-8-enterprise/Autounattend.xml b/definitions/windows-8-enterprise/Autounattend.xml new file mode 100644 index 000000000..6d0aa0962 --- /dev/null +++ b/definitions/windows-8-enterprise/Autounattend.xml @@ -0,0 +1,235 @@ +<?xml version="1.0" encoding="utf-8"?> +<unattend xmlns="urn:schemas-microsoft-com:unattend"> + <servicing></servicing> + + <settings pass="windowsPE"> + + <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <DiskConfiguration> + <Disk wcm:action="add"> + + <CreatePartitions> + <CreatePartition wcm:action="add"> + <Order>1</Order> + <Type>Primary</Type> + <Size>20000</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> + <!-- Product Key from http://technet.microsoft.com/en-us/library/ff793406.aspx --> + <ProductKey>YC6KT-GKW9T-YTKYR-T4X34-R7VHC + <WillShowUI>Never</WillShowUI> + </ProductKey> + + <AcceptEula>true</AcceptEula> + <FullName>Vagrant Fullname</FullName> + <Organization>Vagrant Inc</Organization> + </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 8 Enterprise Evaluation</Value> + </MetaData> + </InstallFrom> + </OSImage> + </ImageInstall> + + </component> + + <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <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="oobeSystem"> + <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <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> + <ProtectYourPC>1</ProtectYourPC> + <HideOnlineAccountScreens>true</HideOnlineAccountScreens> + <HideLocalAccountScreen>true</HideLocalAccountScreen> + <SkipUserOOBE>true</SkipUserOOBE> + <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen> + </OOBE> + <AutoLogon> + <Password> + <Value>vagrant</Value> + <PlainText>true</PlainText> + </Password> + <Username>administrator</Username> + <Enabled>true</Enabled> + </AutoLogon> + <FirstLogonCommands> + <!-- <SynchronousCommand wcm:action="add"> --> + <!-- <CommandLine>cmd.exe /c a:install-cygwin-sshd.bat</CommandLine> --> + <!-- <Description>Install Cygwin SSH</Description> --> + <!-- <Order>1</Order> --> + <!-- <RequiresUserInput>true</RequiresUserInput> --> + <!-- </SynchronousCommand> --> + <!-- <SynchronousCommand wcm:action="add"> --> + <!-- <CommandLine>cmd.exe /c a:install-winrm.bat</CommandLine> --> + <!-- <Description>Install Win RM</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>1</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>2</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>3</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>4</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>5</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>6</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 auth Basic</Description> + <Order>7</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>8</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>9</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>10</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c net stop winrm </CommandLine> + <Description>Stop Win RM Service </Description> + <Order>11</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>12</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c net start winrm </CommandLine> + <Description>Start Win RM Service</Description> + <Order>13</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> + <Description>Start Win RM Service</Description> + <Order>14</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></RegisteredOwner> + </component> + <component name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <SkipAutoActivation>true</SkipAutoActivation> + </component> + </settings> + <cpi:offlineImage cpi:source="catalog:d:/sources/install_windows server 2008 r2 serverdatacenter.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" /> +</unattend> diff --git a/definitions/windows-8-enterprise/README.md b/definitions/windows-8-enterprise/README.md new file mode 100644 index 000000000..be39b6e15 --- /dev/null +++ b/definitions/windows-8-enterprise/README.md @@ -0,0 +1,87 @@ +You can download a free trial of Windows Server 2008 R2 with Service Pack 1 from two different locations manually: + +* url: http://technet.microsoft.com/en-us/evalcenter/dd459137.aspx +* url: http://msdn.microsoft.com/en-us/evalcenter/ee175713.aspx + +But they seem to always generate the same url of 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 + +* 64bit +* filename: 7601.17514.101119-1850_x64fre_server_eval_en-us-GRMSXEVAL_EN_DVD.iso +* md5sum: 4263be2cf3c59177c45085c0a7bc6ca5 + + +The installation uses the Standard Windows Unattended installation. The XML file was created using the Windows AIK kit, but the file can also be edited by hand. + +To edit the Autounattend.xml and validate it you can download The Windows® Automated Installation Kit (AIK) for Windows® 7: + +* url: http://www.microsoft.com/download/en/details.aspx?id=5753 +* file: KB3AIK_EN.iso +* md5sum: 1e73b24a89eceab9d50585b92db5482f + +AIK also includes dism, which will allow you to choose a specific version: + +If you want to install a different version, edit Autoattended.xml and replace the /IMAGE/NAME value with +one of the names listed in the 2008r2 install.wim on the install DVD .iso + + +```xml +<InstallFrom> + <MetaData wcm:action="add"> + <Key>/IMAGE/NAME</Key> + <Value>Windows Server 2008 R2 SERVERSTANDARD</Value> + </MetaData> +</InstallFrom> +``` + + +``` +PS C:\Users\Administrator> Dism /Get-WIMInfo /WimFile:d:\sources\install.wim + +Deployment Image Servicing and Management tool +Version: 6.1.7600.16385 + +Details for image : d:\sources\install.wim + +Index : 1 +Name : Windows Server 2008 R2 SERVERSTANDARD +Description : Windows Server 2008 R2 SERVERSTANDARD +Size : 10,510,643,622 bytes + +Index : 2 +Name : Windows Server 2008 R2 SERVERSTANDARDCORE +Description : Windows Server 2008 R2 SERVERSTANDARDCORE +Size : 3,564,132,307 bytes + +Index : 3 +Name : Windows Server 2008 R2 SERVERENTERPRISE +Description : Windows Server 2008 R2 SERVERENTERPRISE +Size : 10,511,024,733 bytes + +Index : 4 +Name : Windows Server 2008 R2 SERVERENTERPRISECORE +Description : Windows Server 2008 R2 SERVERENTERPRISECORE +Size : 3,564,106,331 bytes + +Index : 5 +Name : Windows Server 2008 R2 SERVERDATACENTER +Description : Windows Server 2008 R2 SERVERDATACENTER +Size : 10,511,131,897 bytes + +Index : 6 +Name : Windows Server 2008 R2 SERVERDATACENTERCORE +Description : Windows Server 2008 R2 SERVERDATACENTERCORE +Size : 3,564,144,547 bytes + +Index : 7 +Name : Windows Server 2008 R2 SERVERWEB +Description : Windows Server 2008 R2 SERVERWEB +Size : 10,520,222,743 bytes + +Index : 8 +Name : Windows Server 2008 R2 SERVERWEBCORE +Description : Windows Server 2008 R2 SERVERWEBCORE +Size : 3,562,750,400 bytes + +The operation completed successfully. +``` + diff --git a/definitions/windows-8-enterprise/definition.rb b/definitions/windows-8-enterprise/definition.rb new file mode 100644 index 000000000..63ecdbbf3 --- /dev/null +++ b/definitions/windows-8-enterprise/definition.rb @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +require File.dirname(__FILE__) + "/../.windows/session.rb" + +iso_src = "http://care.dlservice.microsoft.com/dl/download/5/3/C/53C31ED0-886C-4F81-9A38-F58CE4CE71E8/9200.16384.WIN8_RTM.120725-1247_X64FRE_ENTERPRISE_EVAL_EN-US-HRM_CENA_X64FREE_EN-US_DV5.ISO" + +session = WINDOWS_SESSION.merge({ + :os_type_id => 'Windows8_64', + :iso_download_instructions => "Download Windows 8 Enterprise 90-day Trial at http://msdn.microsoft.com/en-us/evalcenter/jj554510.aspx", + :iso_file => File.basename(iso_src), + :iso_src => iso_src, + :iso_md5 => "6beffd994574ca89417286f0dc056108", + :memory_size=> "512" + }) + +Veewee::Session.declare session diff --git a/definitions/windows-8-enterprise/install-chef.bat b/definitions/windows-8-enterprise/install-chef.bat new file mode 120000 index 000000000..0494fd4af --- /dev/null +++ b/definitions/windows-8-enterprise/install-chef.bat @@ -0,0 +1 @@ +../.windows/install-chef.bat \ No newline at end of file diff --git a/definitions/windows-8-enterprise/install-vbox.bat b/definitions/windows-8-enterprise/install-vbox.bat new file mode 120000 index 000000000..2ff5531e3 --- /dev/null +++ b/definitions/windows-8-enterprise/install-vbox.bat @@ -0,0 +1 @@ +../.windows/install-vbox.bat \ No newline at end of file diff --git a/definitions/windows-8-enterprise/mount-validation.bat b/definitions/windows-8-enterprise/mount-validation.bat new file mode 120000 index 000000000..e137688e8 --- /dev/null +++ b/definitions/windows-8-enterprise/mount-validation.bat @@ -0,0 +1 @@ +../.windows/mount-validation.bat \ No newline at end of file diff --git a/definitions/windows-8-enterprise/oracle-cert.cer b/definitions/windows-8-enterprise/oracle-cert.cer new file mode 120000 index 000000000..5fbb0d341 --- /dev/null +++ b/definitions/windows-8-enterprise/oracle-cert.cer @@ -0,0 +1 @@ +../.windows/oracle-cert.cer \ No newline at end of file From 845f8776c32ece9aff82f6fb384339ca5bca9453 Mon Sep 17 00:00:00 2001 From: Hippie Hacker <chris@hippiehacker.org> Date: Mon, 18 Mar 2013 07:45:17 -0700 Subject: [PATCH 3/5] Added timeout before installing chef (mainly for windows 8) --- definitions/.windows/install-chef.bat | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/definitions/.windows/install-chef.bat b/definitions/.windows/install-chef.bat index c90bfb677..eea2e3842 100644 --- a/definitions/.windows/install-chef.bat +++ b/definitions/.windows/install-chef.bat @@ -1,2 +1,6 @@ -cmd /C cscript %TEMP%\wget.vbs /url:http://www.opscode.com/chef/install.msi /path:%TEMP%\chef-client.msi -cmd /C msiexec /qn /i %TEMP%\chef-client.msi +timeout 10 +REM sleeping to give outbound networking a chance to come up +cmd /C cscript wget.vbs /url:http://www.opscode.com/chef/install.msi /path:chef-client.msi +cmd /C msiexec /qn /i chef-client.msi + + From 6c68f96a0506936ea6fb7a31dfd125d4b2f8d0a1 Mon Sep 17 00:00:00 2001 From: Hippie Hacker <chris@hippiehacker.org> Date: Mon, 18 Mar 2013 07:45:43 -0700 Subject: [PATCH 4/5] Don't reboot imediately, on really fast machines it causes winrm error --- definitions/.windows/install-vbox.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/definitions/.windows/install-vbox.bat b/definitions/.windows/install-vbox.bat index e5ccc4402..bd4035137 100644 --- a/definitions/.windows/install-vbox.bat +++ b/definitions/.windows/install-vbox.bat @@ -2,5 +2,5 @@ REM with this, we can open the iso, and extract the VBoxWindowsAdditions.exe! REM http://downloads.sourceforge.net/sevenzip/7z920.exe cmd /c certutil -addstore -f "TrustedPublisher" a:oracle-cert.cer cmd /c e:\VBoxWindowsAdditions-amd64.exe /S -cmd /c shutdown.exe /r /t 0 /d p:2:4 /c "Vagrant reboot for VBoxWindowsAdditions" +cmd /c shutdown.exe /r /t 5 /d p:2:4 /c "Vagrant reboot for VBoxWindowsAdditions" From c756eb142b0ee42c2768bb96197adc3024aa5904 Mon Sep 17 00:00:00 2001 From: Hippie Hacker <chris@hippiehacker.org> Date: Mon, 18 Mar 2013 07:46:15 -0700 Subject: [PATCH 5/5] mount validation fails on some oses... wait for veewee validation to try --- definitions/.windows/mount-validation.bat | 2 +- definitions/.windows/session.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/definitions/.windows/mount-validation.bat b/definitions/.windows/mount-validation.bat index c58d832c3..ae458c1d6 100644 --- a/definitions/.windows/mount-validation.bat +++ b/definitions/.windows/mount-validation.bat @@ -1,3 +1,3 @@ -REM This is so we can pass the validation test +REM This is so we can pass the validation test... I don't know that it's necessary cmd /c net use z: \\vboxsrv\veewee-validation diff --git a/definitions/.windows/session.rb b/definitions/.windows/session.rb index 182b0b95d..f639f260d 100644 --- a/definitions/.windows/session.rb +++ b/definitions/.windows/session.rb @@ -12,7 +12,7 @@ :postinstall_files => [ "install-chef.bat", "install-vbox.bat", # would be interesting to only include this on vbox - "mount-validation.bat" # maybe test if we are within a vbox vm? + # "mount-validation.bat" # maybe test if we are within a vbox vm? # because this will eventually run on kvm, openstack, etc etc ], :video_memory_size => '48',