Skip to content

Commit

Permalink
2008R1/R2 serverweb and serverwebcore
Browse files Browse the repository at this point in the history
  • Loading branch information
hh committed Feb 1, 2012
1 parent 1385b45 commit 1661dd3
Show file tree
Hide file tree
Showing 55 changed files with 2,617 additions and 6 deletions.
Expand Up @@ -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>
Expand Down
Expand Up @@ -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'

Expand Down Expand Up @@ -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
3 changes: 2 additions & 1 deletion templates/windows-2008R1-serverstandard-amd64/postinstall.sh
Expand Up @@ -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
Expand Down
162 changes: 162 additions & 0 deletions 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>
134 changes: 134 additions & 0 deletions 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

Binary file not shown.

0 comments on commit 1661dd3

Please sign in to comment.