From 44aa385b7e26ec63f1a767f03f0057e988b63dcd Mon Sep 17 00:00:00 2001 From: Hippie Hacker Date: Fri, 15 Mar 2013 15:46:33 -0700 Subject: [PATCH 1/3] windows 8+2012 --- definitions/.windows/install-chef.bat | 8 +- definitions/.windows/install-vbox.bat | 2 +- definitions/.windows/mount-validation.bat | 2 +- definitions/.windows/session.rb | 2 +- .../windows-2008r2-standard/definition.rb | 4 +- .../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-7-enterprise/definition.rb | 4 +- .../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 + 20 files changed, 694 insertions(+), 7 deletions(-) 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/install-chef.bat b/definitions/.windows/install-chef.bat index c90bfb677..0c255a2b1 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 networkingh a chance to come up +cmd /C cscript wget.vbs /url:http://10.12.13.1/chef-client-11.4.0-18-gdf096fa-1.windows.msi /path:chef-client.msi +cmd /C msiexec /qn /i chef-client.msi +timeout 120 + diff --git a/definitions/.windows/install-vbox.bat b/definitions/.windows/install-vbox.bat index 8c34e3683..b28b58d3e 100644 --- a/definitions/.windows/install-vbox.bat +++ b/definitions/.windows/install-vbox.bat @@ -2,5 +2,5 @@ # 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" diff --git a/definitions/.windows/mount-validation.bat b/definitions/.windows/mount-validation.bat index e71179906..ae458c1d6 100644 --- a/definitions/.windows/mount-validation.bat +++ b/definitions/.windows/mount-validation.bat @@ -1,3 +1,3 @@ -# 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', 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-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-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 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 d7e0dd656a67f3b0c2db8347bb5ffe36eb13fa07 Mon Sep 17 00:00:00 2001 From: Hippie Hacker <chris@hippiehacker.org> Date: Fri, 22 Mar 2013 11:43:37 -0700 Subject: [PATCH 2/3] Updates for windows-8 and windows-2012 --- definitions/windows-2008r2-standard/definition.rb | 1 + definitions/windows-2012-standard/Autounattend.xml | 11 ++++++++--- definitions/windows-2012-standard/definition.rb | 14 +++++++++----- definitions/windows-7-enterprise/definition.rb | 2 +- definitions/windows-8-enterprise/Autounattend.xml | 4 ++-- definitions/windows-8-enterprise/definition.rb | 2 ++ 6 files changed, 23 insertions(+), 11 deletions(-) diff --git a/definitions/windows-2008r2-standard/definition.rb b/definitions/windows-2008r2-standard/definition.rb index 31dc7e185..fc9784dac 100644 --- a/definitions/windows-2008r2-standard/definition.rb +++ b/definitions/windows-2008r2-standard/definition.rb @@ -9,6 +9,7 @@ :iso_src => iso_src, :iso_file => File.basename(iso_src), :iso_md5 => "4263be2cf3c59177c45085c0a7bc6ca5", + :winrm_host_port => "2008", :kickstart_port => "7150" }) diff --git a/definitions/windows-2012-standard/Autounattend.xml b/definitions/windows-2012-standard/Autounattend.xml index 3f3d0ef9f..6de7ff759 100644 --- a/definitions/windows-2012-standard/Autounattend.xml +++ b/definitions/windows-2012-standard/Autounattend.xml @@ -24,7 +24,7 @@ <Letter>C</Letter> <Order>1</Order> <PartitionID>1</PartitionID> - <Label>Windows 2008R2</Label> + <Label>Windows 2012</Label> </ModifyPartition> </ModifyPartitions> @@ -57,7 +57,7 @@ <InstallFrom> <MetaData wcm:action="add"> <Key>/IMAGE/NAME</Key> - <Value>Windows Server 2008 R2 SERVERSTANDARD</Value> + <Value>Windows Server 2012 SERVERSTANDARD</Value> </MetaData> </InstallFrom> </OSImage> @@ -102,6 +102,11 @@ <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> @@ -218,7 +223,7 @@ <HelpCustomized>false</HelpCustomized> </OEMInformation> <!-- Rename computer here. --> - <ComputerName>vagrant-2008R2</ComputerName> + <ComputerName>vagrant-2012</ComputerName> <TimeZone>Pacific Standard Time</TimeZone> <RegisteredOwner></RegisteredOwner> </component> diff --git a/definitions/windows-2012-standard/definition.rb b/definitions/windows-2012-standard/definition.rb index 552e58708..8362fdaac 100644 --- a/definitions/windows-2012-standard/definition.rb +++ b/definitions/windows-2012-standard/definition.rb @@ -1,15 +1,19 @@ # -*- 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" +iso_src ="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" +#"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?lcid=1033&cprod=winsvr2012rtmisotn" +#"http://care.dlservice.microsoft.com/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" 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", + :os_type_id => 'Windows8_64', + :iso_download_instructions => "Download and install full featured software for 180-day trial at http://technet.microsoft.com/en-US/evalcenter/hh670538.aspx", :iso_src => iso_src, :iso_file => File.basename(iso_src), - :iso_md5 => "4263be2cf3c59177c45085c0a7bc6ca5", - :kickstart_port => "7140" + :iso_md5 => "8503997171f731d9bd1cb0b0edc31f3d", + :kickstart_port => "7140", + :winrm_host_port => "2012", + :memory_size=> "512" }) Veewee::Session.declare session diff --git a/definitions/windows-7-enterprise/definition.rb b/definitions/windows-7-enterprise/definition.rb index 9b799bc24..89a7652d4 100644 --- a/definitions/windows-7-enterprise/definition.rb +++ b/definitions/windows-7-enterprise/definition.rb @@ -9,8 +9,8 @@ :iso_file => File.basename(iso_src), :iso_src => iso_src, :iso_md5 => "1d0d239a252cb53e466d39e752b17c28", + :winrm_host_port => "5987", :kickstart_port => "7150" - }) Veewee::Session.declare session diff --git a/definitions/windows-8-enterprise/Autounattend.xml b/definitions/windows-8-enterprise/Autounattend.xml index 6d0aa0962..7348cd0a5 100644 --- a/definitions/windows-8-enterprise/Autounattend.xml +++ b/definitions/windows-8-enterprise/Autounattend.xml @@ -24,7 +24,7 @@ <Letter>C</Letter> <Order>1</Order> <PartitionID>1</PartitionID> - <Label>Windows 2008R2</Label> + <Label>Windows 8</Label> </ModifyPartition> </ModifyPartitions> @@ -223,7 +223,7 @@ <HelpCustomized>false</HelpCustomized> </OEMInformation> <!-- Rename computer here. --> - <ComputerName>vagrant-2008R2</ComputerName> + <ComputerName>vagrant-8</ComputerName> <TimeZone>Pacific Standard Time</TimeZone> <RegisteredOwner></RegisteredOwner> </component> diff --git a/definitions/windows-8-enterprise/definition.rb b/definitions/windows-8-enterprise/definition.rb index 63ecdbbf3..6c0fc301a 100644 --- a/definitions/windows-8-enterprise/definition.rb +++ b/definitions/windows-8-enterprise/definition.rb @@ -9,6 +9,8 @@ :iso_file => File.basename(iso_src), :iso_src => iso_src, :iso_md5 => "6beffd994574ca89417286f0dc056108", + :winrm_host_port => "5988", + :kickstart_port => "7150", :memory_size=> "512" }) From 02927a770440a3785b2df766f7240c9c998093f6 Mon Sep 17 00:00:00 2001 From: Hippie Hacker <chris@hippiehacker.org> Date: Fri, 22 Mar 2013 11:49:12 -0700 Subject: [PATCH 3/3] fix up batches to point to public places --- definitions/.windows/install-chef.bat | 8 ++------ definitions/.windows/install-vbox.bat | 2 -- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/definitions/.windows/install-chef.bat b/definitions/.windows/install-chef.bat index 0c255a2b1..fd1edf95c 100644 --- a/definitions/.windows/install-chef.bat +++ b/definitions/.windows/install-chef.bat @@ -1,6 +1,2 @@ -timeout 10 -REM sleeping to give outbound networkingh a chance to come up -cmd /C cscript wget.vbs /url:http://10.12.13.1/chef-client-11.4.0-18-gdf096fa-1.windows.msi /path:chef-client.msi -cmd /C msiexec /qn /i chef-client.msi -timeout 120 - +cmd /C powershell (New-Object System.Net.Webclient).DownloadFile('http://http://www.opscode.com/chef/install.msi','c:\chef-client.msi') +cmd /C msiexec /qn /i c:\chef-client.msi diff --git a/definitions/.windows/install-vbox.bat b/definitions/.windows/install-vbox.bat index bd4035137..614c415c7 100644 --- a/definitions/.windows/install-vbox.bat +++ b/definitions/.windows/install-vbox.bat @@ -1,5 +1,3 @@ -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 5 /d p:2:4 /c "Vagrant reboot for VBoxWindowsAdditions"