The SharePoint Coffee House
I'd like some SharePoint with my coffee please...

How to Create a Cloneable SharePoint Development Environment

Friday, 2 January 2009 11:31 by Michael Mukalian

Well, I hope all had a great holiday, and welcome to the first serving of the Coffee House for 2009.

After having a number of SharePoint projects under my belt I decided to look into creating a cloneable development environment for myself.  The following is based on information and scripts from Ben Curry's blog entry on SharePoint Installation Scripts and Paul Horsfall's blog entry on SharePoint, Sysprep and SQL.  Both entries were invaluable in helping me create the process (and my scripts) below.

First off, below find the software used to accomplish this:

  1. Microsoft Virtual Server 2005 R2 (installed on your local machine)
  2. Microsoft Windows Server 2003 SP2
  3. Microsoft SQL Server 2005 SP2
  4. Microsoft SharePoint Server 2007
  5. Microsoft Visual Studio 2008

Now, let's create the necessary image:

  1. Create a new Virtual Machine, name it something sensical (in this case I called it MOSSDEV)
  2. During image creation, point to the Windows 2003 Server files and install the OS
  3. Name the machine the same as the image name (again, in this case, MOSSDEV)
  4. Upon completion give the machine the Application Server role, setting up IIS and ASP.NET
  5. Run Windows Update
  6. Install .NET Frameworks 2.x and 3.x
  7. Run Windows Update
  8. Create the necessary local machine IDs if you wish to run the various SharePoint services under them and not all under 'Administrator' (I do this out of habit instead of using the admin ID)
  9. Install SQL Server in its default installation (Install SP2 afterwards)
  10. Run Windows Update
  11. Install SharePoint Server 2007 but do not run the Configuration Wizard (Remember Advanced/Complete)
  12. Install Visual Studio 2008
  13. Install the SharePoint development assets (Extensions, WSS and Office SDKs)
  14. Run Windows Update 
  15. Install Sysprep for Win2K3 SP2
  16. Shut down the virtual machine, then copy/backup the VM's files (This is necessary as you can then spin this back up to do patches and the like, then back it up)


At this point you should now have a working MOSS machine/image that's ready for Sysprep.  Sysprep requires an .INF file to run and I've attached the one I use to create my images.  Note that you'll need to open it up and enter your correct Product Key for use.  Also note the ComputerName entry and how it's valued with an asterisk (*).  This tells the system to wait for user input before it can continue.  What this allows you to do is give the machine a name during creation.  Both of these attributes are in the [UserData] section of the Sysprep.inf file.

Sysprep also allows you to run scripts after the spinning up of the machine.  In this instance I run 2 scripts: one to set up the SQL Server correctly (startsql.bat) and one to configure MOSS (mossconfig.bat).

startsql.bat does two things: it renames the SQL Server instance from the original (MOSSDEV) to the name that you gave the machine during spin up, and then it gives the relevant DB related rights to the ID to be used for MOSS configuration (note I use a different ID for this than 'Administrator', see Step 8 above).  You'll need to change the ID in this file if you use a different one.

mossconfig.bat basically does what it says: it configures MOSS.  It creates the Farm database, sets up the necessary services, creates 3 Web Applications (SSP Web Admin, My Sites and a Portal), creates the Shared Services Provider and configures it with those Web Applications, and then creates a Site Collection on the Portal Web Application.

To Sysprep the machine:

  1. Start the image back up, logging on as Administrator
  2. Make sure your Sysprep.inf contains the correct and relevant information (Product Key, scripts to run, scripts in their correct location, etc)
  3. Run Sysprep (the system will shut down when complete)
  4. The resultant .VHD is now ready for use as a base image for creating differencing disks in Virtual Server.  Make sure you set the properties of the .VHD to Read Only before you use this.


This newly created .VHD is what will be used as the parent when creating new Differencing .VHDs.  The advantage here is that you can now create as many Differencing .VHDs as you want, all using the parent we created, and upon spinning it up you'll have a new MOSS environment to work in.  Note: when you spin up your development image for the first time, and it asks you for your machine name, it'll finish up its configuration of the machine, and then restart.  When it asks you to log on, you must log on with the ID you set up to be the MOSS setup ID (in my files I use the ID 'adminmoss' for this).  This is important as this ID will then be used to configure MOSS.

Now, when you want to create a new MOSS development environment, you create a new Differencing .VHD, use the above as the parent, and then create a new Virtual Machine using that new Differencing .VHD.  Quick and easy from that point on.

Attached in this post is a .ZIP file (CloneableAssets.zip) containing the 3 files above.

Thanks! - M

CloneableAssets.zip (2.29 kb)

Currently rated 3.4 by 9 people

  • Currently 3.444444/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Comments