posted on Monday, December 04, 2006 1:41 PM by ClaytonFirth

WSS3 Virtual Machine

Well I've finally bitten the bullet and started to learn about SharePoint, and god forbid I'm starting to see how I may actually want to integrate it into some projects. WSS3 sure has come a long way since my last foray into the SharePoint stack (Team Services).

Inspired by this post by Alistair the first item on my list of todo's in learning sharepoint was to create a virtual machine that I could easily distribute to other members on my team. The classic approach that we have used is to save a copy of our VM, and when anyone on the team has needed a clean dev image copy the image, start it up, NewSID, and join the machine onto the developers domain. All in all this was a cumbersome process. This process has been rendered obsolete with the introduction of WSS3 as the act of NewSIDing the image totally destroys WSS.

Anyway I set out  to learn about how to use SysPrep. After a lot of trial and error I finally created a SysPrep.inf file which would only prompt me for as few properties as possible and successfully rename my VM. Unfortunately the WSS instance still came out the other side of the transform, buggered.

Not to be deterred I started having a dig around for information on how to re-configure WSS after a change of machine name. What I ultimately found was that it only takes a few easy steps to completely rebuild the WSS configuration database.  Just open a command prompt at \Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN and run the following commands.

  1. PSCONFIG.EXE -cmd configdb disconnect
  2. PSCONFIG.EXE -cmd configdb create
  3. PSCONFIG.EXE -cmd setup

The real gem comes when you realize that as part of the SysPrep process allows you to run a series of commands after the SysPrep'd image has been started for the first time through the [GuiRunOnce] section, completely automating the configuration of WSS in this case.

As a result of all I've learned in this exercise I can now configure an image of any type of configuration SysPrep it an throw it into the library for anyone to download and use.

To use SysPrep successfully download SysPrep and extract it to c:\SysPrep. Create a file called SysPrep.inf and add the following text into the file, finally run SysPrep with the arguments -reseal -mini -shutdown. Once that VM has shutdown take a copy. The next time the VM is started it will prompt for acceptance of the EULA and machine name and proceed to join the image to your domain. On the first login WSS is configured.

;SetupMgrTag
[Unattended]
InstallFilesPath=C:\SysPrep\i386

[GuiUnattended]
EncryptedAdminPassword=NO
OEMSkipRegional=1
TimeZone=260
AdminPassword="Password123"
OemSkipWelcome=1

[UserData]
ProductKey=P7RCM-P7RCM-P7RCM-P7RCB-ITEME
FullName="Blah Blah"
OrgName="Generic Company Name"
ComputerName=

[SetupMgr]
DistFolder=C:\sysprep\i386
DistShare=windist

[GuiRunOnce]
Command0="C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\PSCONFIG.EXE -cmd configdb disconnect"
Command1="C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\PSCONFIG.EXE -cmd configdb create"
Command2="C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\PSCONFIG.EXE -cmd setup"

[Identification]
JoinDomain=generic.com
DomainAdmin=administrator
DomainAdminPassword=password

[Networking]
InstallDefaultComponents=Yes

Comments