Permalink
Browse files

new versions of windows

  • Loading branch information...
1 parent 05e4c00 commit 6c0e3ec6b332a7c7a666c0159b9a30fec5e302d4 @hh hh committed Jan 4, 2012
Showing with 1,675 additions and 38 deletions.
  1. 0 templates/{windows-2008-amd64 → windows-2008R1-serverstandard-amd64}/Autounattend.xml
  2. 0 templates/{windows-2008-amd64 → windows-2008R1-serverstandard-amd64}/README.md
  3. BIN templates/{windows-2008-amd64 → windows-2008R1-serverstandard-amd64}/cygwin-setup.exe
  4. +1 −1 templates/{windows-2008-amd64 → windows-2008R1-serverstandard-amd64}/definition.rb
  5. +41 −0 templates/windows-2008R1-serverstandard-amd64/install-cygwin-sshd.bat
  6. 0 templates/{windows-2008-amd64 → windows-2008R1-serverstandard-amd64}/install-guest-additions.bat
  7. +11 −0 templates/windows-2008R1-serverstandard-amd64/install-winrm.bat
  8. BIN templates/{windows-2008-amd64 → windows-2008R1-serverstandard-amd64}/oracle-cert.cer
  9. +74 −0 templates/windows-2008R1-serverstandard-amd64/postinstall.sh
  10. +2 −0 templates/windows-2008R1-serverstandard-amd64/sudo
  11. 0 templates/{windows-2008-amd64 → windows-2008R1-serverstandard-amd64}/winrm.rb
  12. +2 −2 templates/{windows-2008R2-standard-amd64 → windows-2008R2-serverstandard-amd64}/Autounattend.xml
  13. 0 templates/{windows-2008R2-standard-amd64 → windows-2008R2-serverstandard-amd64}/README.md
  14. BIN templates/windows-2008R2-serverstandard-amd64/cygwin-setup.exe
  15. +2 −2 templates/{windows-2008R2-standard-amd64 → windows-2008R2-serverstandard-amd64}/definition.rb
  16. +41 −0 templates/windows-2008R2-serverstandard-amd64/install-cygwin-sshd.bat
  17. +5 −0 templates/windows-2008R2-serverstandard-amd64/install-guest-additions.bat
  18. +11 −0 templates/windows-2008R2-serverstandard-amd64/install-winrm.bat
  19. BIN templates/{windows-2008R2-standard-amd64 → windows-2008R2-serverstandard-amd64}/oracle-cert.cer
  20. +74 −0 templates/windows-2008R2-serverstandard-amd64/postinstall.sh
  21. +151 −0 templates/windows-7-enterprise-amd64/Autounattend.xml
  22. +169 −0 templates/windows-7-enterprise-amd64/README.md
  23. +42 −0 templates/windows-7-enterprise-amd64/definition.rb
  24. +44 −0 templates/windows-7-enterprise-amd64/install-chefclient.bat
  25. 0 templates/{windows-2008-amd64 → windows-7-enterprise-amd64}/install-winrm.bat
  26. BIN templates/windows-7-enterprise-amd64/oracle-cert.cer
  27. +43 −28 templates/{windows-2008-amd64 → windows-7-enterprise-amd64}/postinstall.sh
  28. 0 templates/{windows-2008R2-standard-amd64 → windows-7-enterprise-amd64}/winrm.rb
  29. +151 −0 templates/windows-7-enterprise-i386/Autounattend.xml
  30. +169 −0 templates/windows-7-enterprise-i386/README.md
  31. +42 −0 templates/windows-7-enterprise-i386/definition.rb
  32. +44 −0 templates/windows-7-enterprise-i386/install-chefclient.bat
  33. +6 −1 templates/{windows-2008R2-standard-amd64 → windows-7-enterprise-i386}/install-winrm.bat
  34. BIN templates/windows-7-enterprise-i386/oracle-cert.cer
  35. +124 −0 templates/windows-7-enterprise-i386/postinstall.sh
  36. +8 −0 templates/windows-7-enterprise-i386/winrm.rb
  37. +1 −0 templates/windows-7-ultimate-amd64/Autounattend.xml
  38. +3 −2 templates/windows-7-ultimate-amd64/definition.rb
  39. +6 −1 templates/windows-7-ultimate-amd64/install-winrm.bat
  40. +1 −1 templates/windows-7-ultimate-amd64/postinstall.sh
  41. +140 −0 templates/windows-8-preview-dev-amd64/Autounattend.xml
  42. +134 −0 templates/windows-8-preview-dev-amd64/README.md
  43. BIN templates/windows-8-preview-dev-amd64/cygwin-setup.exe
  44. +114 −0 templates/windows-8-preview-dev-amd64/definition.rb
  45. 0 templates/{windows-2008-amd64 → windows-8-preview-dev-amd64}/install-cygwin-sshd.bat
  46. +11 −0 templates/windows-8-preview-dev-amd64/install-winrm.bat
  47. BIN templates/windows-8-preview-dev-amd64/oracle-cert.cer
  48. 0 templates/{windows-2008R2-standard-amd64 → windows-8-preview-dev-amd64}/postinstall.sh
  49. +8 −0 templates/windows-8-preview-dev-amd64/winrm.rb
@@ -55,7 +55,7 @@
# No sudo on windows
:sudo_cmd => "sh '%f'",
# Shutdown is different as well
- :shutdown_cmd => "shutdown -P now",
+ :shutdown_cmd => "shutdown /s /t 0 /d P:4:1 /c \"Vagrant Shutdown\"",
})
@@ -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
@@ -0,0 +1,11 @@
+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
@@ -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/7z920-x64.msi
+msiexec /qb /i 7z920-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 /r /t 0 /d p:2:4 /c "Vagrant initial reboot"
+
@@ -0,0 +1,2 @@
+#!/usr/bin/bash
+exec "$@"
@@ -36,8 +36,8 @@
</DiskConfiguration>
<UserData>
-
- <ProductKey>
+ <!-- Product Key from http://technet.microsoft.com/en-us/library/ff793406.aspx -->
+ <ProductKey>YC6KT-GKW9T-YTKYR-T4X34-R7VHC
<WillShowUI>Never</WillShowUI>
</ProductKey>
Binary file not shown.
@@ -23,7 +23,7 @@
:boot_cmd_sequence => [
'<Tab><Tab><Tab><Enter>',
'<Enter>'
- ]
+ ],
:ssh_login_timeout => "10000",
# Actively attempt to winrm (no ssh on base windows) in for 10000 seconds
@@ -35,7 +35,7 @@
# No sudo on windows
:sudo_cmd => "sh '%f'",
# Shutdown is different as well
- :shutdown_cmd => "shutdown /p /t 60 /c \"Vagrant Shutdown\" /f /d p:4:1",
+ :shutdown_cmd => "shutdown /s /t 60 /d p:4:1 /c \"Vagrant Shutdown\"",
})
@@ -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
@@ -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
@@ -0,0 +1,11 @@
+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
@@ -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/7z920-x64.msi
+msiexec /qb /i 7z920-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 /r /t 0 /d p:2:4 /c "Vagrant initial reboot"
+
Oops, something went wrong.

0 comments on commit 6c0e3ec

Please sign in to comment.