veewee 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. data/Gemfile +1 -1
  2. data/Gemfile.lock +75 -0
  3. data/lib/veewee.rb +2 -0
  4. data/lib/veewee/command.rb +1 -59
  5. data/lib/veewee/command/basebox.rb +63 -0
  6. data/lib/veewee/command/basebox_build.rb +32 -0
  7. data/lib/veewee/command/basebox_define.rb +28 -0
  8. data/lib/veewee/command/basebox_destroy.rb +22 -0
  9. data/lib/veewee/command/basebox_export.rb +22 -0
  10. data/lib/veewee/command/basebox_list.rb +23 -0
  11. data/lib/veewee/command/basebox_ostypes.rb +23 -0
  12. data/lib/veewee/command/basebox_templates.rb +23 -0
  13. data/lib/veewee/command/basebox_undefine.rb +22 -0
  14. data/lib/veewee/command/basebox_validate.rb +26 -0
  15. data/lib/veewee/config.rb +1 -2
  16. data/lib/veewee/version.rb +1 -1
  17. data/templates/CentOS-6.0-x86_64-minimal/definition.rb +1 -1
  18. data/templates/CentOS-6.0-x86_64-minimal/postinstall.sh +12 -4
  19. data/templates/CentOS-6.2-x86_64-minimal/definition.rb +15 -0
  20. data/templates/CentOS-6.2-x86_64-minimal/ks.cfg +37 -0
  21. data/templates/CentOS-6.2-x86_64-minimal/postinstall.sh +50 -0
  22. data/templates/SLES-11-SP1-DVD-i586-GM/autoinst_de.xml +1127 -0
  23. data/templates/SLES-11-SP1-DVD-i586-GM/autoinst_en.xml +1127 -0
  24. data/templates/SLES-11-SP1-DVD-i586-GM/definition.rb +37 -0
  25. data/templates/SLES-11-SP1-DVD-i586-GM/postinstall.sh +43 -0
  26. data/templates/SLES-11-SP1-DVD-x86_64-GM/autoinst_de.xml +1171 -0
  27. data/templates/SLES-11-SP1-DVD-x86_64-GM/autoinst_en.xml +1171 -0
  28. data/templates/SLES-11-SP1-DVD-x86_64-GM/definition.rb +37 -0
  29. data/templates/SLES-11-SP1-DVD-x86_64-GM/postinstall.sh +43 -0
  30. data/templates/funtoo-latest-generic_64-stable/definition.rb +34 -0
  31. data/templates/funtoo-latest-generic_64-stable/postinstall.sh +177 -0
  32. data/templates/funtoo-latest-generic_64-stable/postinstall2.sh +83 -0
  33. data/templates/gentoo-latest-x86_64-experimental/definition.rb +4 -4
  34. data/templates/gentoo-latest-x86_64-experimental/postinstall.sh +2 -2
  35. data/templates/openSUSE-12.1-DVD+NET-i586/autoinst_de.xml +1483 -0
  36. data/templates/openSUSE-12.1-DVD+NET-i586/autoinst_en.xml +1483 -0
  37. data/templates/openSUSE-12.1-DVD+NET-i586/definition.rb +44 -0
  38. data/templates/openSUSE-12.1-DVD+NET-i586/postinstall.sh +43 -0
  39. data/templates/openSUSE-12.1-DVD+NET-x86_64/autoinst_de.xml +1727 -0
  40. data/templates/openSUSE-12.1-DVD+NET-x86_64/autoinst_en.xml +1727 -0
  41. data/templates/openSUSE-12.1-DVD+NET-x86_64/definition.rb +44 -0
  42. data/templates/openSUSE-12.1-DVD+NET-x86_64/postinstall.sh +43 -0
  43. data/templates/openbsd50_amd64/README +28 -0
  44. data/templates/openbsd50_amd64/definition.rb +84 -0
  45. data/templates/openbsd50_amd64/postinstall.sh +81 -0
  46. data/templates/openbsd50_i386/.definition.rb.swp +0 -0
  47. data/templates/openbsd50_i386/README +28 -0
  48. data/templates/openbsd50_i386/definition.rb +84 -0
  49. data/templates/openbsd50_i386/postinstall.sh +80 -0
  50. data/templates/windows-2008R1-serverstandard-amd64/Autounattend.xml +146 -0
  51. data/templates/windows-2008R1-serverstandard-amd64/README.md +134 -0
  52. data/templates/windows-2008R1-serverstandard-amd64/cygwin-setup.exe +0 -0
  53. data/templates/windows-2008R1-serverstandard-amd64/definition.rb +114 -0
  54. data/templates/windows-2008R1-serverstandard-amd64/install-cygwin-sshd.bat +40 -0
  55. data/templates/windows-2008R1-serverstandard-amd64/install-guest-additions.bat +5 -0
  56. data/templates/windows-2008R1-serverstandard-amd64/install-winrm.bat +14 -0
  57. data/templates/windows-2008R1-serverstandard-amd64/oracle-cert.cer +0 -0
  58. data/templates/windows-2008R1-serverstandard-amd64/postinstall.sh +74 -0
  59. data/templates/windows-2008R1-serverstandard-amd64/sudo +2 -0
  60. data/templates/windows-2008R1-serverstandard-amd64/winrm.rb +8 -0
  61. data/templates/windows-2008R2-amd64/cygwin-setup.exe +0 -0
  62. data/templates/windows-2008R2-amd64/install-winrm.bat +2 -0
  63. data/templates/windows-2008R2-serverstandard-amd64/Autounattend.xml +147 -0
  64. data/templates/windows-2008R2-serverstandard-amd64/README.md +142 -0
  65. data/templates/windows-2008R2-serverstandard-amd64/definition.rb +44 -0
  66. data/templates/windows-2008R2-serverstandard-amd64/install-cygwin-sshd.bat +41 -0
  67. data/templates/windows-2008R2-serverstandard-amd64/install-winrm.bat +11 -0
  68. data/templates/windows-2008R2-serverstandard-amd64/oracle-cert.cer +0 -0
  69. data/templates/windows-2008R2-serverstandard-amd64/postinstall.sh +74 -0
  70. data/templates/windows-7-enterprise-amd64/Autounattend.xml +149 -0
  71. data/templates/windows-7-enterprise-amd64/README.md +52 -0
  72. data/templates/windows-7-enterprise-amd64/definition.rb +39 -0
  73. data/templates/windows-7-enterprise-amd64/install-cygwin-sshd.bat +40 -0
  74. data/templates/windows-7-enterprise-amd64/install-winrm.bat +14 -0
  75. data/templates/windows-7-enterprise-amd64/oracle-cert.cer +0 -0
  76. data/templates/windows-7-enterprise-amd64/postinstall.sh +74 -0
  77. data/templates/windows-7-enterprise-i386/Autounattend.xml +151 -0
  78. data/templates/windows-7-enterprise-i386/README.md +169 -0
  79. data/templates/windows-7-enterprise-i386/definition.rb +40 -0
  80. data/templates/windows-7-enterprise-i386/install-cygwin-sshd.bat +40 -0
  81. data/templates/windows-7-enterprise-i386/install-winrm.bat +14 -0
  82. data/templates/windows-7-enterprise-i386/oracle-cert.cer +0 -0
  83. data/templates/windows-7-enterprise-i386/postinstall.sh +74 -0
  84. data/templates/windows-7-premium-amd64/Autounattend.xml +152 -0
  85. data/templates/windows-7-premium-amd64/README.md +171 -0
  86. data/templates/windows-7-premium-amd64/definition.rb +38 -0
  87. data/templates/windows-7-premium-amd64/install-chefclient.bat +44 -0
  88. data/templates/windows-7-premium-amd64/install-winrm.bat +11 -0
  89. data/templates/windows-7-premium-amd64/oracle-cert.cer +0 -0
  90. data/templates/windows-7-premium-amd64/postinstall.sh +124 -0
  91. data/templates/windows-7-premium-amd64/winrm.rb +8 -0
  92. data/templates/windows-7-professional-amd64/Autounattend.xml +152 -0
  93. data/templates/windows-7-professional-amd64/README.md +171 -0
  94. data/templates/windows-7-professional-amd64/definition.rb +41 -0
  95. data/templates/windows-7-professional-amd64/install-cygwin-sshd.bat +40 -0
  96. data/templates/windows-7-professional-amd64/install-winrm.bat +14 -0
  97. data/templates/windows-7-professional-amd64/oracle-cert.cer +0 -0
  98. data/templates/windows-7-professional-amd64/postinstall.sh +74 -0
  99. data/templates/windows-7-ultimate-amd64/Autounattend.xml +152 -0
  100. data/templates/windows-7-ultimate-amd64/README.md +89 -0
  101. data/templates/windows-7-ultimate-amd64/definition.rb +41 -0
  102. data/templates/windows-7-ultimate-amd64/install-cygwin-sshd.bat +40 -0
  103. data/templates/windows-7-ultimate-amd64/install-winrm.bat +14 -0
  104. data/templates/windows-7-ultimate-amd64/oracle-cert.cer +0 -0
  105. data/templates/windows-7-ultimate-amd64/postinstall.sh +74 -0
  106. data/templates/windows-7sp1-ultimate-amd64/Autounattend.xml +152 -0
  107. data/templates/windows-7sp1-ultimate-amd64/README.md +89 -0
  108. data/templates/windows-7sp1-ultimate-amd64/definition.rb +42 -0
  109. data/templates/windows-7sp1-ultimate-amd64/install-cygwin-sshd.bat +40 -0
  110. data/templates/windows-7sp1-ultimate-amd64/install-winrm.bat +14 -0
  111. data/templates/windows-7sp1-ultimate-amd64/oracle-cert.cer +0 -0
  112. data/templates/windows-7sp1-ultimate-amd64/postinstall.sh +74 -0
  113. data/templates/windows-8-preview-dev-amd64/Autounattend.xml +140 -0
  114. data/templates/windows-8-preview-dev-amd64/README.md +134 -0
  115. data/templates/windows-8-preview-dev-amd64/cygwin-setup.exe +0 -0
  116. data/templates/windows-8-preview-dev-amd64/definition.rb +114 -0
  117. data/templates/windows-8-preview-dev-amd64/install-cygwin-sshd.bat +38 -0
  118. data/templates/windows-8-preview-dev-amd64/install-winrm.bat +11 -0
  119. data/templates/windows-8-preview-dev-amd64/oracle-cert.cer +0 -0
  120. data/templates/windows-8-preview-dev-amd64/postinstall.sh +122 -0
  121. data/templates/windows-8-preview-dev-amd64/winrm.rb +8 -0
  122. data/veewee.gemspec +3 -2
  123. metadata +162 -34
@@ -0,0 +1,74 @@
1
+ set -x
2
+
3
+ # Create the home directory
4
+ mkdir -p /home/vagrant
5
+ chown vagrant /home/vagrant
6
+ cd /home/vagrant
7
+
8
+ # Install ssh certificates
9
+ mkdir /home/vagrant/.ssh
10
+ chmod 700 /home/vagrant/.ssh
11
+ cd /home/vagrant/.ssh
12
+ wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O authorized_keys
13
+ chown -R vagrant /home/vagrant/.ssh
14
+ cd ..
15
+
16
+ # Install rpm,apt-get like code for cygwin
17
+ # http://superuser.com/questions/40545/upgrading-and-installing-packages-through-the-cygwin-command-line
18
+ wget http://apt-cyg.googlecode.com/svn/trunk/apt-cyg
19
+ chmod +x apt-cyg
20
+ mv apt-cyg /usr/local/bin/
21
+
22
+ # 7zip will allow us to extract a file from an ISO
23
+ wget http://downloads.sourceforge.net/sevenzip/7z922-x64.msi
24
+ msiexec /qb /i 7z922-x64.msi
25
+
26
+ # Download Virtualbox Additions
27
+ VBOX_VERSION="4.1.8" #"4.0.8"
28
+ wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
29
+
30
+ # Extract the installer from the ISO (WHY WHY WHY isn't this available not bundled within an ISO)
31
+ /cygdrive/c/Program\ Files/7-Zip/7z.exe x VBoxGuestAdditions_$VBOX_VERSION.iso VBoxWindowsAdditions-amd64.exe
32
+
33
+ # Mark Oracle as a trusted installer
34
+ #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
35
+
36
+ certutil -addstore -f "TrustedPublisher" a:oracle-cert.cer
37
+
38
+ # Install the Virtualbox Additions
39
+ ./VBoxWindowsAdditions-amd64.exe /S
40
+
41
+
42
+ #Rather than do the manual install of ruby and chef, just use the opscode msi
43
+ curl -L http://www.opscode.com/chef/install.msi -o chef-client-latest.msi
44
+ msiexec /qb /i chef-client-latest.msi
45
+
46
+
47
+ #http://www.msfn.org/board/topic/105277-howto-create-a-fully-up-to-date-xp-x64-dvd/
48
+
49
+ #Making aliases
50
+ cat <<EOF > /home/vagrant/.bash_profile
51
+ alias chef-client="chef-client.bat"
52
+ alias gem="gem.bat"
53
+ alias ruby="ruby.exe"
54
+ alias puppet="puppet.bat"
55
+ alias ohai="ohai.bat"
56
+ alias irb="irb.bat"
57
+ alias facter="facter.bat"
58
+ EOF
59
+
60
+
61
+ cat <<'EOF' > /bin/sudo
62
+ #!/usr/bin/bash
63
+ exec "$@"
64
+ EOF
65
+ chmod 755 /bin/sudo
66
+
67
+ # Mounting a directory
68
+ net.exe use '\\vboxsvr\veewee-validation'
69
+
70
+
71
+ # Reboot
72
+ # http://www.techrepublic.com/blog/datacenter/restart-windows-server-2003-from-the-command-line/245
73
+ shutdown.exe /s /t 0 /d p:2:4 /c "Vagrant initial reboot"
74
+
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/bash
2
+ exec "$@"
@@ -0,0 +1,8 @@
1
+ require 'winrm'
2
+ endpoint = 'http://localhost:5985/wsman'
3
+ winrm=WinRM::WinRMWebService.new(endpoint, :plaintext, :user => 'Administrator', :pass => 'vagrant', :basic_auth_only => true)
4
+ winrm.cmd('ifconfig /all') do |stdout, stderr|
5
+ STDOUT.print stdout
6
+ STDERR.print stderr
7
+ end
8
+ #winrm.open_shell
@@ -4,3 +4,5 @@ cmd /c winrm set winrm/config/winrs @{MaxMemoryPerShellMB="300"}
4
4
  cmd /c winrm set winrm/config/service @{AllowUnencrypted="true"}
5
5
  cmd /c winrm set winrm/config/service/auth @{Basic="true"}
6
6
  cmd /c netsh advfirewall firewall set rule group="remote administration" new enable=yes
7
+ cmd /c netsh advfirewall firewall set rule group="network discovery" new enable=yes
8
+ ; cmd /c net use x: \\vboxsrv\sharename
@@ -0,0 +1,147 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <unattend xmlns="urn:schemas-microsoft-com:unattend">
3
+ <servicing></servicing>
4
+
5
+ <settings pass="windowsPE">
6
+
7
+ <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">
8
+
9
+ <DiskConfiguration>
10
+ <Disk wcm:action="add">
11
+
12
+ <CreatePartitions>
13
+ <CreatePartition wcm:action="add">
14
+ <Order>1</Order>
15
+ <Type>Primary</Type>
16
+ <Size>10000</Size>
17
+ </CreatePartition>
18
+ </CreatePartitions>
19
+
20
+ <ModifyPartitions>
21
+ <ModifyPartition wcm:action="add">
22
+ <Extend>false</Extend>
23
+ <Format>NTFS</Format>
24
+ <Letter>C</Letter>
25
+ <Order>1</Order>
26
+ <PartitionID>1</PartitionID>
27
+ <Label>Windows 2008R2</Label>
28
+ </ModifyPartition>
29
+ </ModifyPartitions>
30
+
31
+ <DiskID>0</DiskID>
32
+ <WillWipeDisk>true</WillWipeDisk>
33
+
34
+ </Disk>
35
+ <WillShowUI>OnError</WillShowUI>
36
+ </DiskConfiguration>
37
+
38
+ <UserData>
39
+ <!-- Product Key from http://technet.microsoft.com/en-us/library/ff793406.aspx -->
40
+ <ProductKey>YC6KT-GKW9T-YTKYR-T4X34-R7VHC
41
+ <WillShowUI>Never</WillShowUI>
42
+ </ProductKey>
43
+
44
+ <AcceptEula>true</AcceptEula>
45
+ <FullName>Vagrant Fullname</FullName>
46
+ <Organization>Vagrant Inc</Organization>
47
+ </UserData>
48
+
49
+ <ImageInstall>
50
+ <OSImage>
51
+ <InstallTo>
52
+ <DiskID>0</DiskID>
53
+ <PartitionID>1</PartitionID>
54
+ </InstallTo>
55
+ <WillShowUI>OnError</WillShowUI>
56
+ <InstallToAvailablePartition>false</InstallToAvailablePartition>
57
+ <InstallFrom>
58
+ <MetaData wcm:action="add">
59
+ <Key>/IMAGE/NAME</Key>
60
+ <Value>Windows Server 2008 R2 SERVERSTANDARD</Value>
61
+ </MetaData>
62
+ </InstallFrom>
63
+ </OSImage>
64
+ </ImageInstall>
65
+
66
+ </component>
67
+
68
+ <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">
69
+ <SetupUILanguage>
70
+ <UILanguage>en-US</UILanguage>
71
+ </SetupUILanguage>
72
+ <InputLocale>en-US</InputLocale>
73
+ <SystemLocale>en-US</SystemLocale>
74
+ <UILanguage>en-US</UILanguage>
75
+ <UILanguageFallback>en-US</UILanguageFallback>
76
+ <UserLocale>en-US</UserLocale>
77
+ </component>
78
+ </settings>
79
+
80
+
81
+ <settings pass="oobeSystem">
82
+ <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">
83
+ <UserAccounts>
84
+ <AdministratorPassword>
85
+ <Value>dgBhAGcAcgBhAG4AdABBAGQAbQBpAG4AaQBzAHQAcgBhAHQAbwByAFAAYQBzAHMAdwBvAHIAZAA=</Value>
86
+ <PlainText>false</PlainText>
87
+ </AdministratorPassword>
88
+ <LocalAccounts>
89
+ <LocalAccount wcm:action="add">
90
+ <Password>
91
+ <Value>dgBhAGcAcgBhAG4AdABQAGEAcwBzAHcAbwByAGQA</Value>
92
+ <PlainText>false</PlainText>
93
+ </Password>
94
+ <Description>Vagrant User</Description>
95
+ <DisplayName>vagrant</DisplayName>
96
+ <Group>administrators</Group>
97
+ <Name>vagrant</Name>
98
+ </LocalAccount>
99
+ </LocalAccounts>
100
+ </UserAccounts>
101
+ <OOBE>
102
+ <HideEULAPage>true</HideEULAPage>
103
+ <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
104
+ <NetworkLocation>Home</NetworkLocation>
105
+ </OOBE>
106
+ <AutoLogon>
107
+ <Password>
108
+ <Value>dgBhAGcAcgBhAG4AdABQAGEAcwBzAHcAbwByAGQA</Value>
109
+ <PlainText>false</PlainText>
110
+ </Password>
111
+ <Username>administrator</Username>
112
+ <Enabled>true</Enabled>
113
+ </AutoLogon>
114
+ <FirstLogonCommands>
115
+ <SynchronousCommand wcm:action="add">
116
+ <CommandLine>cmd.exe /c a:install-cygwin-sshd.bat</CommandLine>
117
+ <Description>Install Cygwin SSH</Description>
118
+ <Order>1</Order>
119
+ <RequiresUserInput>true</RequiresUserInput>
120
+ </SynchronousCommand>
121
+ <SynchronousCommand wcm:action="add">
122
+ <CommandLine>cmd.exe /c a:install-winrm.bat</CommandLine>
123
+ <Description>Install Win RM</Description>
124
+ <Order>2</Order>
125
+ <RequiresUserInput>true</RequiresUserInput>
126
+ </SynchronousCommand>
127
+
128
+ </FirstLogonCommands>
129
+ <ShowWindowsLive>false</ShowWindowsLive>
130
+ </component>
131
+ </settings>
132
+ <settings pass="specialize">
133
+ <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" >
134
+ <OEMInformation>
135
+ <HelpCustomized>false</HelpCustomized>
136
+ </OEMInformation>
137
+ <!-- Rename computer here. -->
138
+ <ComputerName>vagrant-2008R2</ComputerName>
139
+ <TimeZone>Pacific Standard Time</TimeZone>
140
+ <RegisteredOwner></RegisteredOwner>
141
+ </component>
142
+ <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">
143
+ <SkipAutoActivation>true</SkipAutoActivation>
144
+ </component>
145
+ </settings>
146
+ <cpi:offlineImage cpi:source="catalog:d:/sources/install_windows server 2008 r2 serverdatacenter.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
147
+ </unattend>
@@ -0,0 +1,142 @@
1
+ You can download a free trial of Windows Server 2008 R2 with Service Pack 1:
2
+
3
+ url: http://technet.microsoft.com/en-us/evalcenter/dd459137.aspx
4
+ url: http://msdn.microsoft.com/en-us/evalcenter/ee175713.aspx
5
+
6
+ 64bit
7
+ file: 7601.17514.101119-1850_x64fre_server_eval_en-us-GRMSXEVAL_EN_DVD.iso
8
+ md5sum: 4263be2cf3c59177c45085c0a7bc6ca5
9
+
10
+ - place it in a directory called iso
11
+
12
+ 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.
13
+
14
+ To edit the Autounattend.xml and validate it:
15
+ You can download The Windows® Automated Installation Kit (AIK) for Windows® 7:
16
+ url: http://www.microsoft.com/download/en/details.aspx?id=5753
17
+ file: KB3AIK_EN.iso
18
+ md5sum: 1e73b24a89eceab9d50585b92db5482f
19
+
20
+ - Building the machine creates a floppy that contains:
21
+ - AutoUnattend.xml (that will configure the windows)
22
+ - winrm-install.bat (activates the http and https listener + punches the firewall hole)
23
+
24
+ AIK also includes dism, which will allow you to choose a specific version:
25
+
26
+ If you want to install a different version, edit Autoattended.xml and replace the /IMAGE/NAME value with
27
+ one of the names listed in the 2008r2 install.wim on the install DVD .iso
28
+
29
+ # <InstallFrom>
30
+ # <MetaData wcm:action="add">
31
+ # <Key>/IMAGE/NAME</Key>
32
+ # <Value>Windows Server 2008 R2 SERVERSTANDARD</Value>
33
+ # </MetaData>
34
+ # </InstallFrom>
35
+
36
+ PS C:\Users\Administrator> Dism /Get-WIMInfo /WimFile:d:\sources\install.wim
37
+
38
+ Deployment Image Servicing and Management tool
39
+ Version: 6.1.7600.16385
40
+
41
+ Details for image : d:\sources\install.wim
42
+
43
+ Index : 1
44
+ Name : Windows Server 2008 R2 SERVERSTANDARD
45
+ Description : Windows Server 2008 R2 SERVERSTANDARD
46
+ Size : 10,510,643,622 bytes
47
+
48
+ Index : 2
49
+ Name : Windows Server 2008 R2 SERVERSTANDARDCORE
50
+ Description : Windows Server 2008 R2 SERVERSTANDARDCORE
51
+ Size : 3,564,132,307 bytes
52
+
53
+ Index : 3
54
+ Name : Windows Server 2008 R2 SERVERENTERPRISE
55
+ Description : Windows Server 2008 R2 SERVERENTERPRISE
56
+ Size : 10,511,024,733 bytes
57
+
58
+ Index : 4
59
+ Name : Windows Server 2008 R2 SERVERENTERPRISECORE
60
+ Description : Windows Server 2008 R2 SERVERENTERPRISECORE
61
+ Size : 3,564,106,331 bytes
62
+
63
+ Index : 5
64
+ Name : Windows Server 2008 R2 SERVERDATACENTER
65
+ Description : Windows Server 2008 R2 SERVERDATACENTER
66
+ Size : 10,511,131,897 bytes
67
+
68
+ Index : 6
69
+ Name : Windows Server 2008 R2 SERVERDATACENTERCORE
70
+ Description : Windows Server 2008 R2 SERVERDATACENTERCORE
71
+ Size : 3,564,144,547 bytes
72
+
73
+ Index : 7
74
+ Name : Windows Server 2008 R2 SERVERWEB
75
+ Description : Windows Server 2008 R2 SERVERWEB
76
+ Size : 10,520,222,743 bytes
77
+
78
+ Index : 8
79
+ Name : Windows Server 2008 R2 SERVERWEBCORE
80
+ Description : Windows Server 2008 R2 SERVERWEBCORE
81
+ Size : 3,562,750,400 bytes
82
+
83
+ The operation completed successfully.
84
+
85
+
86
+ This gets us nearly there, but we still need a winrm provisioner, as I don't like having to install cygwin.
87
+
88
+ Expose the winrm port:
89
+
90
+ <pre>
91
+ $ gem install chef
92
+ $ gem install knife-windows
93
+ #Create a tunnel
94
+ $ ssh -p 7222 -L5985:localhost:5985 vagrant@localhost
95
+ $ knife bootstrap windows winrm localhost -x Administrator -P 'vagrant'
96
+ </pre>
97
+
98
+
99
+ - http://wiki.opscode.com/display/chef/Knife+Windows+Bootstrap
100
+ - https://github.com/opscode/knife-windows/blob/master/lib/chef/knife/bootstrap/windows-shell.erb
101
+
102
+ - https://github.com/zenchild/WinRM
103
+
104
+ - http://devopscloud.net/2011/04/17/managing-chef-from-windows-7/
105
+ - http://devopscloud.net/2011/04/28/powershell-userdata-to-start-a-chef-run/
106
+ - http://devopscloud.net/2011/03/23/dissection-of-a-chef-recipe-or-two-for-windows/
107
+ - https://github.com/pmorton/chef-windows-installer
108
+
109
+ ==
110
+ https://github.com/zenchild/WinRM/issues/unreads#issue/1
111
+ http -> requires unencryptedwinrm quickconfig (said yes to enable firewall)
112
+ winrm p winrm/config/service @{AllowUnencrypted="true"}
113
+ winrm set winrm/config/service/auth @{Basic="true"}netsh advfirewall firewall set rule group="remote administration" new enable=yes
114
+
115
+ - http://forums.citrix.com/thread.jspa?messageID=1535826
116
+ - http://support.microsoft.com/kb/2019527
117
+
118
+ winrm get winrm/config
119
+
120
+ The purpose of configuring WinRM for HTTPS is to encrypt the data being sent across the wire.
121
+
122
+ 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.
123
+
124
+ To install or view certificates for the local computer:
125
+
126
+ - click Start, run, MMC, "File" menu, "Add or Remove Snap-ins" select "Certificates" and click "Add". Go through the wizard selecting "Computer account".
127
+
128
+ - Install or view the certificates under:
129
+ Certificates (Local computer)
130
+ Personal
131
+ Certificates
132
+
133
+ 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
134
+
135
+ Once the certificate is installed type the following to configure WINRM to listen on HTTPS:
136
+
137
+ winrm quickconfig -transport:https
138
+
139
+ 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.
140
+
141
+ winrm quickconfig
142
+
@@ -0,0 +1,44 @@
1
+ # -*- coding: utf-8 -*-
2
+ Veewee::Session.declare({
3
+ :os_type_id => 'Windows2008_64',
4
+ # http://technet.microsoft.com/en-us/evalcenter/dd459137.aspx
5
+ # Download and install full featured software for 180-day trial
6
+ :iso_file => "7601.17514.101119-1850_x64fre_server_eval_en-us-GRMSXEVAL_EN_DVD.iso",
7
+ :iso_md5 => "4263be2cf3c59177c45085c0a7bc6ca5",
8
+ :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",
9
+ :iso_download_timeout => "1000",
10
+ :cpu_count => '1',
11
+ :memory_size=> '384',
12
+ :disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off',
13
+
14
+ :floppy_files => [
15
+ "Autounattend.xml", # automate install and setup winrm
16
+ "cygwin-setup.exe",
17
+ "install-cygwin-sshd.bat",
18
+ "install-winrm.bat",
19
+ "oracle-cert.cer"],
20
+
21
+ #:boot_wait => "35",
22
+ :boot_wait => "1",
23
+ # after 35 seconds, hit these keys to not enter a product key and fully automate the install
24
+ # if your machine is slower it may take more time
25
+ # :boot_cmd_sequence => [
26
+ # '<Tab><Tab><Tab><Enter>',
27
+ # '<Enter>'
28
+ # ],
29
+ :boot_cmd_sequence => [''],
30
+
31
+ :ssh_login_timeout => "10000",
32
+ # Actively attempt to winrm (no ssh on base windows) in for 10000 seconds
33
+ :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "",
34
+ :ssh_host_port => "59856", :ssh_guest_port => "5985",
35
+ # And run postinstall.sh for up to 10000 seconds
36
+ :postinstall_timeout => "10000",
37
+ :postinstall_files => ["postinstall.sh"],
38
+ # No sudo on windows
39
+ :sudo_cmd => "sh '%f'",
40
+ # Shutdown is different as well
41
+ :shutdown_cmd => "shutdown /s /t 60 /d p:4:1 /c \"Vagrant Shutdown\"",
42
+ })
43
+
44
+
@@ -0,0 +1,41 @@
1
+ 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
2
+
3
+ REM create the cygwin directory
4
+ cmd /c mkdir %SystemDrive%\cygwin
5
+ copy a:\cygwin-setup.exe %SystemDrive%\cygwin
6
+
7
+ REM goto a temp directory
8
+ cd %SystemDrive%\windows\temp
9
+
10
+ REM run the installation
11
+ cmd /c a:/cygwin-setup.exe -q -R %SystemDrive%\cygwin -P openssh,openssl,curl,cygrunsrv,wget,rebase,vim -s http://cygwin.mirrors.pair.com
12
+
13
+ %SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin cygrunsrv -R sshd'
14
+
15
+ REM /bin/ash is the right shell for this command
16
+ cmd /c %SystemDrive%\cygwin\bin\ash -c /bin/rebaseall
17
+
18
+ cmd /c %SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin mkgroup -l'>%SystemDrive%\cygwin\etc\group
19
+
20
+ cmd /c %SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin mkpasswd -l'>%SystemDrive%\cygwin\etc\passwd
21
+
22
+ %SystemDrive%\cygwin\usr\bin\sleep 1
23
+
24
+ %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!!" '
25
+
26
+ %SystemDrive%\cygwin\usr\bin\sleep 2
27
+
28
+ 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
29
+
30
+ cmd /c if exist %Systemroot%\system32\netsh.exe netsh advfirewall firewall add rule name="ssh" dir=in action=allow protocol=TCP localport=22
31
+
32
+ %SystemDrive%\cygwin\usr\bin\sleep 2
33
+
34
+ net start sshd
35
+
36
+ # Fix corrupt recycle bin
37
+ # http://www.winhelponline.com/blog/fix-corrupted-recycle-bin-windows-7-vista/
38
+ cmd /c rd /s /q c:\$Recycle.bin
39
+
40
+ copy a:\sudo %SystemDrive%\cygwin\usr\local\bin
41
+ cmd /c %SystemDrive%\cygwin\bin\chmod 755 %SystemDrive%\cygwin\usr\local\bin\sudo