It is often very tedious to create and set up SharePoint on one machine, then reproduce the same steps on another machine in another environment over and over again for development and testing. I will briefly discuss two different options, by using virtual servers:
I highly recommend using option 2. For both methods you should use sysprep to prepare the server image to be copied.
The base image is built with OS, SQL server and SharePoint software. Then configure the SharePoint solution the way you like. Sysprep the server to prepare it for copying. Now you can copy the image to create a new development server. After the machine has started you must start to rename the server. Follow the steps in this blog post http://www.sharepointblogs.com/mirjam/archive/2007/08/06/renaming-a-moss-server.aspx Be aware that you might encounter some issues with this method and can be required to start over again. I don’t prefer using this method.
The base image is built the same way as the other option, except the SharePoint configuration. The configuration is prepared as a script that is run after the new server has been created. Sysprep the server to prepare it for copying. Now you can copy the image to create a new development server. After the machine has started you just run the script. A good starting point for a script to deploy SharePoint is SharePoint Powershell Deploy, available at www.codeplex.com
(this part is borrowed from www.ssw.com ) For Windows 2008, the sysprep tool is included as part of the Windows installation. It is located at c:\windows\system32\sysprep\sysprep.exe. However, the setup manager used to create the answer file is replaced by Windows System Image Manager which is part of Windows Automation Kit. This can be downloaded from Microsoft Download Center at http://www.microsoft.com/downloads/details.aspx?FamilyID=94bb6e34-d890-4932-81a5-5b50c657de08&DisplayLang=en. The following describes the steps taken to sysprep a Windows Server 2008 image:
For more information, see: http://blogs.technet.com/askcore/archive/2008/10/31/automating-the-oobe-process-during-windows-server-2008-sysprep-mini-setup.aspx