Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updated win7 ultimate amd64

  • Loading branch information...
commit a51e1b2581c40910f551fbe81dae53496f5976dc 1 parent bfb76e3
@hh hh authored
View
4 templates/windows-7-ultimate-amd64/Autounattend.xml
@@ -43,8 +43,8 @@
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>2</Order>
- <CommandLine>cmd.exe /c a:install-chefclient.bat</CommandLine>
- <Description>Install chefclient</Description>
+ <CommandLine>cmd.exe /c a:install-cygwin-sshd.bat</CommandLine>
+ <Description>Install cygwin sshd</Description>
<RequiresUserInput>false</RequiresUserInput>
</SynchronousCommand>
</FirstLogonCommands>
View
94 templates/windows-7-ultimate-amd64/README.md
@@ -1,30 +1,7 @@
-You can download a free trial of Windows 7 Enterprise 90-day Trial
-
-url: http://technet.microsoft.com/en-us/evalcenter/cc442495.aspx
-file: 7600.16385.090713-1255_x64fre_enterprise_en-us_EVAL_Eval_Enterprise-GRMCENXEVAL_EN_DVD.iso
-md5sum: 1d0d239a252cb53e466d39e752b17c28
-
-'''
-PS C:\Users\Administrator> Dism /Get-WIMInfo /WimFile:d:\sources\install.wim
-
-Deployment Image Servicing and Management tool
-Version: 6.1.7600.16385
-
-Details for image : d:\sources\install.wim
-
-Index : 1
-Name : Windows 7 ENTERPRISE
-Description : Windows 7 ENTERPRISE
-Size : 11,913,037,777 bytes
-
-The operation completed successfully.
-'''
-
-Though I have also used "Windows 7 7600 AIO.ISO" from MSDN
+This uses the All In One "Windows 7 7600 AIO.ISO" from MSDN
file: Windows 7 7600 AIO.ISO
md5sum: ace6c61269613bf515fd59c62185bbcf
-
'''
PS C:\Users\Administrator> Dism /Get-WIMInfo /WimFile:d:\sources\install.wim
@@ -102,68 +79,11 @@ AIK also includes dism, which will allow you to choose a specific version:
If you want to install a different version, edit Autoattended.xml and replace the /IMAGE/NAME value with
one of the names listed in the sources/install.wim on the install DVD .iso
- # <InstallFrom>
- # <MetaData wcm:action="add">
- # <Key>/IMAGE/NAME</Key>
- # <Value>Windows Server 2008 R2 SERVERSTANDARD</Value>
- # </MetaData>
- # </InstallFrom>
-
-
-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.
+# <InstallFrom>
+# <MetaData wcm:action="add">
+# <Key>/IMAGE/NAME</Key>
+# <Value>Windows 7 ULTIMATE</Value>
+# </MetaData>
+# </InstallFrom>
-winrm quickconfig
View
11 templates/windows-7-ultimate-amd64/definition.rb
@@ -15,11 +15,14 @@
:floppy_files => [
"Autounattend.xml",
"install-winrm.bat",
- "install-chefclient.bat"
+ "oracle-cert.cer",
+ "install-cygwin-sshd.bat"
],
- :boot_wait => "660", #ten minutes, ten seconds
+ :boot_wait => "720", #12 minutes.. should be long enough
+ # this is waiting for the screene where we could put in our product key
+ # this is the command sequence to bybass it and to not try to register once online
:boot_cmd_sequence => [
'<Tab><Spacebar><Tab><Tab><Tab><Spacebar>'
],
@@ -27,12 +30,12 @@
: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 => "59857", :ssh_guest_port => "5985",
+ :ssh_host_port => "59857", :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 /p /t 60 /c \"Vagrant Shutdown\" /f /d p:4:1",
+ :shutdown_cmd => "shutdown /s /t 0 /c \"Vagrant Shutdown\" /f /d p:4:1",
})
View
44 templates/windows-7-ultimate-amd64/install-chefclient.bat
@@ -1,44 +0,0 @@
-mkdir C:\chef
-
-> C:\chef\wget.vbs (
-echo.url = WScript.Arguments.Named^("url"^)
-echo.path = WScript.Arguments.Named^("path"^)
-echo.Set objXMLHTTP = CreateObject^("MSXML2.ServerXMLHTTP"^)
-echo.Set wshShell = CreateObject^( "WScript.Shell" ^)
-echo.Set objUserVariables = wshShell.Environment^("USER"^)
-echo.
-echo.'http proxy is optional
-echo.'attempt to read from HTTP_PROXY env var first
-echo.On Error Resume Next
-echo.
-echo.If NOT ^(objUserVariables^("HTTP_PROXY"^) = ""^) Then
-echo.objXMLHTTP.setProxy 2, objUserVariables^("HTTP_PROXY"^)
-echo.
-echo.'fall back to named arg
-echo.ElseIf NOT ^(WScript.Arguments.Named^("proxy"^) = ""^) Then
-echo.objXMLHTTP.setProxy 2, WScript.Arguments.Named^("proxy"^)
-echo.End If
-echo.
-echo.On Error Goto 0
-echo.
-echo.objXMLHTTP.open "GET", url, false
-echo.objXMLHTTP.send^(^)
-echo.If objXMLHTTP.Status = 200 Then
-echo.Set objADOStream = CreateObject^("ADODB.Stream"^)
-echo.objADOStream.Open
-echo.objADOStream.Type = 1
-echo.objADOStream.Write objXMLHTTP.ResponseBody
-echo.objADOStream.Position = 0
-echo.Set objFSO = Createobject^("Scripting.FileSystemObject"^)
-echo.If objFSO.Fileexists^(path^) Then objFSO.DeleteFile path
-echo.Set objFSO = Nothing
-echo.objADOStream.SaveToFile path
-echo.objADOStream.Close
-echo.Set objADOStream = Nothing
-echo.End if
-echo.Set objXMLHTTP = Nothing
-)
-
-@rem Install Chef using chef-client MSI installer
-cscript /nologo C:\chef\wget.vbs /url:http://www.opscode.com/chef/install.msi /path:%TEMP%\chef-client-latest.msi
-msiexec /qb /i %TEMP%\chef-client-latest.msi
View
5 templates/windows-7-ultimate-amd64/install-winrm.bat
@@ -1,5 +1,5 @@
cmd /c winrm quickconfig -q
-cmd /c winrm quickconfig -transport:http
+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"}
@@ -9,3 +9,6 @@ cmd /c netsh advfirewall firewall set rule group="remote administration" new ena
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
102 templates/windows-7-ultimate-amd64/postinstall.sh
@@ -1,5 +1,7 @@
+set -x
+
# Create the home directory
-mkdir /home/vagrant
+mkdir -p /home/vagrant
chown vagrant /home/vagrant
cd /home/vagrant
@@ -17,32 +19,16 @@ wget http://apt-cyg.googlecode.com/svn/trunk/apt-cyg
chmod +x apt-cyg
mv apt-cyg /usr/local/bin/
-# Download Daemontools Lite
-# This needs some fixing as the url seems to change every X time ...
-#wget http://www.daemon-tools.cc/eng/downloads/dtproAdv
-#cat http://www.daemon-tools.cc/eng/downloads/dtLite|grep <div download ...>
-URL=$(curl -L http://www.daemon-tools.cc/eng/downloads/dtLite|grep http|grep exe|cut -d '"' -f 4)
-curl -L $URL -o daemontools.exe
-
-#curl -L http://disc-tools.com/request?p=70e5b112a42060a5439c5edec8e4f8c3/DTLite4402-0131.exe -o daemontools.exe
-chmod +x daemontools.exe
-
-# Silent install Daemontools
-# http://www.daemon-help.com/en/installation_notes_lite/installation_lite.html
-# Silent install - http://forum.daemon-tools.cc/f24/dt-4-08-a-15030/
-./daemontools.exe /S
+# 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.6"
+VBOX_VERSION="4.1.8" #"4.0.8"
wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
-# Mount iso file
-# http://www.daemon-help.com/en/windows_integration_lite/command_line_parameters.html
-# /cygdrive/c/Program Files (x86)/DAEMON Tools Pro
-cd "/cygdrive/c/Program Files (x86)/DAEMON Tools Lite"
-./DTLite.exe &
-sleep 2
-./DTLite.exe -mount 0,"c:\cygwin\home\vagrant\VBoxGuestAdditions_4.1.6.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
@@ -50,59 +36,15 @@ sleep 2
certutil -addstore -f "TrustedPublisher" a:oracle-cert.cer
# Install the Virtualbox Additions
-cd /cygdrive/e
-./VBoxWindowsAdditions.exe /S
-
-#http://www.msfn.org/board/topic/105277-howto-create-a-fully-up-to-date-xp-x64-dvd/
+./VBoxWindowsAdditions-amd64.exe /S
-# Unmount ISO file
-cd "/cygdrive/c/Program Files (x86)/DAEMON Tools Lite"
-./DTLite.exe -unmount 0
-# Next step is get ruby working
-# But thanks to opscode's work , that should not be an issue
-# https://github.com/opscode/knife-windows/blob/master/lib/chef/knife/bootstrap/windows-shell.erb
+#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
-#Installing ruby
-cd /home/vagrant
-# Ruby 1.9
-#wget http://rubyforge.org/frs/download.php/74298/rubyinstaller-1.9.2-p180.exe -O rubyinstaller.exe
-# Ruby 1.8
-wget http://files.rubyforge.vm.bytemark.co.uk/rubyinstaller/rubyinstaller-1.8.7-p334.exe -O rubyinstaller.exe
-
-chmod +x rubyinstaller.exe
-./rubyinstaller.exe /verysilent /dir="C:\ruby" /tasks="assocfiles,modpath" /SUPPRESSMSGBOXES
-
-# Now add it to the path cmd, and cygwin path
-# http://serverfault.com/questions/63017/how-do-i-modify-the-system-path-in-windows-2003-windows-2008-using-a-script
-/cygdrive/c/Windows/System32/setx.exe PATH "c:\windows\system32;c:\ruby\bin" /M
-export PATH=$PATH:/cygdrive/c/ruby/bin
-
-# Install Ruby dev kit (native extensions)
-mkdir /cygdrive/c/devkit
-cd /cygdrive/c/devkit
-wget --no-check-certificate http://github.com/downloads/oneclick/rubyinstaller/DevKit-tdm-32-4.5.1-20101214-1400-sfx.exe -O rubydevkit.exe
-chmod +x rubydevkit.exe
-./rubydevkit -y
-ruby dk.rb init
-ruby dk.rb install
-
-# Installing puppet
-gem.bat install puppet --no-rdoc --no-ri --verbose
-gem install sys-admin win32-process win32-dir win32-service win32-taskscheduler --no-rdoc --no-ri --verbose
-# Installing chef required gems on windows
-# For ruby 1.8
-gem.bat install win32-open3 ruby-wmi windows-api windows-pr --no-rdoc --no-ri --verbose
-# For ruby 1.9
-#gem.bat install win32-open3 rdp-ruby-wmi windows-api windows-pr --no-rdoc --no-ri --verbose
-
-# Install chef
-gem.bat install ohai --no-rdoc --no-ri --verbose
-gem.bat install chef --no-rdoc --no-ri --verbose
-
-# Currently 1.9 ruby + chef 10 doesn't seem to be able to
-#http://stackoverflow.com/questions/4819807/ohai-fails-to-determine-os-version-in-cygwin
+#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
@@ -115,10 +57,18 @@ alias irb="irb.bat"
alias facter="facter.bat"
EOF
-# Reboot
-# http://www.techrepublic.com/blog/datacenter/restart-windows-server-2003-from-the-command-line/245
-shutdown.exe /r /t 0 /c "Vagrant initial reboot"
+
+cat <<'EOF' > /bin/sudo
+#!/usr/bin/bash
+exec "$@"
+EOF
+chmod 755 /bin/sudo
# Mounting a directory
-#./net.exe use x: \\vboxsvr\veewee-validation
+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
8 templates/windows-7-ultimate-amd64/winrm.rb
@@ -1,8 +0,0 @@
-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
Please sign in to comment.
Something went wrong with that request. Please try again.