Goal: To be able to execute a single command and have a fresh, sysprepped, SharePoint 2010 development environment ready to go within minutes.
**Note I’m using VMware Workstation, but you should be able to use other virtualization software as long as it supports 64-bit operating systems)
With most SharePoint development being done in VMs, it is useful to have a set of sysprepped base VMs that can be cloned at any time to create a new environment, whether it be for a new project, to test some tool or software, or whatever. Sysprep is a great tool for virtual domains because it will generate a new security ID (SID) for every server created from the sysprepped image to prevent conflicts between servers on the same domain.
Most of the software needed for development can be installed prior to running sysprep on the virtual machine,but SQL Server and SharePoint (at least the configuration of SharePoint) are generally exceptions. These apps typically must be installed post-sysprep in order for them to operate correctly, and this is an involved and tedious process. Fortunately with SQL Server 2008 R2, we now have SQL Server Sysprep, which will allow SQL Server to be installed and imaged, but not configured until a new VM is created from the base image. Woohoo!
So, the general steps are as follows:
- Install a virtual machine with Windows Server 2008 R2, PowerShell 2.0 and all other desired client software (Visual Studio, Office, SharePoint Designer, etc…)
- Install SQL Server 2008 R2 as a Prepared Image
- Install SharePoint 2010 Prerequisites (http://technet.microsoft.com/en-us/library/cc262485(office.14).aspx) either manually or using the Prerequisites Installer tool
- Install SharePoint 2010 bits, but DO NOT run configuration wizard
- Run Sysprep.exe to prepare server
- Clone server
- Boot clone and execute PowerShell script to perform the following actions:
- Complete configuration of sysprepped SQL Server 2008 R2 database server
- Configure SharePoint 2010 farm
The PowerShell script can perform as much (or as little) configuration of the SharePoint environment as you wish. There are a whole slew of new cmdlets (Gary LaPointe lists all 535 of them here) that come with SharePoint 2010, so most actions are as easy as finding the appropriate cmdlet to run.
I’m going to split the detailed steps into two separate posts to make them a little more manageable. The first will cover steps 1-5 above, and the second will cover the rest of the steps.