Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

2008R1/R2 serverweb and serverwebcore

  • Loading branch information...
commit 1661dd3650cf88b09f10cb3a3ec01a675e8e928d 1 parent 1385b45
@hh hh authored
Showing with 2,617 additions and 6 deletions.
  1. +1 −1  templates/windows-2008R1-serverstandard-amd64/Autounattend.xml
  2. +4 −3 templates/windows-2008R1-serverstandard-amd64/install-cygwin-sshd.bat
  3. +2 −1  templates/windows-2008R1-serverstandard-amd64/postinstall.sh
  4. +162 −0 templates/windows-2008R1-serverweb-amd64/Autounattend.xml
  5. +134 −0 templates/windows-2008R1-serverweb-amd64/README.md
  6. BIN  templates/windows-2008R1-serverweb-amd64/cygwin-setup.exe
  7. +131 −0 templates/windows-2008R1-serverweb-amd64/definition.rb
  8. +40 −0 templates/windows-2008R1-serverweb-amd64/install-cygwin-sshd.bat
  9. +5 −0 templates/windows-2008R1-serverweb-amd64/install-guest-additions.bat
  10. +2 −0  templates/windows-2008R1-serverweb-amd64/install-vbox-guest.bat
  11. +14 −0 templates/windows-2008R1-serverweb-amd64/install-winrm.bat
  12. BIN  templates/windows-2008R1-serverweb-amd64/oracle-cert.cer
  13. +74 −0 templates/windows-2008R1-serverweb-amd64/postinstall.sh
  14. +2 −0  templates/windows-2008R1-serverweb-amd64/sudo
  15. +8 −0 templates/windows-2008R1-serverweb-amd64/winrm.rb
  16. +142 −0 templates/windows-2008R1-serverweb-i386/Autounattend.xml
  17. +136 −0 templates/windows-2008R1-serverweb-i386/README.md
  18. BIN  templates/windows-2008R1-serverweb-i386/cygwin-setup.exe
  19. +132 −0 templates/windows-2008R1-serverweb-i386/definition.rb
  20. +40 −0 templates/windows-2008R1-serverweb-i386/install-cygwin-sshd.bat
  21. +2 −0  templates/windows-2008R1-serverweb-i386/install-vbox-guest.bat
  22. +14 −0 templates/windows-2008R1-serverweb-i386/install-winrm.bat
  23. BIN  templates/windows-2008R1-serverweb-i386/oracle-cert.cer
  24. +74 −0 templates/windows-2008R1-serverweb-i386/postinstall.sh
  25. +2 −0  templates/windows-2008R1-serverweb-i386/sudo
  26. +8 −0 templates/windows-2008R1-serverweb-i386/winrm.rb
  27. +162 −0 templates/windows-2008R1-serverwebcore-amd64/Autounattend.xml
  28. +134 −0 templates/windows-2008R1-serverwebcore-amd64/README.md
  29. BIN  templates/windows-2008R1-serverwebcore-amd64/cygwin-setup.exe
  30. +132 −0 templates/windows-2008R1-serverwebcore-amd64/definition.rb
  31. +41 −0 templates/windows-2008R1-serverwebcore-amd64/install-cygwin-sshd.bat
  32. +2 −0  templates/windows-2008R1-serverwebcore-amd64/install-vbox-guest.bat
  33. +14 −0 templates/windows-2008R1-serverwebcore-amd64/install-winrm.bat
  34. BIN  templates/windows-2008R1-serverwebcore-amd64/oracle-cert.cer
  35. +74 −0 templates/windows-2008R1-serverwebcore-amd64/postinstall.sh
  36. +2 −0  templates/windows-2008R1-serverwebcore-amd64/sudo
  37. +8 −0 templates/windows-2008R1-serverwebcore-amd64/winrm.rb
  38. +0 −1  templates/windows-2008R2-serverstandard-amd64/definition.rb
  39. +151 −0 templates/windows-2008R2-serverweb-amd64/Autounattend.xml
  40. +142 −0 templates/windows-2008R2-serverweb-amd64/README.md
  41. +38 −0 templates/windows-2008R2-serverweb-amd64/definition.rb
  42. +40 −0 templates/windows-2008R2-serverweb-amd64/install-cygwin-sshd.bat
  43. +2 −0  templates/windows-2008R2-serverweb-amd64/install-vbox-guest.bat
  44. +11 −0 templates/windows-2008R2-serverweb-amd64/install-winrm.bat
  45. BIN  templates/windows-2008R2-serverweb-amd64/oracle-cert.cer
  46. +74 −0 templates/windows-2008R2-serverweb-amd64/postinstall.sh
  47. +145 −0 templates/windows-2008R2-serverwebcore-amd64/Autounattend.xml
  48. +142 −0 templates/windows-2008R2-serverwebcore-amd64/README.md
  49. BIN  templates/windows-2008R2-serverwebcore-amd64/cygwin-setup.exe
  50. +46 −0 templates/windows-2008R2-serverwebcore-amd64/definition.rb
  51. +41 −0 templates/windows-2008R2-serverwebcore-amd64/install-cygwin-sshd.bat
  52. +2 −0  templates/windows-2008R2-serverwebcore-amd64/install-vbox-guest.bat
  53. +11 −0 templates/windows-2008R2-serverwebcore-amd64/install-winrm.bat
  54. BIN  templates/windows-2008R2-serverwebcore-amd64/oracle-cert.cer
  55. +74 −0 templates/windows-2008R2-serverwebcore-amd64/postinstall.sh
View
2  templates/windows-2008R1-serverstandard-amd64/Autounattend.xml
@@ -128,7 +128,7 @@
<HelpCustomized>false</HelpCustomized>
</OEMInformation>
<!-- Rename computer here. -->
- <ComputerName>vagrant-2008R2</ComputerName>
+ <ComputerName>vagrant-2008R1-serverstandard</ComputerName>
<TimeZone>New Zealand Standard Time</TimeZone>
<RegisteredOwner></RegisteredOwner>
</component>
View
7 templates/windows-2008R1-serverstandard-amd64/install-cygwin-sshd.bat
@@ -2,14 +2,13 @@ REM http://webcache.googleusercontent.com/search?q=cache:SjoPPpuQxuoJ:www.tcm.ph
REM create the cygwin directory
cmd /c mkdir %SystemDrive%\cygwin
-
-cmd /c bitsadmin /transfer CygwinSetupExe /download /priority normal http://www.cygwin.com/setup.exe %SystemDrive%\cygwin\cygwin-setup.exe
+copy a:\cygwin-setup.exe %SystemDrive%\cygwin
REM goto a temp directory
cd %SystemDrive%\windows\temp
REM run the installation
-cmd /c %SystemDrive%\cygwin\cygwin-setup.exe -q -R %SystemDrive%\cygwin -P openssh,openssl,curl,cygrunsrv,wget,rebase,vim -s http://cygwin.mirrors.pair.com
+cmd /c a:/cygwin-setup.exe -q -R %SystemDrive%\cygwin -P openssh,openssl,curl,cygrunsrv,wget,rebase,vim -s http://cygwin.mirrors.pair.com
%SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin cygrunsrv -R sshd'
@@ -38,3 +37,5 @@ net start sshd
# http://www.winhelponline.com/blog/fix-corrupted-recycle-bin-windows-7-vista/
cmd /c rd /s /q c:\$Recycle.bin
+copy a:\sudo %SystemDrive%\cygwin\usr\local\bin
+cmd /c %SystemDrive%\cygwin\bin\chmod 755 %SystemDrive%\cygwin\usr\local\bin\sudo
View
3  templates/windows-2008R1-serverstandard-amd64/postinstall.sh
@@ -65,7 +65,8 @@ EOF
chmod 755 /bin/sudo
# Mounting a directory
-net.exe use '\\vboxsvr\veewee-validation'
+# I don't think this works until after a reboot
+#net.exe use '\\vboxsvr\veewee-validation'
# Reboot
View
162 templates/windows-2008R1-serverweb-amd64/Autounattend.xml
@@ -0,0 +1,162 @@
+<?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>
+ <Extend>true</Extend>
+ </CreatePartition>
+ </CreatePartitions>
+ <ModifyPartitions>
+ <ModifyPartition wcm:action="add">
+ <Extend>false</Extend>
+ <Format>NTFS</Format>
+ <Letter>C</Letter>
+ <Order>1</Order>
+ <PartitionID>1</PartitionID>
+ <Label>Windows 2008R1 ServerWeb</Label>
+ </ModifyPartition>
+ </ModifyPartitions>
+ <DiskID>0</DiskID>
+ <WillWipeDisk>true</WillWipeDisk>
+ </Disk>
+ <WillShowUI>OnError</WillShowUI>
+ </DiskConfiguration>
+ <UserData>
+ <AcceptEula>true</AcceptEula>
+ <FullName>Vagrant Fullname</FullName>
+ <Organization>Vagrant Inc</Organization>
+ <ProductKey>
+ <WillShowUI>Always</WillShowUI>
+ </ProductKey>
+ </UserData>
+ <ImageInstall>
+ <OSImage>
+ <InstallTo>
+ <DiskID>0</DiskID>
+ <PartitionID>1</PartitionID>
+ </InstallTo>
+ <WillShowUI>OnError</WillShowUI>
+ <InstallToAvailablePartition>false</InstallToAvailablePartition>
+ <InstallFrom>
+ <MetaData wcm:action="add">
+ <Key>/IMAGE/NAME</Key>
+ <Value>Windows Longhorn SERVERWEB</Value>
+ <!-- If Name fails you can the INDEX -->
+ <!-- <Key>/IMAGE/INDEX</Key> -->
+ <!-- <Value>1</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>dgBhAGcAcgBhAG4AdABBAGQAbQBpAG4AaQBzAHQAcgBhAHQAbwByAFAAYQBzAHMAdwBvAHIAZAA=</Value>
+ <PlainText>false</PlainText>
+ </AdministratorPassword>
+ <LocalAccounts>
+ <LocalAccount wcm:action="add">
+ <Password>
+ <Value>dgBhAGcAcgBhAG4AdABQAGEAcwBzAHcAbwByAGQA</Value>
+ <PlainText>false</PlainText>
+ </Password>
+ <Description>Vagrant User</Description>
+ <DisplayName>vagrant</DisplayName>
+ <Group>administrators</Group>
+ <Name>vagrant</Name>
+ </LocalAccount>
+ </LocalAccounts>
+ </UserAccounts>
+ <OOBE>
+ <HideEULAPage>true</HideEULAPage>
+ <NetworkLocation>Home</NetworkLocation>
+ <ProtectYourPC>3</ProtectYourPC>
+ </OOBE>
+ <AutoLogon>
+ <Password>
+ <Value>dgBhAGcAcgBhAG4AdABQAGEAcwBzAHcAbwByAGQA</Value>
+ <PlainText>false</PlainText>
+ </Password>
+ <Username>administrator</Username>
+ <Enabled>true</Enabled>
+ </AutoLogon>
+ <FirstLogonCommands>
+ <SynchronousCommand wcm:action="add">
+ <CommandLine>cmd.exe /c a:install-winrm.bat</CommandLine>
+ <Description>Install Win RM</Description>
+ <Order>1</Order>
+ </SynchronousCommand>
+ <!-- <SynchronousCommand wcm:action="add"> -->
+ <!-- <CommandLine>cmd.exe /c a:install-chefclient.bat</CommandLine> -->
+ <!-- <Description>Install Chef Client</Description> -->
+ <!-- <Order>2</Order> -->
+ <!-- </SynchronousCommand> -->
+ <SynchronousCommand wcm:action="add">
+ <CommandLine>cmd.exe /c a:install-cygwin-sshd.bat</CommandLine>
+ <Description>Install Cygwin SSHD</Description>
+ <Order>2</Order>
+ </SynchronousCommand>
+ <SynchronousCommand wcm:action="add">
+ <CommandLine>cmd.exe /c a:install-vbox-guest.bat</CommandLine>
+ <Description>Install Virtualbox Guest Utilities</Description>
+ <Order>3</Order>
+ </SynchronousCommand>
+ <!-- needed wget -->
+ <!-- <SynchronousCommand wcm:action="add"> -->
+ <!-- <CommandLine>cmd.exe /c a:install-guest-additions.bat</CommandLine> -->
+ <!-- <Description>Install Virtualbox Guest Additions</Description> -->
+ <!-- <Order>3</Order> -->
+ <!-- </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>vw-2008R1-web</ComputerName>
+ <TimeZone>New Zealand Standard Time</TimeZone>
+ <RegisteredOwner></RegisteredOwner>
+ </component>
+ <component name="Microsoft-Windows-OutOfBoxExperience" 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">
+ <DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon>
+ </component>
+ <component name="Microsoft-Windows-ServerManager-SvrMgrNc" 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">
+ <DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon>
+ </component>
+ <component name="Microsoft-Windows-Security-Licensing-SLC-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>
+ </settings>
+ <settings pass="generalize">
+ <component name="Microsoft-Windows-Security-Licensing-SLC" 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>
+ <cpi:offlineImage cpi:source="wim:d:/sources/install.wim#Windows Longhorn SERVERWEB" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
+</unattend>
View
134 templates/windows-2008R1-serverweb-amd64/README.md
@@ -0,0 +1,134 @@
+You can download a free trial of Windows Server 2008 Enterprise: (60 day eval, expandable to 240 days)
+
+From http://www.microsoft.com/download/en/details.aspx?id=8371
+
+64bit
+url: http://download.microsoft.com/download/B/4/D/B4DC75A1-D7D2-4F31-87F9-E02C950E8D31/6001.18000.080118-1840_amd64fre_Server_en-us-KRMSXFRE_EN_DVD.iso
+filename: 6001.18000.080118-1840_amd64fre_Server_en-us-KRMSXFRE_EN_DVD.iso
+md5sum: 0477c88678efb8ebc5cd7a9e9efd8b82
+
+
+32bit
+url: http://download.microsoft.com/download/B/4/D/B4DC75A1-D7D2-4F31-87F9-E02C950E8D31/6001.18000.080118-1840_x86fre_Server_en-us-KRMSFRE_EN_DVD.iso
+
+
+- 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.
+
+You can download Automated Installation Kit (AIK) for Windows Vista SP1 and Windows Server 2008:
+from http://www.microsoft.com/download/en/details.aspx?id=9085
+file: 6001.18000.080118-1840-kb3aikl_en.iso
+md5sum: b83fad8fd28e637b82cb4a6bef7d6920
+
+- 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 Longhorn install.wim on the install .iso
+
+<InstallFrom>
+ <MetaData wcm:action="add">
+ <Key>/IMAGE/NAME</Key>
+ <Value>Windows Longhorn SERVERSTANDARD</Value> ### This comes from the Name: field below
+ </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 Longhorn SERVERSTANDARD
+Description : Windows Longhorn SERVERSTANDARD
+Size : 8,784,297,519 bytes
+
+Index : 2
+Name : Windows Longhorn SERVERENTERPRISE
+Description : Windows Longhorn SERVERENTERPRISE
+Size : 8,792,036,862 bytes
+
+Index : 3
+Name : Windows Longhorn SERVERDATACENTER
+Description : Windows Longhorn SERVERDATACENTER
+Size : 8,792,568,645 bytes
+
+Index : 4
+Name : Windows Longhorn SERVERSTANDARDCORE
+Description : Windows Longhorn SERVERSTANDARDCORE
+Size : 2,512,939,954 bytes
+
+Index : 5
+Name : Windows Longhorn SERVERENTERPRISECORE
+Description : Windows Longhorn SERVERENTERPRISECORE
+Size : 2,522,686,340 bytes
+
+Index : 6
+Name : Windows Longhorn SERVERDATACENTERCORE
+Description : Windows Longhorn SERVERDATACENTERCORE
+Size : 2,522,615,418 bytes
+
+
+This gets us nearly there, but we still need a winrm provisioner, as I don't like having to install cygwin.
+
+Expose the winrm port:
+
+<pre>
+$ gem install chef
+$ gem install knife-windows
+#Create a tunnel
+$ ssh -p 7222 -L5985:localhost:5985 vagrant@localhost
+$ knife bootstrap windows winrm localhost -x Administrator -P 'vagrant'
+</pre>
+
+
+- http://wiki.opscode.com/display/chef/Knife+Windows+Bootstrap
+- https://github.com/opscode/knife-windows/blob/master/lib/chef/knife/bootstrap/windows-shell.erb
+
+- https://github.com/zenchild/WinRM
+
+- http://devopscloud.net/2011/04/17/managing-chef-from-windows-7/
+- http://devopscloud.net/2011/04/28/powershell-userdata-to-start-a-chef-run/
+- http://devopscloud.net/2011/03/23/dissection-of-a-chef-recipe-or-two-for-windows/
+- https://github.com/pmorton/chef-windows-installer
+
+==
+https://github.com/zenchild/WinRM/issues/unreads#issue/1
+http -> requires unencryptedwinrm quickconfig (said yes to enable firewall)
+winrm p winrm/config/service @{AllowUnencrypted="true"}
+winrm set winrm/config/service/auth @{Basic="true"}netsh advfirewall firewall set rule group="remote administration" new enable=yes
+
+- http://forums.citrix.com/thread.jspa?messageID=1535826
+- http://support.microsoft.com/kb/2019527
+
+winrm get winrm/config
+
+The purpose of configuring WinRM for HTTPS is to encrypt the data being sent across the wire.
+
+WinRM HTTPS requires a local computer "Server Authentication" certificate with a CN matching the hostname, that is not expired, revoked, or self-signed to be installed.
+
+To install or view certificates for the local computer:
+
+- click Start, run, MMC, "File" menu, "Add or Remove Snap-ins" select "Certificates" and click "Add". Go through the wizard selecting "Computer account".
+
+- Install or view the certificates under:
+Certificates (Local computer)
+ Personal
+ Certificates
+
+If you do not have a Sever Authenticating certificate consult your certicate administrator. If you have a microsoft Certificate server you may be abel to request a certificate using the web certificate template from HTTPS://<MyDomainCertificateServer>/certsrv
+
+Once the certificate is installed type the following to configure WINRM to listen on HTTPS:
+
+winrm quickconfig -transport:https
+
+ If you do not have an appropriate certificate you can run the following with the authentication methods configured for WinRM however the data will not be encrypted.
+
+winrm quickconfig
+
View
BIN  templates/windows-2008R1-serverweb-amd64/cygwin-setup.exe
Binary file not shown
View
131 templates/windows-2008R1-serverweb-amd64/definition.rb
@@ -0,0 +1,131 @@
+# Download Windows Web Server 2008 : (60 day eval, expandable to 240 days)
+# http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=20407
+
+# 64bit
+# http://download.microsoft.com/download/B/4/D/B4DC75A1-D7D2-4F31-87F9-E02C950E8D31/6001.18000.080118-1840_amd64fre_Server_en-us-KRMSXFRE_EN_DVD.iso
+# md5sum 0477c88678efb8ebc5cd7a9e9efd8b82 6001.18000.080118-1840_amd64fre_Server_en-us-KRMSXFRE_EN_DVD.iso
+
+# 32bit
+# http://download.microsoft.com/download/B/4/D/B4DC75A1-D7D2-4F31-87F9-E02C950E8D31/6001.18000.080118-1840_x86fre_Server_en-us-KRMSFRE_EN_DVD.iso
+
+
+
+# To get to 2008R1-SP2 you'l need
+
+# 64bit
+# Windows Server 2008 Service Pack 2 and Windows Vista Service Pack 2 - Five Language Standalone for x64-based systems (KB948465)
+# http://www.microsoft.com/download/en/details.aspx?id=17669
+# http://download.microsoft.com/download/4/7/3/473B909B-7B52-49FE-A443-2E2985D3DFC3/Windows6.0-KB948465-X64.exe
+
+# 32bit
+# Windows Server 2008 Service Pack 2 and Windows Vista Service Pack 2 - Five Language Standalone (KB948465)
+# http://www.microsoft.com/download/en/details.aspx?id=16468
+# http://download.microsoft.com/download/E/7/7/E77CBA41-0B6B-4398-BBBF-EE121EEC0535/Windows6.0-KB948465-X86.exe
+
+
+
+# Win2008 requires at least 10gig hard drive to install...
+
+Veewee::Session.declare({
+ :os_type_id => 'Windows2008_64',
+# :iso_file => "en_windows_web_server_2008_x64_dvd_x14-26683.iso",
+ :iso_file => "6001.18000.080118-1840_amd64fre_ServerWeb_en-us-KRMWXFRE_EN_DVD.iso",
+ :iso_md5 => "a95ad42cee261333d28891f4868e6d3b",
+ :iso_src => "http://download.microsoft.com/download/1/e/3/1e332e6c-9f8a-47ba-b380-8fdef29e9d57/6001.18000.080118-1840_amd64fre_ServerWeb_en-us-KRMWXFRE_EN_DVD.iso",
+ :iso_download_timeout => "1000",
+
+ :cpu_count => '1',
+ :memory_size=> '384',
+ :disk_size => '20280', :disk_format => 'VDI', :hostiocache => 'off',
+
+
+ #:kickstart_port => "7122",
+ #:kickstart_ip => self.local_ip, we could set this manually, I wish we could push this to the
+ #:kickstart_timeout => 1000,
+ #:kickstart_file => ["VBoxWindowsAdditions-amd64.exe"],
+
+ :floppy_files => [
+ "Autounattend.xml", # automate install and setup winrm
+ "install-winrm.bat",
+ "install-cygwin-sshd.bat",
+ "install-vbox-guest.bat",
+ "oracle-cert.cer"
+ ],
+
+ :boot_wait => "50",
+ # after 40 seconds, hit these keys to not enter a product key and fully automate the install
+ # if your machine is slower it may take more time
+ :boot_cmd_sequence => [
+ '<Tab><Tab><Spacebar>',
+ '<Tab><Tab><Tab><Spacebar>',
+ '<Tab><Spacebar>'
+ ],
+
+ :ssh_login_timeout => "10000",
+ # Actively attempt to ssh in for 10000 seconds
+ :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "",
+ :ssh_host_port => "7233", :ssh_guest_port => "22",
+ # And run postinstall.sh for up to 10000 seconds
+ :postinstall_timeout => "10000",
+ :postinstall_files => ["postinstall.sh"],
+ # No sudo on windows
+ :sudo_cmd => "sh '%f'",
+ # Shutdown is different as well
+ :shutdown_cmd => "shutdown /s /t 0 /d P:4:1 /c \"Vagrant Shutdown\"",
+})
+
+
+# To edit the Autounattend.xml and validate it:
+# Download Automated Installation Kit (AIK) for Windows Vista SP1 and Windows Server 2008:
+# http://www.microsoft.com/download/en/details.aspx?id=9085
+# Resulting in 6001.18000.080118-1840-kb3aikl_en.iso
+# md5sum b83fad8fd28e637b82cb4a6bef7d6920 6001.18000.080118-1840-kb3aikl_en.iso
+
+# 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 Longhorn install.wim on the install .iso
+
+# <InstallFrom>
+# <MetaData wcm:action="add">
+# <Key>/IMAGE/NAME</Key>
+# <Value>Windows Longhorn SERVERSTANDARD</Value> ### This comes from the Name: field below
+# </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 Longhorn SERVERSTANDARD
+# Description : Windows Longhorn SERVERSTANDARD
+# Size : 8,784,297,519 bytes
+
+# Index : 2
+# Name : Windows Longhorn SERVERENTERPRISE
+# Description : Windows Longhorn SERVERENTERPRISE
+# Size : 8,792,036,862 bytes
+
+# Index : 3
+# Name : Windows Longhorn SERVERDATACENTER
+# Description : Windows Longhorn SERVERDATACENTER
+# Size : 8,792,568,645 bytes
+
+# Index : 4
+# Name : Windows Longhorn SERVERSTANDARDCORE
+# Description : Windows Longhorn SERVERSTANDARDCORE
+# Size : 2,512,939,954 bytes
+
+# Index : 5
+# Name : Windows Longhorn SERVERENTERPRISECORE
+# Description : Windows Longhorn SERVERENTERPRISECORE
+# Size : 2,522,686,340 bytes
+
+# Index : 6
+# Name : Windows Longhorn SERVERDATACENTERCORE
+# Description : Windows Longhorn SERVERDATACENTERCORE
+# Size : 2,522,615,418 bytes
View
40 templates/windows-2008R1-serverweb-amd64/install-cygwin-sshd.bat
@@ -0,0 +1,40 @@
+REM http://webcache.googleusercontent.com/search?q=cache:SjoPPpuQxuoJ:www.tcm.phy.cam.ac.uk/~mr349/cygwin_install.html+install+cygwin+ssh+commandline&cd=2&hl=nl&ct=clnk&gl=be&source=www.google.be
+
+REM create the cygwin directory
+cmd /c mkdir %SystemDrive%\cygwin
+
+cmd /c bitsadmin /transfer CygwinSetupExe /download /priority normal http://www.cygwin.com/setup.exe %SystemDrive%\cygwin\cygwin-setup.exe
+
+REM goto a temp directory
+cd %SystemDrive%\windows\temp
+
+REM run the installation
+cmd /c %SystemDrive%\cygwin\cygwin-setup.exe -q -R %SystemDrive%\cygwin -P openssh,openssl,curl,cygrunsrv,wget,rebase,vim -s http://cygwin.mirrors.pair.com
+
+%SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin cygrunsrv -R sshd'
+
+REM /bin/ash is the right shell for this command
+cmd /c %SystemDrive%\cygwin\bin\ash -c /bin/rebaseall
+
+cmd /c %SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin mkgroup -l'>%SystemDrive%\cygwin\etc\group
+
+cmd /c %SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin mkpasswd -l'>%SystemDrive%\cygwin\etc\passwd
+
+%SystemDrive%\cygwin\usr\bin\sleep 1
+
+%SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin /usr/bin/ssh-host-config -y -c "ntsecbinmode tty" -w "abc&&123!!" '
+
+%SystemDrive%\cygwin\usr\bin\sleep 2
+
+cmd /c if exist %Systemroot%\system32\netsh.exe netsh advfirewall firewall add rule name="SSHD" dir=in action=allow program="c:\cygwin\usr\sbin\sshd.exe" SSHD enable=yes
+
+cmd /c if exist %Systemroot%\system32\netsh.exe netsh advfirewall firewall add rule name="ssh" dir=in action=allow protocol=TCP localport=22
+
+%SystemDrive%\cygwin\usr\bin\sleep 2
+
+net start sshd
+
+# Fix corrupt recycle bin
+# http://www.winhelponline.com/blog/fix-corrupted-recycle-bin-windows-7-vista/
+cmd /c rd /s /q c:\$Recycle.bin
+
View
5 templates/windows-2008R1-serverweb-amd64/install-guest-additions.bat
@@ -0,0 +1,5 @@
+# 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 c:\cygwin\bin\wget https://s3-ap-southeast-1.amazonaws.com/vboxfan/4.1.8/VBoxWindowsAdditions-amd64.exe --no-check-certificate
+cmd /c .\VBoxWindowsAdditions-amd64.exe /S
View
2  templates/windows-2008R1-serverweb-amd64/install-vbox-guest.bat
@@ -0,0 +1,2 @@
+cmd /c certutil -addstore -f "TrustedPublisher" a:oracle-cert.cer
+e:\VBoxWindowsAdditions-amd64.exe /S
View
14 templates/windows-2008R1-serverweb-amd64/install-winrm.bat
@@ -0,0 +1,14 @@
+cmd /c winrm quickconfig -q
+cmd /c winrm quickconfig -transport:http # needs to be auto no questions asked
+cmd /c winrm set winrm/config @{MaxTimeoutms="1800000"}
+cmd /c winrm set winrm/config/winrs @{MaxMemoryPerShellMB="300"}
+cmd /c winrm set winrm/config/service @{AllowUnencrypted="true"}
+cmd /c winrm set winrm/config/service/auth @{Basic="true"}
+cmd /c winrm set winrm/config/listener?Address=*+Transport=HTTP @{Port="5985"}
+cmd /c netsh advfirewall firewall set rule group="remote administration" new enable=yes
+cmd /c netsh firewall add portopening TCP 5985 "Port 5985"
+cmd /c net stop winrm
+cmd /c net start winrm
+
+cmd /c reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v ScreenSaveActive /t REG_SZ /d 0 /f
+cmd /c reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v ScreenSaveIsSecure /t REG_SZ /d 0 /f
View
BIN  templates/windows-2008R1-serverweb-amd64/oracle-cert.cer
Binary file not shown
View
74 templates/windows-2008R1-serverweb-amd64/postinstall.sh
@@ -0,0 +1,74 @@
+set -x
+
+# Create the home directory
+mkdir -p /home/vagrant
+chown vagrant /home/vagrant
+cd /home/vagrant
+
+# Install ssh certificates
+mkdir /home/vagrant/.ssh
+chmod 700 /home/vagrant/.ssh
+cd /home/vagrant/.ssh
+wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O authorized_keys
+chown -R vagrant /home/vagrant/.ssh
+cd ..
+
+# Install rpm,apt-get like code for cygwin
+# http://superuser.com/questions/40545/upgrading-and-installing-packages-through-the-cygwin-command-line
+wget http://apt-cyg.googlecode.com/svn/trunk/apt-cyg
+chmod +x apt-cyg
+mv apt-cyg /usr/local/bin/
+
+# 7zip will allow us to extract a file from an ISO
+wget http://downloads.sourceforge.net/sevenzip/7z922-x64.msi
+msiexec /qb /i 7z922-x64.msi
+
+# Download Virtualbox Additions
+#VBOX_VERSION="4.1.8" #"4.0.8"
+#wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
+
+# Extract the installer from the ISO (WHY WHY WHY isn't this available not bundled within an ISO)
+#/cygdrive/c/Program\ Files/7-Zip/7z.exe x VBoxGuestAdditions_$VBOX_VERSION.iso VBoxWindowsAdditions-amd64.exe
+
+# Mark Oracle as a trusted installer
+#http://blogs.msdn.com/b/steverac/archive/2009/07/09/adding-certificates-to-the-local-certificates-store-and-setting-local-policy-using-a-command-line-system-center-updates-publisher-example.aspx
+
+#certutil -addstore -f "TrustedPublisher" a:oracle-cert.cer
+
+# Install the Virtualbox Additions
+#./VBoxWindowsAdditions-amd64.exe /S
+
+
+#Rather than do the manual install of ruby and chef, just use the opscode msi
+curl -L http://www.opscode.com/chef/install.msi -o chef-client-latest.msi
+msiexec /qb /i chef-client-latest.msi
+
+
+#http://www.msfn.org/board/topic/105277-howto-create-a-fully-up-to-date-xp-x64-dvd/
+
+#Making aliases
+cat <<EOF > /home/vagrant/.bash_profile
+alias chef-client="chef-client.bat"
+alias gem="gem.bat"
+alias ruby="ruby.exe"
+alias puppet="puppet.bat"
+alias ohai="ohai.bat"
+alias irb="irb.bat"
+alias facter="facter.bat"
+EOF
+
+
+cat <<'EOF' > /bin/sudo
+#!/usr/bin/bash
+exec "$@"
+EOF
+chmod 755 /bin/sudo
+
+# Mounting a directory
+#net.exe use '\\vboxsvr\veewee-validation'
+
+
+# Reboot
+# http://www.techrepublic.com/blog/datacenter/restart-windows-server-2003-from-the-command-line/245
+shutdown.exe /s /t 0 /d p:2:4 /c "Vagrant initial reboot"
+
View
2  templates/windows-2008R1-serverweb-amd64/sudo
@@ -0,0 +1,2 @@
+#!/usr/bin/bash
+exec "$@"
View
8 templates/windows-2008R1-serverweb-amd64/winrm.rb
@@ -0,0 +1,8 @@
+require 'winrm'
+endpoint = 'http://localhost:5985/wsman'
+winrm=WinRM::WinRMWebService.new(endpoint, :plaintext, :user => 'Administrator', :pass => 'vagrant', :basic_auth_only => true)
+winrm.cmd('ifconfig /all') do |stdout, stderr|
+ STDOUT.print stdout
+ STDERR.print stderr
+end
+#winrm.open_shell
View
142 templates/windows-2008R1-serverweb-i386/Autounattend.xml
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="utf-8"?>
+<unattend xmlns="urn:schemas-microsoft-com:unattend">
+ <servicing></servicing>
+ <settings pass="windowsPE">
+ <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="x86" 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>
+ <component name="Microsoft-Windows-Setup" processorArchitecture="x86" 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>10000</Size>
+ </CreatePartition>
+ </CreatePartitions>
+ <ModifyPartitions>
+ <ModifyPartition wcm:action="add">
+ <Extend>true</Extend>
+ <Format>NTFS</Format>
+ <Label>Windows 2008R1 serverweb</Label>
+ <Letter>C</Letter>
+ <Order>1</Order>
+ <PartitionID>1</PartitionID>
+ </ModifyPartition>
+ </ModifyPartitions>
+ <DiskID>0</DiskID>
+ <WillWipeDisk>true</WillWipeDisk>
+ </Disk>
+ </DiskConfiguration>
+ <ImageInstall>
+ <OSImage>
+ <InstallFrom>
+ <MetaData wcm:action="add">
+ <Key>/IMAGE/NAME</Key>
+ <Value>Windows Longhorn SERVERWEB</Value>
+ </MetaData>
+ </InstallFrom>
+ <InstallTo>
+ <DiskID>0</DiskID>
+ <PartitionID>1</PartitionID>
+ </InstallTo>
+ <InstallToAvailablePartition>false</InstallToAvailablePartition>
+ <WillShowUI>OnError</WillShowUI>
+ </OSImage>
+ </ImageInstall>
+ <UserData>
+ <AcceptEula>true</AcceptEula>
+ <FullName>Vagrant</FullName>
+ <Organization>vagrant</Organization>
+ </UserData>
+ </component>
+ </settings>
+ <settings pass="oobeSystem">
+ <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <AutoLogon>
+ <Password>
+ <Value>dgBhAGcAcgBhAG4AdABQAGEAcwBzAHcAbwByAGQA</Value>
+ <PlainText>false</PlainText>
+ </Password>
+ <Enabled>true</Enabled>
+ <Username>administrator</Username>
+ </AutoLogon>
+ <FirstLogonCommands>
+ <SynchronousCommand wcm:action="add">
+ <CommandLine>cmd.exe /c a:install-winrm.bat</CommandLine>
+ <Description>install winrm</Description>
+ <Order>1</Order>
+ </SynchronousCommand>
+ <SynchronousCommand wcm:action="add">
+ <Order>2</Order>
+ <CommandLine>cmd.exe /c a:install-cygwin-sshd.bat</CommandLine>
+ <Description>install cygwin</Description>
+ </SynchronousCommand>
+ <SynchronousCommand wcm:action="add">
+ <Order>3</Order>
+ <CommandLine>cmd.exe /c a:install-vbox-guest.bat</CommandLine>
+ <Description>install vbox utils</Description>
+ </SynchronousCommand>
+ </FirstLogonCommands>
+ <OOBE>
+ <HideEULAPage>true</HideEULAPage>
+ <NetworkLocation>Home</NetworkLocation>
+ <ProtectYourPC>3</ProtectYourPC>
+ </OOBE>
+ <UserAccounts>
+ <AdministratorPassword>
+ <Value>dgBhAGcAcgBhAG4AdABBAGQAbQBpAG4AaQBzAHQAcgBhAHQAbwByAFAAYQBzAHMAdwBvAHIAZAA=</Value>
+ <PlainText>false</PlainText>
+ </AdministratorPassword>
+ <LocalAccounts>
+ <LocalAccount wcm:action="add">
+ <Password>
+ <Value>dgBhAGcAcgBhAG4AdABQAGEAcwBzAHcAbwByAGQA</Value>
+ <PlainText>false</PlainText>
+ </Password>
+ <Description>vagrant</Description>
+ <DisplayName>Vagrant</DisplayName>
+ <Group>administrators</Group>
+ <Name>vagrant</Name>
+ </LocalAccount>
+ </LocalAccounts>
+ </UserAccounts>
+ <ShowWindowsLive>false</ShowWindowsLive>
+ </component>
+ </settings>
+ <settings pass="specialize">
+ <component name="Microsoft-Windows-OutOfBoxExperience" 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">
+ <DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon>
+ </component>
+ <component name="Microsoft-Windows-ServerManager-SvrMgrNc" 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">
+ <DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon>
+ </component>
+ <component name="Microsoft-Windows-Security-Licensing-SLC-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-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <OEMInformation>
+ <HelpCustomized>false</HelpCustomized>
+ </OEMInformation>
+ <ComputerName>vw-2008R1-web</ComputerName>
+ <TimeZone>New Zealand Standard Time</TimeZone>
+ </component>
+ </settings>
+ <settings pass="generalize">
+ <component name="Microsoft-Windows-Security-Licensing-SLC" 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>
+ <cpi:offlineImage cpi:source="wim:d:/sources/install.wim#Windows Longhorn SERVERWEB" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
+</unattend>
View
136 templates/windows-2008R1-serverweb-i386/README.md
@@ -0,0 +1,136 @@
+## It still asks where do you want to install windows...
+
+You can download a free trial of Windows Server 2008 Enterprise: (60 day eval, expandable to 240 days)
+
+From http://www.microsoft.com/download/en/details.aspx?id=8371
+
+64bit
+url: http://download.microsoft.com/download/B/4/D/B4DC75A1-D7D2-4F31-87F9-E02C950E8D31/6001.18000.080118-1840_amd64fre_Server_en-us-KRMSXFRE_EN_DVD.iso
+filename: 6001.18000.080118-1840_amd64fre_Server_en-us-KRMSXFRE_EN_DVD.iso
+md5sum: 0477c88678efb8ebc5cd7a9e9efd8b82
+
+
+32bit
+url: http://download.microsoft.com/download/B/4/D/B4DC75A1-D7D2-4F31-87F9-E02C950E8D31/6001.18000.080118-1840_x86fre_Server_en-us-KRMSFRE_EN_DVD.iso
+
+
+- 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.
+
+You can download Automated Installation Kit (AIK) for Windows Vista SP1 and Windows Server 2008:
+from http://www.microsoft.com/download/en/details.aspx?id=9085
+file: 6001.18000.080118-1840-kb3aikl_en.iso
+md5sum: b83fad8fd28e637b82cb4a6bef7d6920
+
+- 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 Longhorn install.wim on the install .iso
+
+<InstallFrom>
+ <MetaData wcm:action="add">
+ <Key>/IMAGE/NAME</Key>
+ <Value>Windows Longhorn SERVERSTANDARD</Value> ### This comes from the Name: field below
+ </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 Longhorn SERVERSTANDARD
+Description : Windows Longhorn SERVERSTANDARD
+Size : 8,784,297,519 bytes
+
+Index : 2
+Name : Windows Longhorn SERVERENTERPRISE
+Description : Windows Longhorn SERVERENTERPRISE
+Size : 8,792,036,862 bytes
+
+Index : 3
+Name : Windows Longhorn SERVERDATACENTER
+Description : Windows Longhorn SERVERDATACENTER
+Size : 8,792,568,645 bytes
+
+Index : 4
+Name : Windows Longhorn SERVERSTANDARDCORE
+Description : Windows Longhorn SERVERSTANDARDCORE
+Size : 2,512,939,954 bytes
+
+Index : 5
+Name : Windows Longhorn SERVERENTERPRISECORE
+Description : Windows Longhorn SERVERENTERPRISECORE
+Size : 2,522,686,340 bytes
+
+Index : 6
+Name : Windows Longhorn SERVERDATACENTERCORE
+Description : Windows Longhorn SERVERDATACENTERCORE
+Size : 2,522,615,418 bytes
+
+
+This gets us nearly there, but we still need a winrm provisioner, as I don't like having to install cygwin.
+
+Expose the winrm port:
+
+<pre>
+$ gem install chef
+$ gem install knife-windows
+#Create a tunnel
+$ ssh -p 7222 -L5985:localhost:5985 vagrant@localhost
+$ knife bootstrap windows winrm localhost -x Administrator -P 'vagrant'
+</pre>
+
+
+- http://wiki.opscode.com/display/chef/Knife+Windows+Bootstrap
+- https://github.com/opscode/knife-windows/blob/master/lib/chef/knife/bootstrap/windows-shell.erb
+
+- https://github.com/zenchild/WinRM
+
+- http://devopscloud.net/2011/04/17/managing-chef-from-windows-7/
+- http://devopscloud.net/2011/04/28/powershell-userdata-to-start-a-chef-run/
+- http://devopscloud.net/2011/03/23/dissection-of-a-chef-recipe-or-two-for-windows/
+- https://github.com/pmorton/chef-windows-installer
+
+==
+https://github.com/zenchild/WinRM/issues/unreads#issue/1
+http -> requires unencryptedwinrm quickconfig (said yes to enable firewall)
+winrm p winrm/config/service @{AllowUnencrypted="true"}
+winrm set winrm/config/service/auth @{Basic="true"}netsh advfirewall firewall set rule group="remote administration" new enable=yes
+
+- http://forums.citrix.com/thread.jspa?messageID=1535826
+- http://support.microsoft.com/kb/2019527
+
+winrm get winrm/config
+
+The purpose of configuring WinRM for HTTPS is to encrypt the data being sent across the wire.
+
+WinRM HTTPS requires a local computer "Server Authentication" certificate with a CN matching the hostname, that is not expired, revoked, or self-signed to be installed.
+
+To install or view certificates for the local computer:
+
+- click Start, run, MMC, "File" menu, "Add or Remove Snap-ins" select "Certificates" and click "Add". Go through the wizard selecting "Computer account".
+
+- Install or view the certificates under:
+Certificates (Local computer)
+ Personal
+ Certificates
+
+If you do not have a Sever Authenticating certificate consult your certicate administrator. If you have a microsoft Certificate server you may be abel to request a certificate using the web certificate template from HTTPS://<MyDomainCertificateServer>/certsrv
+
+Once the certificate is installed type the following to configure WINRM to listen on HTTPS:
+
+winrm quickconfig -transport:https
+
+ If you do not have an appropriate certificate you can run the following with the authentication methods configured for WinRM however the data will not be encrypted.
+
+winrm quickconfig
+
View
BIN  templates/windows-2008R1-serverweb-i386/cygwin-setup.exe
Binary file not shown
View
132 templates/windows-2008R1-serverweb-i386/definition.rb
@@ -0,0 +1,132 @@
+# Download Windows Web Server 2008 : (60 day eval, expandable to 240 days)
+# http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=20407
+
+# 64bit
+# http://download.microsoft.com/download/B/4/D/B4DC75A1-D7D2-4F31-87F9-E02C950E8D31/6001.18000.080118-1840_amd64fre_Server_en-us-KRMSXFRE_EN_DVD.iso
+# md5sum 0477c88678efb8ebc5cd7a9e9efd8b82 6001.18000.080118-1840_amd64fre_Server_en-us-KRMSXFRE_EN_DVD.iso
+
+# 32bit
+# http://download.microsoft.com/download/1/e/3/1e332e6c-9f8a-47ba-b380-8fdef29e9d57/6001.18000.080118-1840_x86fre_ServerWeb_en-us-KRMWFRE_EN_DVD.iso
+# md5sum 6001.18000.080118-1840_x86fre_ServerWeb_en-us-KRMWFRE_EN_DVD.iso
+
+
+
+# To get to 2008R1-SP2 you'l need
+
+# 64bit
+# Windows Server 2008 Service Pack 2 and Windows Vista Service Pack 2 - Five Language Standalone for x64-based systems (KB948465)
+# http://www.microsoft.com/download/en/details.aspx?id=17669
+# http://download.microsoft.com/download/4/7/3/473B909B-7B52-49FE-A443-2E2985D3DFC3/Windows6.0-KB948465-X64.exe
+
+# 32bit
+# Windows Server 2008 Service Pack 2 and Windows Vista Service Pack 2 - Five Language Standalone (KB948465)
+# http://www.microsoft.com/download/en/details.aspx?id=16468
+# http://download.microsoft.com/download/E/7/7/E77CBA41-0B6B-4398-BBBF-EE121EEC0535/Windows6.0-KB948465-X86.exe
+
+
+
+# Win2008 requires at least 10gig hard drive to install...
+
+Veewee::Session.declare({
+ :os_type_id => 'Windows2008',
+# :iso_file => "en_windows_web_server_2008_x64_dvd_x14-26683.iso",
+ :iso_file => "6001.18000.080118-1840_x86fre_ServerWeb_en-us-KRMWFRE_EN_DVD.iso",
+ :iso_md5 => "89fbc4c7baafc0b0c05f0fa32c192a17",
+ :iso_src => "http://download.microsoft.com/download/1/e/3/1e332e6c-9f8a-47ba-b380-8fdef29e9d57/6001.18000.080118-1840_x86fre_ServerWeb_en-us-KRMWFRE_EN_DVD.iso",
+ :iso_download_timeout => "1000",
+
+ :cpu_count => '1',
+ :memory_size=> '384',
+ :disk_size => '20280', :disk_format => 'VDI', :hostiocache => 'off',
+
+
+ #:kickstart_port => "7122",
+ #:kickstart_ip => self.local_ip, we could set this manually, I wish we could push this to the
+ #:kickstart_timeout => 1000,
+ #:kickstart_file => ["VBoxWindowsAdditions-amd64.exe"],
+
+ :floppy_files => [
+ "Autounattend.xml", # automate install and setup winrm
+ "install-winrm.bat",
+ "install-cygwin-sshd.bat",
+ "install-vbox-guest.bat",
+ "oracle-cert.cer"
+ ],
+
+ :boot_wait => "50",
+ # after 40 seconds, hit these keys to not enter a product key and fully automate the install
+ # if your machine is slower it may take more time
+ :boot_cmd_sequence => [
+ '<Tab><Tab><Spacebar>',
+ '<Tab><Tab><Tab><Spacebar>',
+ '<Tab><Spacebar>'
+ ],
+
+ :ssh_login_timeout => "10000",
+ # Actively attempt to ssh in for 10000 seconds
+ :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "",
+ :ssh_host_port => "7235", :ssh_guest_port => "22",
+ # And run postinstall.sh for up to 10000 seconds
+ :postinstall_timeout => "10000",
+ :postinstall_files => ["postinstall.sh"],
+ # No sudo on windows
+ :sudo_cmd => "sh '%f'",
+ # Shutdown is different as well
+ :shutdown_cmd => "shutdown /s /t 0 /d P:4:1 /c \"Vagrant Shutdown\"",
+})
+
+
+# To edit the Autounattend.xml and validate it:
+# Download Automated Installation Kit (AIK) for Windows Vista SP1 and Windows Server 2008:
+# http://www.microsoft.com/download/en/details.aspx?id=9085
+# Resulting in 6001.18000.080118-1840-kb3aikl_en.iso
+# md5sum b83fad8fd28e637b82cb4a6bef7d6920 6001.18000.080118-1840-kb3aikl_en.iso
+
+# 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 Longhorn install.wim on the install .iso
+
+# <InstallFrom>
+# <MetaData wcm:action="add">
+# <Key>/IMAGE/NAME</Key>
+# <Value>Windows Longhorn SERVERSTANDARD</Value> ### This comes from the Name: field below
+# </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 Longhorn SERVERSTANDARD
+# Description : Windows Longhorn SERVERSTANDARD
+# Size : 8,784,297,519 bytes
+
+# Index : 2
+# Name : Windows Longhorn SERVERENTERPRISE
+# Description : Windows Longhorn SERVERENTERPRISE
+# Size : 8,792,036,862 bytes
+
+# Index : 3
+# Name : Windows Longhorn SERVERDATACENTER
+# Description : Windows Longhorn SERVERDATACENTER
+# Size : 8,792,568,645 bytes
+
+# Index : 4
+# Name : Windows Longhorn SERVERSTANDARDCORE
+# Description : Windows Longhorn SERVERSTANDARDCORE
+# Size : 2,512,939,954 bytes
+
+# Index : 5
+# Name : Windows Longhorn SERVERENTERPRISECORE
+# Description : Windows Longhorn SERVERENTERPRISECORE
+# Size : 2,522,686,340 bytes
+
+# Index : 6
+# Name : Windows Longhorn SERVERDATACENTERCORE
+# Description : Windows Longhorn SERVERDATACENTERCORE
+# Size : 2,522,615,418 bytes
View
40 templates/windows-2008R1-serverweb-i386/install-cygwin-sshd.bat
@@ -0,0 +1,40 @@
+REM http://webcache.googleusercontent.com/search?q=cache:SjoPPpuQxuoJ:www.tcm.phy.cam.ac.uk/~mr349/cygwin_install.html+install+cygwin+ssh+commandline&cd=2&hl=nl&ct=clnk&gl=be&source=www.google.be
+
+REM create the cygwin directory
+cmd /c mkdir %SystemDrive%\cygwin
+
+cmd /c bitsadmin /transfer CygwinSetupExe /download /priority normal http://www.cygwin.com/setup.exe %SystemDrive%\cygwin\cygwin-setup.exe
+
+REM goto a temp directory
+cd %SystemDrive%\windows\temp
+
+REM run the installation
+cmd /c %SystemDrive%\cygwin\cygwin-setup.exe -q -R %SystemDrive%\cygwin -P openssh,openssl,curl,cygrunsrv,wget,rebase,vim -s http://cygwin.mirrors.pair.com
+
+%SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin cygrunsrv -R sshd'
+
+REM /bin/ash is the right shell for this command
+cmd /c %SystemDrive%\cygwin\bin\ash -c /bin/rebaseall
+
+cmd /c %SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin mkgroup -l'>%SystemDrive%\cygwin\etc\group
+
+cmd /c %SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin mkpasswd -l'>%SystemDrive%\cygwin\etc\passwd
+
+%SystemDrive%\cygwin\usr\bin\sleep 1
+
+%SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin /usr/bin/ssh-host-config -y -c "ntsecbinmode tty" -w "abc&&123!!" '
+
+%SystemDrive%\cygwin\usr\bin\sleep 2
+
+cmd /c if exist %Systemroot%\system32\netsh.exe netsh advfirewall firewall add rule name="SSHD" dir=in action=allow program="c:\cygwin\usr\sbin\sshd.exe" SSHD enable=yes
+
+cmd /c if exist %Systemroot%\system32\netsh.exe netsh advfirewall firewall add rule name="ssh" dir=in action=allow protocol=TCP localport=22
+
+%SystemDrive%\cygwin\usr\bin\sleep 2
+
+net start sshd
+
+# Fix corrupt recycle bin
+# http://www.winhelponline.com/blog/fix-corrupted-recycle-bin-windows-7-vista/
+cmd /c rd /s /q c:\$Recycle.bin
+
View
2  templates/windows-2008R1-serverweb-i386/install-vbox-guest.bat
@@ -0,0 +1,2 @@
+cmd /c certutil -addstore -f "TrustedPublisher" a:oracle-cert.cer
+e:\VBoxWindowsAdditions-x86.exe /S
View
14 templates/windows-2008R1-serverweb-i386/install-winrm.bat
@@ -0,0 +1,14 @@
+cmd /c winrm quickconfig -q
+cmd /c winrm quickconfig -transport:http # needs to be auto no questions asked
+cmd /c winrm set winrm/config @{MaxTimeoutms="1800000"}
+cmd /c winrm set winrm/config/winrs @{MaxMemoryPerShellMB="300"}
+cmd /c winrm set winrm/config/service @{AllowUnencrypted="true"}
+cmd /c winrm set winrm/config/service/auth @{Basic="true"}
+cmd /c winrm set winrm/config/listener?Address=*+Transport=HTTP @{Port="5985"}
+cmd /c netsh advfirewall firewall set rule group="remote administration" new enable=yes
+cmd /c netsh firewall add portopening TCP 5985 "Port 5985"
+cmd /c net stop winrm
+cmd /c net start winrm
+
+cmd /c reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v ScreenSaveActive /t REG_SZ /d 0 /f
+cmd /c reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v ScreenSaveIsSecure /t REG_SZ /d 0 /f
View
BIN  templates/windows-2008R1-serverweb-i386/oracle-cert.cer
Binary file not shown
View
74 templates/windows-2008R1-serverweb-i386/postinstall.sh
@@ -0,0 +1,74 @@
+set -x
+
+# Create the home directory
+mkdir -p /home/vagrant
+chown vagrant /home/vagrant
+cd /home/vagrant
+
+# Install ssh certificates
+mkdir /home/vagrant/.ssh
+chmod 700 /home/vagrant/.ssh
+cd /home/vagrant/.ssh
+wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O authorized_keys
+chown -R vagrant /home/vagrant/.ssh
+cd ..
+
+# Install rpm,apt-get like code for cygwin
+# http://superuser.com/questions/40545/upgrading-and-installing-packages-through-the-cygwin-command-line
+wget http://apt-cyg.googlecode.com/svn/trunk/apt-cyg
+chmod +x apt-cyg
+mv apt-cyg /usr/local/bin/
+
+# 7zip will allow us to extract a file from an ISO
+#wget http://downloads.sourceforge.net/sevenzip/7z922-x64.msi
+#msiexec /qb /i 7z922-x64.msi
+
+# Download Virtualbox Additions
+#VBOX_VERSION="4.1.8" #"4.0.8"
+#wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
+
+# Extract the installer from the ISO (WHY WHY WHY isn't this available not bundled within an ISO)
+#/cygdrive/c/Program\ Files/7-Zip/7z.exe x VBoxGuestAdditions_$VBOX_VERSION.iso VBoxWindowsAdditions-amd64.exe
+
+# Mark Oracle as a trusted installer
+#http://blogs.msdn.com/b/steverac/archive/2009/07/09/adding-certificates-to-the-local-certificates-store-and-setting-local-policy-using-a-command-line-system-center-updates-publisher-example.aspx
+
+#certutil -addstore -f "TrustedPublisher" a:oracle-cert.cer
+
+# Install the Virtualbox Additions
+#./VBoxWindowsAdditions-amd64.exe /S
+
+
+#Rather than do the manual install of ruby and chef, just use the opscode msi
+curl -L http://www.opscode.com/chef/install.msi -o chef-client-latest.msi
+msiexec /qb /i chef-client-latest.msi
+
+
+#http://www.msfn.org/board/topic/105277-howto-create-a-fully-up-to-date-xp-x64-dvd/
+
+#Making aliases
+cat <<EOF > /home/vagrant/.bash_profile
+alias chef-client="chef-client.bat"
+alias gem="gem.bat"
+alias ruby="ruby.exe"
+alias puppet="puppet.bat"
+alias ohai="ohai.bat"
+alias irb="irb.bat"
+alias facter="facter.bat"
+EOF
+
+
+cat <<'EOF' > /bin/sudo
+#!/usr/bin/bash
+exec "$@"
+EOF
+chmod 755 /bin/sudo
+
+# Mounting a directory
+#net.exe use '\\vboxsvr\veewee-validation'
+
+
+# Reboot
+# http://www.techrepublic.com/blog/datacenter/restart-windows-server-2003-from-the-command-line/245
+shutdown.exe /s /t 0 /d p:2:4 /c "Vagrant initial reboot"
+
View
2  templates/windows-2008R1-serverweb-i386/sudo
@@ -0,0 +1,2 @@
+#!/usr/bin/bash
+exec "$@"
View
8 templates/windows-2008R1-serverweb-i386/winrm.rb
@@ -0,0 +1,8 @@
+require 'winrm'
+endpoint = 'http://localhost:5985/wsman'
+winrm=WinRM::WinRMWebService.new(endpoint, :plaintext, :user => 'Administrator', :pass => 'vagrant', :basic_auth_only => true)
+winrm.cmd('ifconfig /all') do |stdout, stderr|
+ STDOUT.print stdout
+ STDERR.print stderr
+end
+#winrm.open_shell
View
162 templates/windows-2008R1-serverwebcore-amd64/Autounattend.xml
@@ -0,0 +1,162 @@
+<?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>
+ <Extend>true</Extend>
+ </CreatePartition>
+ </CreatePartitions>
+ <ModifyPartitions>
+ <ModifyPartition wcm:action="add">
+ <Extend>false</Extend>
+ <Format>NTFS</Format>
+ <Letter>C</Letter>
+ <Order>1</Order>
+ <PartitionID>1</PartitionID>
+ <Label>Windows 2008R1 ServerWebCORE</Label>
+ </ModifyPartition>
+ </ModifyPartitions>
+ <DiskID>0</DiskID>
+ <WillWipeDisk>true</WillWipeDisk>
+ </Disk>
+ <WillShowUI>OnError</WillShowUI>
+ </DiskConfiguration>
+ <UserData>
+ <AcceptEula>true</AcceptEula>
+ <FullName>Vagrant Fullname</FullName>
+ <Organization>Vagrant Inc</Organization>
+ <ProductKey>
+ <WillShowUI>Always</WillShowUI>
+ </ProductKey>
+ </UserData>
+ <ImageInstall>
+ <OSImage>
+ <InstallTo>
+ <DiskID>0</DiskID>
+ <PartitionID>1</PartitionID>
+ </InstallTo>
+ <WillShowUI>OnError</WillShowUI>
+ <InstallToAvailablePartition>false</InstallToAvailablePartition>
+ <InstallFrom>
+ <MetaData wcm:action="add">
+ <Key>/IMAGE/NAME</Key>
+ <Value>Windows Longhorn SERVERWEBCORE</Value>
+ <!-- If Name fails you can the INDEX -->
+ <!-- <Key>/IMAGE/INDEX</Key> -->
+ <!-- <Value>1</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>dgBhAGcAcgBhAG4AdABBAGQAbQBpAG4AaQBzAHQAcgBhAHQAbwByAFAAYQBzAHMAdwBvAHIAZAA=</Value>
+ <PlainText>false</PlainText>
+ </AdministratorPassword>
+ <LocalAccounts>
+ <LocalAccount wcm:action="add">
+ <Password>
+ <Value>dgBhAGcAcgBhAG4AdABQAGEAcwBzAHcAbwByAGQA</Value>
+ <PlainText>false</PlainText>
+ </Password>
+ <Description>Vagrant User</Description>
+ <DisplayName>vagrant</DisplayName>
+ <Group>administrators</Group>
+ <Name>vagrant</Name>
+ </LocalAccount>
+ </LocalAccounts>
+ </UserAccounts>
+ <OOBE>
+ <HideEULAPage>true</HideEULAPage>
+ <NetworkLocation>Home</NetworkLocation>
+ <ProtectYourPC>3</ProtectYourPC>
+ </OOBE>
+ <AutoLogon>
+ <Password>
+ <Value>dgBhAGcAcgBhAG4AdABQAGEAcwBzAHcAbwByAGQA</Value>
+ <PlainText>false</PlainText>
+ </Password>
+ <Username>administrator</Username>
+ <Enabled>true</Enabled>
+ </AutoLogon>
+ <FirstLogonCommands>
+ <SynchronousCommand wcm:action="add">
+ <CommandLine>cmd.exe /c a:install-winrm.bat</CommandLine>
+ <Description>Install Win RM</Description>
+ <Order>1</Order>
+ </SynchronousCommand>
+ <!-- <SynchronousCommand wcm:action="add"> -->
+ <!-- <CommandLine>cmd.exe /c a:install-chefclient.bat</CommandLine> -->
+ <!-- <Description>Install Chef Client</Description> -->
+ <!-- <Order>2</Order> -->
+ <!-- </SynchronousCommand> -->
+ <SynchronousCommand wcm:action="add">
+ <CommandLine>cmd.exe /c a:install-cygwin-sshd.bat</CommandLine>
+ <Description>Install Cygwin SSHD</Description>
+ <Order>2</Order>
+ </SynchronousCommand>
+ <SynchronousCommand wcm:action="add">
+ <CommandLine>cmd.exe /c a:install-vbox-guest.bat</CommandLine>
+ <Description>Install Virtualbox Guest Utilities</Description>
+ <Order>3</Order>
+ </SynchronousCommand>
+ <!-- needed wget -->
+ <!-- <SynchronousCommand wcm:action="add"> -->
+ <!-- <CommandLine>cmd.exe /c a:install-guest-additions.bat</CommandLine> -->
+ <!-- <Description>Install Virtualbox Guest Additions</Description> -->
+ <!-- <Order>3</Order> -->
+ <!-- </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>webcore-2K8R1</ComputerName>
+ <TimeZone>New Zealand Standard Time</TimeZone>
+ <RegisteredOwner></RegisteredOwner>
+ </component>
+ <component name="Microsoft-Windows-OutOfBoxExperience" 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">
+ <DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon>
+ </component>
+ <component name="Microsoft-Windows-ServerManager-SvrMgrNc" 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">
+ <DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon>
+ </component>
+ <component name="Microsoft-Windows-Security-Licensing-SLC-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>
+ </settings>
+ <settings pass="generalize">
+ <component name="Microsoft-Windows-Security-Licensing-SLC" 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>
+ <cpi:offlineImage cpi:source="wim:d:/sources/install.wim#Windows Longhorn SERVERWEB" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
+</unattend>
View
134 templates/windows-2008R1-serverwebcore-amd64/README.md
@@ -0,0 +1,134 @@
+You can download a free trial of Windows Server 2008 Enterprise: (60 day eval, expandable to 240 days)
+
+From http://www.microsoft.com/download/en/details.aspx?id=8371
+
+64bit
+url: http://download.microsoft.com/download/B/4/D/B4DC75A1-D7D2-4F31-87F9-E02C950E8D31/6001.18000.080118-1840_amd64fre_Server_en-us-KRMSXFRE_EN_DVD.iso
+filename: 6001.18000.080118-1840_amd64fre_Server_en-us-KRMSXFRE_EN_DVD.iso
+md5sum: 0477c88678efb8ebc5cd7a9e9efd8b82
+
+
+32bit
+url: http://download.microsoft.com/download/B/4/D/B4DC75A1-D7D2-4F31-87F9-E02C950E8D31/6001.18000.080118-1840_x86fre_Server_en-us-KRMSFRE_EN_DVD.iso
+
+
+- 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.
+
+You can download Automated Installation Kit (AIK) for Windows Vista SP1 and Windows Server 2008:
+from http://www.microsoft.com/download/en/details.aspx?id=9085
+file: 6001.18000.080118-1840-kb3aikl_en.iso
+md5sum: b83fad8fd28e637b82cb4a6bef7d6920
+
+- 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 Longhorn install.wim on the install .iso
+
+<InstallFrom>
+ <MetaData wcm:action="add">
+ <Key>/IMAGE/NAME</Key>
+ <Value>Windows Longhorn SERVERSTANDARD</Value> ### This comes from the Name: field below
+ </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 Longhorn SERVERSTANDARD
+Description : Windows Longhorn SERVERSTANDARD
+Size : 8,784,297,519 bytes
+
+Index : 2
+Name : Windows Longhorn SERVERENTERPRISE
+Description : Windows Longhorn SERVERENTERPRISE
+Size : 8,792,036,862 bytes
+
+Index : 3
+Name : Windows Longhorn SERVERDATACENTER
+Description : Windows Longhorn SERVERDATACENTER
+Size : 8,792,568,645 bytes
+
+Index : 4
+Name : Windows Longhorn SERVERSTANDARDCORE
+Description : Windows Longhorn SERVERSTANDARDCORE
+Size : 2,512,939,954 bytes
+
+Index : 5
+Name : Windows Longhorn SERVERENTERPRISECORE
+Description : Windows Longhorn SERVERENTERPRISECORE
+Size : 2,522,686,340 bytes
+
+Index : 6
+Name : Windows Longhorn SERVERDATACENTERCORE
+Description : Windows Longhorn SERVERDATACENTERCORE
+Size : 2,522,615,418 bytes
+
+
+This gets us nearly there, but we still need a winrm provisioner, as I don't like having to install cygwin.
+
+Expose the winrm port:
+
+<pre>
+$ gem install chef
+$ gem install knife-windows
+#Create a tunnel
+$ ssh -p 7222 -L5985:localhost:5985 vagrant@localhost
+$ knife bootstrap windows winrm localhost -x Administrator -P 'vagrant'
+</pre>
+
+
+- http://wiki.opscode.com/display/chef/Knife+Windows+Bootstrap
+- https://github.com/opscode/knife-windows/blob/master/lib/chef/knife/bootstrap/windows-shell.erb
+
+- https://github.com/zenchild/WinRM
+
+- http://devopscloud.net/2011/04/17/managing-chef-from-windows-7/
+- http://devopscloud.net/2011/04/28/powershell-userdata-to-start-a-chef-run/
+- http://devopscloud.net/2011/03/23/dissection-of-a-chef-recipe-or-two-for-windows/
+- https://github.com/pmorton/chef-windows-installer
+
+==
+https://github.com/zenchild/WinRM/issues/unreads#issue/1
+http -> requires unencryptedwinrm quickconfig (said yes to enable firewall)
+winrm p winrm/config/service @{AllowUnencrypted="true"}
+winrm set winrm/config/service/auth @{Basic="true"}netsh advfirewall firewall set rule group="remote administration" new enable=yes
+
+- http://forums.citrix.com/thread.jspa?messageID=1535826
+- http://support.microsoft.com/kb/2019527
+
+winrm get winrm/config
+
+The purpose of configuring WinRM for HTTPS is to encrypt the data being sent across the wire.
+
+WinRM HTTPS requires a local computer "Server Authentication" certificate with a CN matching the hostname, that is not expired, revoked, or self-signed to be installed.
+
+To install or view certificates for the local computer:
+
+- click Start, run, MMC, "File" menu, "Add or Remove Snap-ins" select "Certificates" and click "Add". Go through the wizard selecting "Computer account".
+
+- Install or view the certificates under:
+Certificates (Local computer)
+ Personal
+ Certificates
+
+If you do not have a Sever Authenticating certificate consult your certicate administrator. If you have a microsoft Certificate server you may be abel to request a certificate using the web certificate template from HTTPS://<MyDomainCertificateServer>/certsrv
+
+Once the certificate is installed type the following to configure WINRM to listen on HTTPS:
+
+winrm quickconfig -transport:https
+
+ If you do not have an appropriate certificate you can run the following with the authentication methods configured for WinRM however the data will not be encrypted.
+
+winrm quickconfig
+
View
BIN  templates/windows-2008R1-serverwebcore-amd64/cygwin-setup.exe
Binary file not shown
View
132 templates/windows-2008R1-serverwebcore-amd64/definition.rb
@@ -0,0 +1,132 @@
+# Download Windows Web Server 2008 : (60 day eval, expandable to 240 days)
+# http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=20407
+
+# 64bit
+# http://download.microsoft.com/download/B/4/D/B4DC75A1-D7D2-4F31-87F9-E02C950E8D31/6001.18000.080118-1840_amd64fre_Server_en-us-KRMSXFRE_EN_DVD.iso
+# md5sum 0477c88678efb8ebc5cd7a9e9efd8b82 6001.18000.080118-1840_amd64fre_Server_en-us-KRMSXFRE_EN_DVD.iso
+
+# 32bit
+# http://download.microsoft.com/download/B/4/D/B4DC75A1-D7D2-4F31-87F9-E02C950E8D31/6001.18000.080118-1840_x86fre_Server_en-us-KRMSFRE_EN_DVD.iso
+
+
+
+# To get to 2008R1-SP2 you'l need
+
+# 64bit
+# Windows Server 2008 Service Pack 2 and Windows Vista Service Pack 2 - Five Language Standalone for x64-based systems (KB948465)
+# http://www.microsoft.com/download/en/details.aspx?id=17669
+# http://download.microsoft.com/download/4/7/3/473B909B-7B52-49FE-A443-2E2985D3DFC3/Windows6.0-KB948465-X64.exe
+
+# 32bit
+# Windows Server 2008 Service Pack 2 and Windows Vista Service Pack 2 - Five Language Standalone (KB948465)
+# http://www.microsoft.com/download/en/details.aspx?id=16468
+# http://download.microsoft.com/download/E/7/7/E77CBA41-0B6B-4398-BBBF-EE121EEC0535/Windows6.0-KB948465-X86.exe
+
+
+
+# Win2008 requires at least 10gig hard drive to install...
+
+Veewee::Session.declare({
+ :os_type_id => 'Windows2008_64',
+# :iso_file => "en_windows_web_server_2008_x64_dvd_x14-26683.iso",
+ :iso_file => "6001.18000.080118-1840_amd64fre_ServerWeb_en-us-KRMWXFRE_EN_DVD.iso",
+ :iso_md5 => "a95ad42cee261333d28891f4868e6d3b",
+ :iso_src => "http://download.microsoft.com/download/1/e/3/1e332e6c-9f8a-47ba-b380-8fdef29e9d57/6001.18000.080118-1840_amd64fre_ServerWeb_en-us-KRMWXFRE_EN_DVD.iso",
+ :iso_download_timeout => "1000",
+
+ :cpu_count => '1',
+ :memory_size=> '384',
+ :disk_size => '20280', :disk_format => 'VDI', :hostiocache => 'off',
+
+
+ #:kickstart_port => "7122",
+ #:kickstart_ip => self.local_ip, we could set this manually, I wish we could push this to the
+ #:kickstart_timeout => 1000,
+ #:kickstart_file => ["VBoxWindowsAdditions-amd64.exe"],
+
+ :floppy_files => [
+ "Autounattend.xml", # automate install and setup winrm
+ "install-winrm.bat",
+ "install-cygwin-sshd.bat",
+ "install-vbox-guest.bat",
+ "cygwin-setup.exe",
+ "oracle-cert.cer"
+ ],
+
+ :boot_wait => "60",
+ # after 40-60 seconds, hit these keys to not enter a product key and fully automate the install
+ # if your machine is slower it may take more time
+ :boot_cmd_sequence => [
+ '<Tab><Tab><Spacebar>',
+ '<Tab><Tab><Tab><Spacebar>',
+ '<Tab><Spacebar>'
+ ],
+
+ :ssh_login_timeout => "10000",
+ # Actively attempt to ssh in for 10000 seconds
+ :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "",
+ :ssh_host_port => "7234", :ssh_guest_port => "22",
+ # And run postinstall.sh for up to 10000 seconds
+ :postinstall_timeout => "10000",
+ :postinstall_files => ["postinstall.sh"],
+ # No sudo on windows
+ :sudo_cmd => "sh '%f'",
+ # Shutdown is different as well
+ :shutdown_cmd => "shutdown /s /t 0 /d P:4:1 /c \"Vagrant Shutdown\"",
+})
+
+
+# To edit the Autounattend.xml and validate it:
+# Download Automated Installation Kit (AIK) for Windows Vista SP1 and Windows Server 2008:
+# http://www.microsoft.com/download/en/details.aspx?id=9085
+# Resulting in 6001.18000.080118-1840-kb3aikl_en.iso
+# md5sum b83fad8fd28e637b82cb4a6bef7d6920 6001.18000.080118-1840-kb3aikl_en.iso
+
+# 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 Longhorn install.wim on the install .iso
+
+# <InstallFrom>
+# <MetaData wcm:action="add">
+# <Key>/IMAGE/NAME</Key>
+# <Value>Windows Longhorn SERVERSTANDARD</Value> ### This comes from the Name: field below
+# </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 Longhorn SERVERSTANDARD
+# Description : Windows Longhorn SERVERSTANDARD
+# Size : 8,784,297,519 bytes
+
+# Index : 2
+# Name : Windows Longhorn SERVERENTERPRISE
+# Description : Windows Longhorn SERVERENTERPRISE
+# Size : 8,792,036,862 bytes
+
+# Index : 3
+# Name : Windows Longhorn SERVERDATACENTER
+# Description : Windows Longhorn SERVERDATACENTER
+# Size : 8,792,568,645 bytes
+
+# Index : 4
+# Name : Windows Longhorn SERVERSTANDARDCORE
+# Description : Windows Longhorn SERVERSTANDARDCORE
+# Size : 2,512,939,954 bytes
+
+# Index : 5
+# Name : Windows Longhorn SERVERENTERPRISECORE
+# Description : Windows Longhorn SERVERENTERPRISECORE
+# Size : 2,522,686,340 bytes
+
+# Index : 6
+# Name : Windows Longhorn SERVERDATACENTERCORE
+# Description : Windows Longhorn SERVERDATACENTERCORE
+# Size : 2,522,615,418 bytes
View
41 templates/windows-2008R1-serverwebcore-amd64/install-cygwin-sshd.bat
@@ -0,0 +1,41 @@
+REM http://webcache.googleusercontent.com/search?q=cache:SjoPPpuQxuoJ:www.tcm.phy.cam.ac.uk/~mr349/cygwin_install.html+install+cygwin+ssh+commandline&cd=2&hl=nl&ct=clnk&gl=be&source=www.google.be
+
+REM create the cygwin directory
+cmd /c mkdir %SystemDrive%\cygwin
+copy a:\cygwin-setup.exe %SystemDrive%\cygwin
+
+REM goto a temp directory
+cd %SystemDrive%\windows\temp
+
+REM run the installation
+cmd /c a:/cygwin-setup.exe -q -R %SystemDrive%\cygwin -P openssh,openssl,curl,cygrunsrv,wget,rebase,vim -s http://cygwin.mirrors.pair.com
+
+%SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin cygrunsrv -R sshd'
+
+REM /bin/ash is the right shell for this command
+cmd /c %SystemDrive%\cygwin\bin\ash -c /bin/rebaseall
+
+cmd /c %SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin mkgroup -l'>%SystemDrive%\cygwin\etc\group
+
+cmd /c %SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin mkpasswd -l'>%SystemDrive%\cygwin\etc\passwd
+
+%SystemDrive%\cygwin\usr\bin\sleep 1
+
+%SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin /usr/bin/ssh-host-config -y -c "ntsecbinmode tty" -w "abc&&123!!" '
+
+%SystemDrive%\cygwin\usr\bin\sleep 2
+
+cmd /c if exist %Systemroot%\system32\netsh.exe netsh advfirewall firewall add rule name="SSHD" dir=in action=allow program="c:\cygwin\usr\sbin\sshd.exe" SSHD enable=yes
+
+cmd /c if exist %Systemroot%\system32\netsh.exe netsh advfirewall firewall add rule name="ssh" dir=in action=allow protocol=TCP localport=22
+
+%SystemDrive%\cygwin\usr\bin\sleep 2
+
+net start sshd
+
+# Fix corrupt recycle bin
+# http://www.winhelponline.com/blog/fix-corrupted-recycle-bin-windows-7-vista/
+cmd /c rd /s /q c:\$Recycle.bin
+
+copy a:\sudo %SystemDrive%\cygwin\usr\local\bin
+cmd /c %SystemDrive%\cygwin\bin\chmod 755 %SystemDrive%\cygwin\usr\local\bin\sudo
View
2  templates/windows-2008R1-serverwebcore-amd64/install-vbox-guest.bat
@@ -0,0 +1,2 @@
+cmd /c certutil -addstore -f "TrustedPublisher" a:oracle-cert.cer
+e:\VBoxWindowsAdditions-amd64.exe /S
View
14 templates/windows-2008R1-serverwebcore-amd64/install-winrm.bat
@@ -0,0 +1,14 @@
+cmd /c winrm quickconfig -q
+cmd /c winrm quickconfig -transport:http # needs to be auto no questions asked
+cmd /c winrm set winrm/config @{MaxTimeoutms="1800000"}
+cmd /c winrm set winrm/config/winrs @{MaxMemoryPerShellMB="300"}
+cmd /c winrm set winrm/config/service @{AllowUnencrypted="true"}
+cmd /c winrm set winrm/config/service/auth @{Basic="true"}
+cmd /c winrm set winrm/config/listener?Address=*+Transport=HTTP @{Port="5985"}
+cmd /c netsh advfirewall firewall set rule group="remote administration" new enable=yes
+cmd /c netsh firewall add portopening TCP 5985 "Port 5985"
+cmd /c net stop winrm
+cmd /c net start winrm
+
+cmd /c reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v ScreenSaveActive /t REG_SZ /d 0 /f
+cmd /c reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v ScreenSaveIsSecure /t REG_SZ /d 0 /f
View
BIN  templates/windows-2008R1-serverwebcore-amd64/oracle-cert.cer
Binary file not shown
View
74 templates/windows-2008R1-serverwebcore-amd64/postinstall.sh
@@ -0,0 +1,74 @@
+set -x
+
+# Create the home directory
+mkdir -p /home/vagrant
+chown vagrant /home/vagrant
+cd /home/vagrant
+
+# Install ssh certificates
+mkdir /home/vagrant/.ssh
+chmod 700 /home/vagrant/.ssh
+cd /home/vagrant/.ssh
+wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O authorized_keys
+chown -R vagrant /home/vagrant/.ssh
+cd ..
+
+# Install rpm,apt-get like code for cygwin
+# http://superuser.com/questions/40545/upgrading-and-installing-packages-through-the-cygwin-command-line
+wget http://apt-cyg.googlecode.com/svn/trunk/apt-cyg
+chmod +x apt-cyg
+mv apt-cyg /usr/local/bin/
+
+# 7zip will allow us to extract a file from an ISO
+wget http://downloads.sourceforge.net/sevenzip/7z922-x64.msi
+msiexec /qb /i 7z922-x64.msi
+
+# Download Virtualbox Additions
+VBOX_VERSION="4.1.8" #"4.0.8"
+wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
+
+# Extract the installer from the ISO (WHY WHY WHY isn't this available not bundled within an ISO)
+/cygdrive/c/Program\ Files/7-Zip/7z.exe x VBoxGuestAdditions_$VBOX_VERSION.iso VBoxWindowsAdditions-amd64.exe
+
+# Mark Oracle as a trusted installer
+#http://blogs.msdn.com/b/steverac/archive/2009/07/09/adding-certificates-to-the-local-certificates-store-and-setting-local-policy-using-a-command-line-system-center-updates-publisher-example.aspx
+
+certutil -addstore -f "TrustedPublisher" a:oracle-cert.cer
+
+# Install the Virtualbox Additions
+./VBoxWindowsAdditions-amd64.exe /S
+
+
+#Rather than do the manual install of ruby and chef, just use the opscode msi
+curl -L http://www.opscode.com/chef/install.msi -o chef-client-latest.msi
+msiexec /qb /i chef-client-latest.msi
+
+
+#http://www.msfn.org/board/topic/105277-howto-create-a-fully-up-to-date-xp-x64-dvd/
+
+#Making aliases
+cat <<EOF > /home/vagrant/.bash_profile
+alias chef-client="chef-client.bat"
+alias gem="gem.bat"
+alias ruby="ruby.exe"
+alias puppet="puppet.bat"
+alias ohai="ohai.bat"
+alias irb="irb.bat"
+alias facter="facter.bat"
+EOF
+
+
+cat <<'EOF' > /bin/sudo
+#!/usr/bin/bash
+exec "$@"
+EOF
+chmod 755 /bin/sudo
+
+# Mounting a directory
+net.exe use '\\vboxsvr\veewee-validation'
+
+
+# Reboot
+# http://www.techrepublic.com/blog/datacenter/restart-windows-server-2003-from-the-command-line/245
+shutdown.exe /s /t 0 /d p:2:4 /c "Vagrant initial reboot"
+
View
2  templates/windows-2008R1-serverwebcore-amd64/sudo
@@ -0,0 +1,2 @@
+#!/usr/bin/bash
+exec "$@"
View
8 templates/windows-2008R1-serverwebcore-amd64/winrm.rb
@@ -0,0 +1,8 @@
+require 'winrm'
+endpoint = 'http://localhost:5985/wsman'
+winrm=WinRM::WinRMWebService.new(endpoint, :plaintext, :user => 'Administrator', :pass => 'vagrant', :basic_auth_only => true)
+winrm.cmd('ifconfig /all') do |stdout, stderr|
+ STDOUT.print stdout
+ STDERR.print stderr
+end
+#winrm.open_shell
View
1  templates/windows-2008R2-serverstandard-amd64/definition.rb
@@ -13,7 +13,6 @@
:floppy_files => [
"Autounattend.xml", # automate install and setup winrm
- "cygwin-setup.exe",
"install-cygwin-sshd.bat",
"install-winrm.bat",
"oracle-cert.cer"],
View
151 templates/windows-2008R2-serverweb-amd64/Autounattend.xml
@@ -0,0 +1,151 @@
+<?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>10000</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 Webserver</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 -->
+ <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 Server 2008 R2 SERVERWEB</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>dgBhAGcAcgBhAG4AdABBAGQAbQBpAG4AaQBzAHQAcgBhAHQAbwByAFAAYQBzAHMAdwBvAHIAZAA=</Value>
+ <PlainText>false</PlainText>
+ </AdministratorPassword>
+ <LocalAccounts>
+ <LocalAccount wcm:action="add">
+ <Password>
+ <Value>dgBhAGcAcgBhAG4AdABQAGEAcwBzAHcAbwByAGQA</Value>
+ <PlainText>false</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>dgBhAGcAcgBhAG4AdABQAGEAcwBzAHcAbwByAGQA</Value>
+ <PlainText>false</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 a:install-vbox-guest.bat</CommandLine>
+ <Description>Install VBox Guest</Description>
+ <Order>3</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>
+ <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-Security-SPP-UX" processorArchitecture="wow64" 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>
+ <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>
+ <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>
+ <cpi:offlineImage cpi:source="wim:d:/sources/install.wim#Windows Server 2008 R2 SERVERWEB" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
+</unattend>
View
142 templates/windows-2008R2-serverweb-amd64/README.md
@@ -0,0 +1,142 @@
+You can download a free trial of Windows Server 2008 R2 with Service Pack 1:
+
+url: http://technet.microsoft.com/en-us/evalcenter/dd459137.aspx
+url: http://msdn.microsoft.com/en-us/evalcenter/ee175713.aspx
+
+64bit
+file: 7601.17514.101119-1850_x64fre_server_eval_en-us-GRMSXEVAL_EN_DVD.iso
+md5sum: 4263be2cf3c59177c45085c0a7bc6ca5
+
+- 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 2008r2 install.wim on the install DVD .iso
+
+ # <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.
+
+
+This gets us nearly there, but we still need a winrm provisioner, as I don't like having to install cygwin.
+
+Expose the winrm port:
+
+<pre>
+$ gem install chef
+$ gem install knife-windows
+#Create a tunnel
+$ ssh -p 7222 -L5985:localhost:5985 vagrant@localhost
+$ knife bootstrap windows winrm localhost -x Administrator -P 'vagrant'
+</pre>
+
+
+- http://wiki.opscode.com/display/chef/Knife+Windows+Bootstrap
+- https://github.com/opscode/knife-windows/blob/master/lib/chef/knife/bootstrap/windows-shell.erb
+
+- https://github.com/zenchild/WinRM
+
+- http://devopscloud.net/2011/04/17/managing-chef-from-windows-7/
+- http://devopscloud.net/2011/04/28/powershell-userdata-to-start-a-chef-run/
+- http://devopscloud.net/2011/03/23/dissection-of-a-chef-recipe-or-two-for-windows/
+- https://github.com/pmorton/chef-windows-installer
+
+==
+https://github.com/zenchild/WinRM/issues/unreads#issue/1
+http -> requires unencryptedwinrm quickconfig (said yes to enable firewall)
+winrm p winrm/config/service @{AllowUnencrypted="true"}
+winrm set winrm/config/service/auth @{Basic="true"}netsh advfirewall firewall set rule group="remote administration" new enable=yes
+
+- http://forums.citrix.com/thread.jspa?messageID=1535826
+- http://support.microsoft.com/kb/2019527
+
+winrm get winrm/config
+
+The purpose of configuring WinRM for HTTPS is to encrypt the data being sent across the wire.
+
+WinRM HTTPS requires a local computer "Server Authentication" certificate with a CN matching the hostname, that is not expired, revoked, or self-signed to be installed.
+
+To install or view certificates for the local computer:
+
+- click Start, run, MMC, "File" menu, "Add or Remove Snap-ins" select "Certificates" and click "Add". Go through the wizard selecting "Computer account".
+
+- Install or view the certificates under:
+Certificates (Local computer)
+ Personal
+ Certificates
+
+If you do not have a Sever Authenticating certificate consult your certicate administrator. If you have a microsoft Certificate server you may be abel to request a certificate using the web certificate template from HTTPS://<MyDomainCertificateServer>/certsrv
+
+Once the certificate is installed type the following to configure WINRM to listen on HTTPS:
+
+winrm quickconfig -transport:https
+
+ If you do not have an appropriate certificate you can run the following with the authentication methods configured for WinRM however the data will not be encrypted.
+
+winrm quickconfig
+
View
38 templates/windows-2008R2-serverweb-amd64/definition.rb
@@ -0,0 +1,38 @@
+# -*- coding: utf-8 -*-
+Veewee::Session.declare({
+ :os_type_id => 'Windows2008_64',
+ # http://technet.microsoft.com/en-us/evalcenter/dd459137.aspx
+ # Download and install full featured software for 180-day trial
+ :iso_file => "7601.17514.101119-1850_x64fre_server_eval_en-us-GRMSXEVAL_EN_DVD.iso",
+ :iso_md5 => "4263be2cf3c59177c45085c0a7bc6ca5",
+ :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_download_timeout => "1000",
+ :cpu_count => '1',
+ :memory_size=> '384',
+ :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off',
+
+ :floppy_files => [
+ "Autounattend.xml", # automate install and setup winrm
+ "install-cygwin-sshd.bat",
+ "install-winrm.bat",
+ "install-vbox-guest.bat",
+ "oracle-cert.cer"],
+
+ :boot_wait => "1",
+ :boot_cmd_sequence => [''],
+
+ :ssh_login_timeout => "10000",
+ # Actively attempt to winrm (no ssh on base windows) in for 10000 seconds
+ :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "",
+ :ssh_host_port => "59856", :ssh_guest_port => "22", # this still uses cygwinsshd
+ #:ssh_host_port => "59856", :ssh_guest_port => "5985", # NO winrm... yet
+ # And run postinstall.sh for up to 10000 seconds
+ :postinstall_timeout => "10000",
+ :postinstall_files => ["postinstall.sh"],
+ # No sudo on windows
+ :sudo_cmd => "sh '%f'",
+ # Shutdown is different as well
+ :shutdown_cmd => "shutdown /s /t 60 /d p:4:1 /c \"Vagrant Shutdown\"",
+})
+
+
View
40 templates/windows-2008R2-serverweb-amd64/install-cygwin-sshd.bat
@@ -0,0 +1,40 @@
+REM http://webcache.googleusercontent.com/search?q=cache:SjoPPpuQxuoJ:www.tcm.phy.cam.ac.uk/~mr349/cygwin_install.html+install+cygwin+ssh+commandline&cd=2&hl=nl&ct=clnk&gl=be&source=www.google.be
+
+REM create the cygwin directory
+cmd /c mkdir %SystemDrive%\cygwin
+
+cmd /c bitsadmin /transfer CygwinSetupExe /download /priority normal http://www.cygwin.com/setup.exe %SystemDrive%\cygwin\cygwin-setup.exe
+
+REM goto a temp directory
+cd %SystemDrive%\windows\temp
+
+REM run the installation
+cmd /c %SystemDrive%\cygwin\cygwin-setup.exe -q -R %SystemDrive%\cygwin -P openssh,openssl,curl,cygrunsrv,wget,rebase,vim -s http://cygwin.mirrors.pair.com
+
+%SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin cygrunsrv -R sshd'
+
+REM /bin/ash is the right shell for this command
+cmd /c %SystemDrive%\cygwin\bin\ash -c /bin/rebaseall
+
+cmd /c %SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin mkgroup -l'>%SystemDrive%\cygwin\etc\group
+
+cmd /c %SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin mkpasswd -l'>%SystemDrive%\cygwin\etc\passwd
+
+%SystemDrive%\cygwin\usr\bin\sleep 1
+
+%SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin /usr/bin/ssh-host-config -y -c "ntsecbinmode tty" -w "abc&&123!!" '
+
+%SystemDrive%\cygwin\usr\bin\sleep 2
+
+cmd /c if exist %Systemroot%\system32\netsh.exe netsh advfirewall firewall add rule name="SSHD" dir=in action=allow program="c:\cygwin\usr\sbin\sshd.exe" SSHD enable=yes
+
+cmd /c if exist %Systemroot%\system32\netsh.exe netsh advfirewall firewall add rule name="ssh" dir=in action=allow protocol=TCP localport=22
+
+%SystemDrive%\cygwin\usr\bin\sleep 2
+
+net start sshd
+