diff --git a/.gitignore b/.gitignore index 1dd7ed47c..02f8fc944 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ bin/ .bundle/ iso/ *.box +virtualfloppy.vfd diff --git a/Gemfile b/Gemfile index 76b3fbade..e193d99a5 100644 --- a/Gemfile +++ b/Gemfile @@ -2,4 +2,5 @@ source :rubygems gem "vagrant", "~> 1.0" gem "veewee", "~> 0.3.7" +gem "em-winrm" # for windows! gem "rake" diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 000000000..a5398c4a9 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,145 @@ +GEM + remote: http://rubygems.org/ + specs: + CFPropertyList (2.0.17) + libxml-ruby (>= 1.1.0) + rake (>= 0.7.0) + Platform (0.4.0) + akami (1.2.0) + gyoku (>= 0.4.0) + nokogiri (>= 1.4.0) + ansi (1.3.0) + archive-tar-minitar (0.5.2) + builder (3.1.4) + childprocess (0.3.6) + ffi (~> 1.0, >= 1.0.6) + cucumber (1.2.1) + builder (>= 2.1.2) + diff-lcs (>= 1.1.3) + gherkin (~> 2.11.0) + json (>= 1.4.6) + diff-lcs (1.1.3) + em-winrm (0.5.4) + eventmachine (= 1.0.0.beta.3) + mixlib-log (>= 1.3.0) + uuidtools (~> 2.1.1) + winrm (~> 1.1.0) + erubis (2.7.0) + eventmachine (1.0.0.beta.3) + excon (0.16.10) + ffi (1.3.1) + fission (0.4.0) + CFPropertyList (~> 2.0.17) + fog (1.9.0) + builder + excon (~> 0.14) + formatador (~> 0.2.0) + mime-types + multi_json (~> 1.0) + net-scp (~> 1.0.4) + net-ssh (>= 2.1.3) + nokogiri (~> 1.5.0) + ruby-hmac + formatador (0.2.4) + gherkin (2.11.5) + json (>= 1.4.6) + grit (2.5.0) + diff-lcs (~> 1.1) + mime-types (~> 1.15) + posix-spawn (~> 0.3.6) + gssapi (1.0.3) + ffi (>= 1.0.1) + gyoku (1.0.0) + builder (>= 2.1.2) + highline (1.6.15) + httpclient (2.2.0.2) + httpi (0.9.7) + rack + i18n (0.6.1) + json (1.5.4) + libxml-ruby (2.4.0) + little-plugger (1.1.3) + log4r (1.1.10) + logging (1.6.2) + little-plugger (>= 1.1.3) + mime-types (1.19) + mixlib-log (1.4.1) + multi_json (1.5.0) + net-scp (1.0.4) + net-ssh (>= 1.99.1) + net-ssh (2.2.2) + nokogiri (1.5.6) + nori (1.1.4) + open4 (1.3.0) + popen4 (0.1.2) + Platform (>= 0.4.0) + open4 (>= 0.4.0) + posix-spawn (0.3.6) + progressbar (0.12.0) + rack (1.5.0) + rake (10.0.3) + rspec (2.12.0) + rspec-core (~> 2.12.0) + rspec-expectations (~> 2.12.0) + rspec-mocks (~> 2.12.0) + rspec-core (2.12.2) + rspec-expectations (2.12.1) + diff-lcs (~> 1.1.3) + rspec-mocks (2.12.1) + ruby-hmac (0.4.0) + ruby-vnc (1.0.1) + rubyntlm (0.1.1) + savon (0.9.5) + akami (~> 1.0) + builder (>= 2.1.2) + gyoku (>= 0.4.0) + httpi (~> 0.9) + nokogiri (>= 1.4.0) + nori (~> 1.0) + wasabi (~> 1.0) + thor (0.16.0) + uuidtools (2.1.3) + vagrant (1.0.5) + archive-tar-minitar (= 0.5.2) + childprocess (~> 0.3.1) + erubis (~> 2.7.0) + i18n (~> 0.6.0) + json (~> 1.5.1) + log4r (~> 1.1.9) + net-scp (~> 1.0.4) + net-ssh (~> 2.2.2) + veewee (0.3.7) + ansi (~> 1.3.0) + childprocess + cucumber (>= 1.0.0) + fission (= 0.4.0) + fog (~> 1.8) + grit + highline + i18n + net-ssh (~> 2.2.0) + popen4 (~> 0.1.2) + progressbar + rspec (~> 2.5) + ruby-vnc (~> 1.0.0) + thor (~> 0.15) + vagrant (>= 0.9) + wasabi (1.0.0) + nokogiri (>= 1.4.0) + winrm (1.1.2) + gssapi (~> 1.0.0) + httpclient (~> 2.2.0.2) + logging (~> 1.6.1) + nokogiri (~> 1.5.0) + rubyntlm (~> 0.1.1) + savon (= 0.9.5) + uuidtools (~> 2.1.2) + +PLATFORMS + ruby + +DEPENDENCIES + em-winrm + rake + vagrant (~> 1.0.5) + veewee (>= 0.3.7) diff --git a/README.md b/README.md index 1a9f2d1c6..8ae6e56e0 100644 --- a/README.md +++ b/README.md @@ -118,6 +118,14 @@ filename, its source URL, and the MD5 checksum of the file. * `sudoers.sh`: Customization for `/etc/sudoers` * `update.sh`: Ensures that the OS installation is updated +## Windows + +* `install-chef.bat`: Installs Chef and Ruby with + [Opscode's full stack installer](http://opscode.com/chef/install) +* `oracle-cert.cer`: Needed for automated install via install-vbox.bat +* `install-vbox.bat`: Installs VirtualBox Guest Additions +* `mount-validation.bat`: Mounts the validation drive + Bugs and Issues =============== @@ -137,6 +145,7 @@ License and Authors - Author:: Stephen Delano () - Author:: Joshua Timberman () - Author:: Tim Dysinger () +- Author:: Chris McClimans () Copyright:: 2012, Opscode, Inc () Copyright:: 2011-2012, Tim Dysinger () diff --git a/definitions/.common/session.rb b/definitions/.common/session.rb index 346176ab3..0b4ce90a2 100644 --- a/definitions/.common/session.rb +++ b/definitions/.common/session.rb @@ -4,12 +4,10 @@ :disk_format => "VDI", :disk_size => "40960", :hostiocache => "off", - :ioapic => "on", :iso_download_timeout => "1000", :kickstart_port => "7122", :kickstart_timeout => "10000", :memory_size=> "384", - :pae => "on", :postinstall_timeout => "10000", :ssh_guest_port => "22", :ssh_host_port => "7222", @@ -18,4 +16,11 @@ :ssh_password => "vagrant", :ssh_user => "vagrant", :sudo_cmd => "echo '%p'|sudo -S sh '%f'", + :virtualbox => { + :vm_options => { + :ioapic => "on", + :pae => "on" + } + } + } diff --git a/definitions/.windows/install-chef.bat b/definitions/.windows/install-chef.bat new file mode 100644 index 000000000..c90bfb677 --- /dev/null +++ b/definitions/.windows/install-chef.bat @@ -0,0 +1,2 @@ +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 diff --git a/definitions/.windows/install-vbox.bat b/definitions/.windows/install-vbox.bat new file mode 100644 index 000000000..8c34e3683 --- /dev/null +++ b/definitions/.windows/install-vbox.bat @@ -0,0 +1,6 @@ +# with this, we can open the iso, and extract the VBoxWindowsAdditions.exe! +# 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" + diff --git a/definitions/.windows/mount-validation.bat b/definitions/.windows/mount-validation.bat new file mode 100644 index 000000000..e71179906 --- /dev/null +++ b/definitions/.windows/mount-validation.bat @@ -0,0 +1,3 @@ +# This is so we can pass the validation test +cmd /c net use z: \\vboxsrv\veewee-validation + diff --git a/definitions/.windows/oracle-cert.cer b/definitions/.windows/oracle-cert.cer new file mode 100644 index 000000000..6f3380d48 Binary files /dev/null and b/definitions/.windows/oracle-cert.cer differ diff --git a/definitions/.windows/session.rb b/definitions/.windows/session.rb new file mode 100644 index 000000000..182b0b95d --- /dev/null +++ b/definitions/.windows/session.rb @@ -0,0 +1,21 @@ +require File.dirname(__FILE__) + "/../.common/session.rb" + +WINDOWS_SESSION = + COMMON_SESSION.merge({ :boot_wait => "1", + :boot_cmd_sequence => [''], + :winrm_user => "vagrant", + :winrm_password => "vagrant", + :floppy_files => [ + "Autounattend.xml", + "oracle-cert.cer" + ], + :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? + # because this will eventually run on kvm, openstack, etc etc + ], + :video_memory_size => '48', + :sudo_cmd => "%f", + :shutdown_cmd => "shutdown /s /t 10 /f /d p:4:1 /c \"Vagrant Shutdown\"" }) + diff --git a/definitions/windows-2008r2-standard/Autounattend.xml b/definitions/windows-2008r2-standard/Autounattend.xml new file mode 100644 index 000000000..3f3d0ef9f --- /dev/null +++ b/definitions/windows-2008r2-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-2008r2-standard/README.md b/definitions/windows-2008r2-standard/README.md new file mode 100644 index 000000000..be39b6e15 --- /dev/null +++ b/definitions/windows-2008r2-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-2008r2-standard/definition.rb b/definitions/windows-2008r2-standard/definition.rb new file mode 100644 index 000000000..31a37278b --- /dev/null +++ b/definitions/windows-2008r2-standard/definition.rb @@ -0,0 +1,16 @@ +# -*- 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" + }) + +Veewee::Session.declare session + + diff --git a/definitions/windows-2008r2-standard/install-chef.bat b/definitions/windows-2008r2-standard/install-chef.bat new file mode 120000 index 000000000..0494fd4af --- /dev/null +++ b/definitions/windows-2008r2-standard/install-chef.bat @@ -0,0 +1 @@ +../.windows/install-chef.bat \ No newline at end of file diff --git a/definitions/windows-2008r2-standard/install-vbox.bat b/definitions/windows-2008r2-standard/install-vbox.bat new file mode 120000 index 000000000..2ff5531e3 --- /dev/null +++ b/definitions/windows-2008r2-standard/install-vbox.bat @@ -0,0 +1 @@ +../.windows/install-vbox.bat \ No newline at end of file diff --git a/definitions/windows-2008r2-standard/mount-validation.bat b/definitions/windows-2008r2-standard/mount-validation.bat new file mode 120000 index 000000000..e137688e8 --- /dev/null +++ b/definitions/windows-2008r2-standard/mount-validation.bat @@ -0,0 +1 @@ +../.windows/mount-validation.bat \ No newline at end of file diff --git a/definitions/windows-2008r2-standard/oracle-cert.cer b/definitions/windows-2008r2-standard/oracle-cert.cer new file mode 120000 index 000000000..5fbb0d341 --- /dev/null +++ b/definitions/windows-2008r2-standard/oracle-cert.cer @@ -0,0 +1 @@ +../.windows/oracle-cert.cer \ No newline at end of file diff --git a/definitions/windows-7-enterprise/Autounattend.xml b/definitions/windows-7-enterprise/Autounattend.xml new file mode 100644 index 000000000..12a9793cb --- /dev/null +++ b/definitions/windows-7-enterprise/Autounattend.xml @@ -0,0 +1,233 @@ +<?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 7 Enterprise</Label> + </ModifyPartition> + </ModifyPartitions> + <DiskID>0</DiskID> + <WillWipeDisk>true</WillWipeDisk> + </Disk> + <WillShowUI>OnError</WillShowUI> + </DiskConfiguration> + <UserData> + <ProductKey> + <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 7 ENTERPRISE</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>Work</NetworkLocation> + <ProtectYourPC>3</ProtectYourPC> + </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 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-vbox-guest.bat</CommandLine> --> + <!-- <Description>Install Win RM</Description> --> + <!-- <Order>1</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-win7ent</ComputerName> + <TimeZone>Pacific Standard Time</TimeZone> + <RegisteredOwner>Vagrant</RegisteredOwner> + <ShowWindowsLive>false</ShowWindowsLive> + </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> + <component name="Security-Malware-Windows-Defender" 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"> + <DisableAntiSpyware>true</DisableAntiSpyware> + </component> + <component name="Microsoft-Windows-SystemRestore-Main" 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"> + <DisableSR>1</DisableSR> + </component> + </settings> + <settings pass="generalize"> + <component name="Microsoft-Windows-Security-SPP" 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"> + <SkipRearm>1</SkipRearm> + </component> + </settings> + <settings pass="offlineServicing"> + <component name="Microsoft-Windows-LUA-Settings" 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"> + <EnableLUA>false</EnableLUA> + </component> + </settings> + <cpi:offlineImage cpi:source="catalog:d:/sources/install_windows 7 enterprise.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" /> +</unattend> diff --git a/definitions/windows-7-enterprise/README.md b/definitions/windows-7-enterprise/README.md new file mode 100644 index 000000000..596df7e89 --- /dev/null +++ b/definitions/windows-7-enterprise/README.md @@ -0,0 +1,52 @@ +You can download a free trial of Windows 7 Enterprise 90-day Trial + +url: http://technet.microsoft.com/en-us/evalcenter/cc442495.aspx +file: 7600.16385.090713-1255_x64fre_enterprise_en-us_EVAL_Eval_Enterprise-GRMCENXEVAL_EN_DVD.iso +md5sum: 1d0d239a252cb53e466d39e752b17c28 + +''' +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 7 ENTERPRISE +Description : Windows 7 ENTERPRISE +Size : 11,913,037,777 bytes + +The operation completed successfully. +''' + +- place it in a directory called iso + +The installation uses the Standard way for 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 + +- Building the machine creates a floppy that contains: + - AutoUnattend.xml (that will configure the windows) + - winrm-install.bat (activates the http and https listener + punches the firewall hole) + +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 sources/install.wim on the install DVD .iso + + + + # Use the Name : from 'Dism.exe /Get-WIMInfo /WimFile:d:\sources\install.wim' + # <InstallFrom> + # <MetaData wcm:action="add"> + # <Key>/IMAGE/NAME</Key> + # <Value>Windows 7 ENTERPRISE</Value> + # </MetaData> + # </InstallFrom> diff --git a/definitions/windows-7-enterprise/definition.rb b/definitions/windows-7-enterprise/definition.rb new file mode 100644 index 000000000..8f0f4a30a --- /dev/null +++ b/definitions/windows-7-enterprise/definition.rb @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +require File.dirname(__FILE__) + "/../.windows/session.rb" + +iso_src = "http://wb.dlservice.microsoft.com/dl/download/release/Win7/3/b/a/3bac7d87-8ad2-4b7a-87b3-def36aee35fa/7600.16385.090713-1255_x64fre_enterprise_en-us_EVAL_Eval_Enterprise-GRMCENXEVAL_EN_DVD.iso" + +session = WINDOWS_SESSION.merge({ + :os_type_id => 'Windows7_64', + :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" + }) + +Veewee::Session.declare session diff --git a/definitions/windows-7-enterprise/install-chef.bat b/definitions/windows-7-enterprise/install-chef.bat new file mode 120000 index 000000000..0494fd4af --- /dev/null +++ b/definitions/windows-7-enterprise/install-chef.bat @@ -0,0 +1 @@ +../.windows/install-chef.bat \ No newline at end of file diff --git a/definitions/windows-7-enterprise/install-vbox.bat b/definitions/windows-7-enterprise/install-vbox.bat new file mode 120000 index 000000000..2ff5531e3 --- /dev/null +++ b/definitions/windows-7-enterprise/install-vbox.bat @@ -0,0 +1 @@ +../.windows/install-vbox.bat \ No newline at end of file diff --git a/definitions/windows-7-enterprise/mount-validation.bat b/definitions/windows-7-enterprise/mount-validation.bat new file mode 120000 index 000000000..e137688e8 --- /dev/null +++ b/definitions/windows-7-enterprise/mount-validation.bat @@ -0,0 +1 @@ +../.windows/mount-validation.bat \ No newline at end of file diff --git a/definitions/windows-7-enterprise/oracle-cert.cer b/definitions/windows-7-enterprise/oracle-cert.cer new file mode 120000 index 000000000..5fbb0d341 --- /dev/null +++ b/definitions/windows-7-enterprise/oracle-cert.cer @@ -0,0 +1 @@ +../.windows/oracle-cert.cer \ No newline at end of file