Creating a Dev Environment for WSS 3.0 SP1

28. April 2008

As a developer in Microsoft technologies, I often have to setup a Virtual PC ("VPC") with a Windows Server and the software used for a project. Technology requirements vary from WSS 3.0, SharePoint, or to some other third party LMS system like IntraLearn's LearningServer.  Sometimes you just need a Windows Server to emulate a production environment.  The software development environment might be limited to Visual Studio 2005 Web Application Projects.  Or the toolset might require Visual Studio 2008. This blog entry is about one such project.

Recently, about a week ago, I was given the task of re-skinning a live site to use WSS 3.0 SP1. It should have taken a day at most to setup the VPC with a development environment. I've been on a non-SharePoint project for a while so it took a while to get re-oriented and setup took a lot longer than it should have.  The following is a set of instructions on how to setup a dev environment from scratch.

So, to get started, install Microsoft Virtual PC 2007. You can get that here (or search Google): http://www.microsoft.com/windows/downloads/virtualpc/default.mspx. The software is free.  The two most helpful recommendations for VPC settings are to set the RAM to about half of that available on the host machine and to put the virtual hard drive and other VPC files on a drive rated at 5400rpm or higher.

Install Windows Server 2003 SP2 with a default admin account and password.  Don't join a domain yet.  Use only one network adapter in Network Settings of the VPC at this point. The main purpose for that is to have internet access.  So use the network card on the host computer. In addition to Windows Updates, here is a list of other software to install:

• IE7
• IE7 Developer Toolbar
• Firefox
• Firebug AddIn for Firefox
• WSS 3.0 - Advancaed Install type with single server choice
• WSS 3.0 SP1
• Desktop shortcut to the WSS "12" folder: "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12"
• Add the following path to the path system variable in Windows system properties: “C:\Program Files\Common Files\Microsoft Shared\Web
• Server Extensions\12\BIN”
• Desktop shortcut to “C:\Inetpub\wwwroot\wss\VirtualDirectories\”
• Consolas Font Pack - just because I like the font
• Sharepoint Manager 2007
• U2U CAML Query Builder v3
• Windows 2003 Open Command Prompt Extension
• Lutz Roeder's Reflector
• Microsoft .Net Framework 3.5 - 2.0 and 3.0 should be installed from Windows Update

Now that all the basic software is installed, it is time to optimize the VPC. Following is a list of steps that should optimize the VPC (source: http://www.sharepointforum.com/en-US/Wiki/Optimize%20developer%20VPC.aspx).

Stop unnecessary services....
• Select Start > Administrative Tools > Services
• In the right pane of the Services window, locate and right-click on the Error Reporting service, then select Properties
• Under the General tab of the Error Reporting Service Properties dialog box, in the Service status section, click the Stop button
• For Startup type, select Disabled from the drop-down list, then click the OK button
• Repeat these steps to stop and disable the Help & Support service and the Print Spooler service.

Disable visual enhancements....
• Select Start > Control Panel > Display
• Under the Settings tab of the Display Properties dialog box, click the Advanced button
• Under the Troubleshoot tab of the Default Monitor dialog box, move the Hardware acceleration slider all the way to the left, then click the OK button
• Under the Desktop tab of the Display Properties dialog box, select (None) from the Background list, then click the Apply button
• Under the Screen Saver tab of the Display Properties dialog box, select (None) from the Screen saver drop-down list, then click the OK button
• Select Start > Control Panel > System
• Under the Advanced tab of the System Properties dialog box, under the Performance heading, click the Settings button
• Under the Visual Effects tab of the Performance Options dialog box, select the Adjust for best performance option, then click the OK button

Disable system recovery features....
• Select Start > Control Panel > System
• Under the Advanced tab of the System Properties dialog box, under the Startup and Recovery heading, click the Settings button
• In the Startup and Recovery dialog box, select (none) from the Write debugging information drop-down list, then click the OK button

Disable Remote Desktop connections....
• Select Start > Control Panel > System
• Under the Remote tab of the System Properties dialog box, in the Remote Assistance section, deselect the Turn on Remote Assistance and allow invitations to be sent from this computer checkbox, and in the Remote Desktop section, deselect the Enable Remote Desktop on this computer checkbox, then click the OK button

Disable searching for network drives and printers....
• Launch Windows Explorer, then select Tools > Folder Options
• Under the View tab of the Folder Options dialog box, in the Advanced settings list, deselect the Automatically search for network folders and printers checkbox, then click the Apply to All Folders button
• In the Folder Views alert box, click the Yes button
• Click the OK button to accept the changes and close the Folder Options dialog box

Defragment the virtual machine C: drive....
• Select Start > All Programs > Accessories > System Tools > Disk Defragmenter
• Ensure that the C: drive is selected in the upper pane of the Disk Defragmenter window, then click the Defragment button. Repeat the defragmenting process until it happens quickly (this may take several cycles).

Compact the Virtual Hard Disk....
• In the Virtual PC window, select CD > Capture ISO Image
• In the Select CD Image to Capture dialog box, browse through your local hard drive to locate the Virtual Disk Precompactor.iso file, then click the Open button
• C:\Program Files\Microsoft Virtual PC\Virtual Machine Additions\Virtual Disk Precompactor.iso
• When the Microsoft Virtual Disk Pre-Compactor alert is displayed, click the Yes button
• When the process is complete, the Pre-Compaction Completed message will be displayed; click the OK button
• Select Start > Shut Down to shut down the virtual machine, then return to the Virtual PC Console and select File > Virtual Disk Wizard
• In the Welcome to the Virtual Disk Wizard dialog box, click the Next button
• In the Disk Options dialog box, select the Edit an existing virtual disk option, then click the Next button
• In the Virtual Disk to Edit dialog box, browse for the VHD (Virtual Hard Disk) file which contains your virtual machine, then click the Next button
• In the Virtual Disk Information and Options dialog box, select the Compact it option, then click the Next button
• In the Virtual Hard Disk Compaction dialog box, select the Replace the original file option, then click the Next button
• In the Completing the Virtual Disk Wizard dialog box, click the Finish button
• When the compaction process is complete, a success message will be displayed; click the Close button to acknowledge the message

Now, it's time to shut down the VPC and get the networking setup. There are several blog sites which talked about optimal settings for networking in addition to other setup tips.  The following are in my opinion some good blogs on that subject:

http://blog.devstone.com/aaron/archive/2005/05/03/577.aspx
http://blogs.msdn.com/smguest/archive/2005/02/10/370861.aspx
http://weblogs.asp.net/erobillard/archive/2007/02/23/build-a-sharepoint-development-machine.aspx

Here is a summary of what to do:

• Create a Microsoft Loopback Adapter on the host machine. This creates a private LAN between the host and the server. 
      o Click Start, Control Panel, and open the Add Hardware wizard. 
      o Click Next. Wait a moment while the wizard scans for hardware. 
      o Select: Yes, I have already connected the hardware, click Next. 
      o Scroll to the bottom of the list and select Add a new hardware device. Click Next. 
      o Select: Install the hardware that I manually select from a list (Advanced). Click Next. 
      o Select: Network adapters. Select: Microsoft. Select: Microsoft Loopback Adapter. 
      o Click Next. Click Next again. Wait a moment. Click Finish.
• Configure the Loopback Adapter on the host machine. 
      o Click Start, Control Panel, and open the Network Connections utility. 
      o Right-click the Microsoft Loopback Adapter connection and select Properties. 
      o Double-click Internet Protocol (TCP/IP). 
      o Now configure an address for this adapter. Use an IP address that is not in use on the network. There will be one setup here that the VPC will point to later (via hosts file entry). 
         - IP Address: 10.50.50.1 
         - Subnet mask: 255.255.255.0 
         - Default gateway: 
               • You can ignore DNS. Click OK. Click OK again.
• Shut down the VPC
• Go into Network Settings via Virtual PC Console
• Set the number of network adapters to 2
• Select the host NIC card as the first one
• Select the Microsoft Loopback Adapter as the second one
• Start the VPC
• Go to network settings on the VPC
• Select Local Connection 2 Properties
• Double-click Internet Protocol (TCP/IP). 
      o Now configure an address for this adapter. Use an ip address that is not in use on the network. Notice that the IP address is incremented by 1 away from that used on the host machine. The subnet masks must match between host and VPC. 
         - IP Address: 10.50.50.2 
         - Subnet mask: 255.255.255.0 
         - Default gateway: 
               • You can ignore DNS. Click OK. Click OK again.
• Go into the hosts file on the VPC
• Add an entry like this, replace the curly bracket text with real text: 10.50.50.1 {host computer name}
• Save the hosts file
• Shut down the VPC
• Go into the hosts file on the host computer
• Add an entry like this: 10.50.50.2 {VPC computer name}
• Save the hosts file
• Restart the VPC. It should see the network that the host computer is on.
• Click Start, Control Panel, System, and click on the Computer Name tab
• Click Change
• Select the Domain radio button and enter the name of the host computer's domain.
• Click OK and restart if prompted
• Now add your domain login to the Administrator's Group on the VPC (after any restart) 
      o Click Start, Administrative Tools, Computer Management, and select Local Users and Groups 
      o Find the Administrator group in Groups and add your domain user to this group 
      o The Find Now should be able to find your username and Locations should now be able to list the host domain.

That's it! That is all there is to it (mostly)! I will probably edit, refine, and expand this document to include MOSS installation and/or server farm installs. But that is it for now.

Code

Comments

Matt Cohen
4/29/2008 12:45:24 PM #
I would clarify the statement about putting the virtual hard drive on a drive rated 5400 rpm or higher to make sure this is a second (not the startup) drive. Other than having adequate memory this is the most important factor to virtual machine performance.


Allen
5/7/2008 9:48:34 AM #
Agreed!  An optimal setup for a Virtual PC would be to use a 7200rpm external drive through USB2 that has all the VPC files running from it.  Here is a post by Scott Hanselman with more detail: www.hanselman.com/.../...lHardDriveThroughput.aspx" target=_blank>Virtual Machines And External Hard Drive Throughput.
Comments are closed