2.2. Your Development Environment

Before you can build, you need a foundation. Subsequent chapters in this book assume that you will be developing on a stand-alone SharePoint server with Visual Studio and that your developer tools are installed on the same machine. You can build that environment in a virtual machine with the steps described in this chapter.

However, for "real-world" development, experience has shown that keeping your development tools off of the server is a good practice. Depending upon your situation, it may not always be the best practice, and it does require remote debugging so that it is also not the "easiest practice." But this configuration brings both discipline and the benefits of loose coupling to SharePoint development. By interacting with the server as a SharePoint user would, you avoid all the inconsistencies that come with running browser sessions on locked-down web servers, you don't fill your server's GAC with quite as much junk, and you develop better development habits.

Read each section once through to understand what to watch for before building the environment. This is especially true when building the server. The local machine is also called the host, and the virtual machine (VM) that contains the server is also called the guest. Like a hotel, a host can have many guests.

2.2.1. Developer Tools

The two main factors determining the speed of your SharePoint development environment are RAM and hard drive speed. If you do a lot of development, you will also want plenty of disk space to hold all those VMs.

First, give your virtual machines as much RAM as possible. The minimum RAM recommended for a live MOSS server is 2 GB, though you can survive on less. If you have 4 GB, give the VM 2 GB. If you have 3 GB, give the VM either 1.5 GB or 2 GB. If you have 2 GB or less, buy more RAM or host your server elsewhere. Seriously, at 1 GB or less, you may experience issues during installation.

If you need Exchange Server in your lab for any reason (another 2 GB recommended), you've grown out of laptop labs and should build this on a Virtual Server (or VMWare) host if you want some hair left over when you're done. To build medium or large farms in a virtual environment, Microsoft Virtual Server running on a 64-bit Windows 2003 Server R2 machine can address up to 1024 GB. A 64-bit Vista machine provides the same expandability with Virtual PC or VMWare, although many laptops in this book's lifetime will have a hard limit as low as 4 GB.

To optimize available memory, wouldn't it be great if you could share a base server image among several machines in a virtual farm and have each VM use a separate hard disk file that represented the delta from the base image? You can do this with both VMWare and VirtualPC. Some versions of VMWare have the ability to intelligently share read-only memory pages across VM images, which can be a great way to reduce the amount of real memory consumed by multiple VM's running at the same time. This also reduces swapping. This capability in Virtual PC is called a Differencing Disk. The "big three" factors of hard drive performance are rotation speed, transfer rate, and isolation. Put another way: You want a big fast external drive. Your guest server will run faster if it doesn't need to share cycles with your host's operating system, so put it on an external drive.

Then assume that the virtual hard drives (VHD files) of SharePoint virtual servers will range from 5 GB to 20 GB, with the median around 10 GB. You will have three or four base (or "Do Not Touch") images, and a copy perhaps for every customer, or every production server you support. After a few mental calculations, you will likely find that a 7200 RPM SATA drive in the 200GB to 500GB range is a good place to start.

Your bottleneck will be transfer rate, so get a hard drive enclosure with a FireWire or eSATA interface. If you don't have FireWire or eSATA on your host machine, you'll need an adapter for ISA, CardBus (PCMCIA II), or ExpressCard, whichever your machine supports. If you use a desktop with SATA support, the straight-through adapter for your backplane is sometimes included with the enclosure.

Why not USB 2.0? Because it's slow. FireWire is 33% to 70% faster than USB, depending on the operation. eSATA is about five times faster than USB 2.0. Check out the stats in the following table:

Hard Drive InterfaceTransfer Rate (Mbits per second)
USB 2.0480
FireWire 800786
eSATA1500 to 2400

Can you build a virtual machine and develop SharePoint components on a computer with 2 GB RAM and 10 GB free on the hard disk? Yes. Is the experience rewarding? The answer depends upon both your brilliance and your patience.

2.2.2. Host System Software

A minimal list of software required for SharePoint development on the host is:

  • The .NET Framework version 3.0

  • Visual Studio and/or SharePoint Designer

  • Virtual PC or VMWare to host a SharePoint virtual machine, unless a physical machine is available

Beyond a web browser and these, everything in the following list is optional, but each will improve development time or reduce aggravation, depending on the task at hand. An online search for the title will locate the download; in some cases a shorter search phrase is provided. All items are free downloads except those marked [$], and free evaluation versions are available for each of these, too. The list is arranged roughly in the order of installation.

TitleDescription
.NET Framework 2.0This is ostensibly included in.NET 3.0, but for completeness you should have a copy of the .NET 2.0 redistributable on hand and ready to install separately from 3.0.
.NET Framework 3.0Includes Windows Presentation Foundation (WPF), Windows Communication Foundation (WCF), and essential to SharePoint: Workflow Foundation (WF).
Internet Explorer Developer ToolbarInspect HTML source, style usage, IFrame content, image locations, and more.
Fiddler HTTP DebuggerInspect and manipulate HTTP traffic between your browser and the server.
Lutz Roeder's .NET ReflectorA class browser, explorer, analyzer, and documentation viewer for .NET. that enables you to view, navigate, search, decompile, and analyze .NET assemblies in C#, Visual Basic, and IL.
PowerShellWrite scripts to automate administration and configuration tasks. Search online for PowerShell SharePoint Provider to locate excellent scripts.
Office System Professional Plus Edition [$]The Professional Plus Edition includes Word, Excel, Outlook, and PowerPoint, plus Access, Publisher, and InfoPath. There is also an Enterprise Edition, which includes OneNote and Groove.
SharePoint Designer (SPD) [$]SPD is an increasingly essential tool for creating SharePoint master pages, workflows, data views, and more.
Visual Studio 2005 (VS) [$]VS is the most powerful IDE for building solutions anywhere on the Microsoft Application platform.
Visual Studio 2005 Extensions for Windows SharePoint Services 3.0 (VSeWSS)Build Web Parts, field controls, List Definitions, Site Definitions, and content types. Also includes the SharePoint Solution Generator (SPSolGen) which converts lists and sites "Saved as Template" into List and Site Definitions. Search online for VSeWSS.
Visual Studio 2005 Extensions for .NET Framework 3.0 (Workflow Foundation)Design Windows Workflow Foundation solutions for SharePoint and other .NET applications.
Visual Studio 2005 Tools for the 2007 Microsoft Office System (VSTO)VSTO is used to build: Office System (Word, Excel, etc.) add-ins and ribbon elements, Outlook forms, and InfoPath templates. Search online for VSTO.
BDC Metadata Manager [$]Generate BDC XML from SQL data sources. The commercial version also builds definitions for web services. Search online for BDCMetaMan.
Windows SharePoint Services (WSS) 3.0 Software Development Kit (SDK)The SDK contains the entire WSS object model and sample code in help format (CHM), and can either be downloaded or read online. Search online for WSS 3.0 SDK.
Microsoft Office SharePoint Server 2007 SDKThe SDK contains the entire OSS object model in help format (CHM), and can either be downloaded or read online. Search online for MOSS 2007 SDK.
Virtual PC 2007VPC is required unless you have spare servers available to host your development lab. VMWare is a popular alternative. Both are free.
SQL Server Express EditionYou may want a small local SQL server if you develop more than SharePoint and need a handy data store. If not, SQL Express is built into the SharePoint stand-alone install so you do not need to download or install it separately. This is the successor to MSDE.
SQL Server 2005 Developer Edition [$]A robust alternative to SQL Express, Developer Edition is a version of SQL Server Enterprise Edition licensed only for development, testing, and demos; it includes the popular SQL Server Management Studio.

There are other great developer tools out there, and many more will be released in this book's life. As of today, deep familiarity with the items listed above will enable you to become a skilled SharePoint developer.

2.2.3. Building the Host Machine

You already know how to install software, so instead this section will help you configure your local machine to develop against a SharePoint server running in Virtual PC. Building a host machine involves selecting an IP address, and installing and configuring a Loopback Adapter.

First select an IP address range to use for your development lab. This should be in a private address range and somewhat random so as not to conflict with other networks you connect with. The available private ranges of IP addresses are listed in the following table:

IP Range
10.0.0.0 to 10.255.255.255
172.16.0.0 to 172.31.255.255
192.168.0.0 to 192.168.255.255

The subnet mask of machines in your lab will be 255.255.255.0 unless you have a reason for choosing otherwise. This will provide addresses for 256 machines. A wider subnet mask would increase the risk of overlap with networks to which you connect.

What Is a Subnet Mask Anyway?

An IP address is made up of four numbers, or octets, ranging from 0 to 255. The subnet mask along with an IP address indicates the lower and upper range of your network by placing 255 (or binary 11111111) in octets, which do not vary, and a 0 (or binary 00000000) in octets that are free to vary. A logical AND of the binary mask against a machine's IP address indicates which other machines will be in the same subnet. For subnet mask 255.255.0.0 the first two octets are fixed, and the last two are free to contain numbers from 0 to 255. If you select the address 10.11.12.13 at random from the table above, and a subnet mask of 255.255.255.0, then the subnet address range is 10.11.12.0 to 10.11.12.255.

Once you have selected an IP address range and a subnet mask, begin the installation and configuration of the Loopback Adapter.


2.2.3.1. Install the Microsoft Loopback Adapter on the Host Machine

An instance of the Microsoft Loopback Adapter on the host machine will be used to host a local network that includes the virtual machines. The host machine will be able to connect to the guest server, browse its web sites, and debug its processes over this local network. Follow these steps to install the Loopback Adapter:

  1. Click Start and Control Panel, and open the Add Hardware Wizard.

  2. Click Next. Wait a moment while the wizard scans for hardware.

  3. Select Yes, I have already connected the hardware, then click Next.

  4. Scroll to the bottom of the list and select Add a new hardware device. Click Next.

  5. Select Install the hardware that I manually select from a list (Advanced). Click Next.

  6. Select Network adapters, Microsoft, Microsoft Loopback Adapter.

  7. Click Next. Click Next again. Wait a moment. Click Finish.

2.2.3.2. Configure the Loopback Adapter on the Host Machine

Once the Loopback Adapter is installed, it must be configured to use an IP address in your selected range.

  1. Click Start, Control Panel, and open the Network Connections utility.

  2. Right-click the Microsoft Loopback Adapter connection and select Properties.

  3. Double-click Internet Protocol (TCP/IP).

  4. Set an IP address for this adapter:

    • Select Use the following address

    • IP Address: 10.50.50.1

    • Subnet mask: 255.255.255.0

    • Default gateway: Leave this blank.

  5. You can ignore DNS. Click OK. Click OK again.

If you have not done so already, install your developer tools now, including Virtual PC. You have built your host machine and set it up for the development environment; now it's time to build the server. The upcoming sections include steps to build either a WSS 3.0 or a MOSS 2007 server.

2.2.4. Building the Server

Building a SharePoint server is an experience that no developer should miss. Building servers efficiently is a skill that no developer should be without. This section contains several parts: building the base Windows Server, installing an Active Directory domain controller, installing IIS, installing WSS, and installing MOSS.

2.2.4.1. Task: Create a Windows Server 2003 Base Image

This process includes creating a new VM definition, adjusting the settings, and installing the operating system (OS) and .NET Framework. Then the OS is activated and Windows Update is run to install all available service packs and patches. Once the base image is in a reliable, pristine state, it is backed up for reuse. You should plan about three hours for this process.

2.2.4.1.1. Create a New Virtual Machine

Follow the following steps to create a virtual machine in Virtual PC:

  1. From the Start, Programs menu, start Virtual PC.

  2. Click New. Click Next.

  3. Select Create a new virtual machine. Click Next.

  4. Type the name and location. The default is My DocumentsMy Virtual Machines. To create the VM on your external drive, enter the location and a name. In this case, you're creating a VM in F:VMS called WindowsServer2003Base. Click Next.

  5. Select an operating system. You will select Windows Server 2003 unless Windows Vista Server (Longhorn) is available. Click Next.

  6. Adjust the RAM. For this base image 1 GB or 1024 MB will suffice. Click Next.

  7. For the virtual hard disk options, select A new virtual hard disk. Click Next.

  8. Create the hard disk in the same location that you selected in step 4. Adjust the virtual hard disk size to a reasonable size. 4 GB or 4096 MB is a good start. You can resize the disk at any time. Click Next.

  9. The wizard is complete. You can use the Back button to review your choices. When you are satisfied that everything is correct, return to this panel and click Finish. Your new machine is now displayed in the Virtual PC console.

2.2.4.1.2. Configure Virtual Machine Settings

Once the machine is created, add it to the virtual network by connecting a second network adapter on the virtual machine to your host machine's Loopback Adapter.

  1. Click Settings.

  2. Click Networking.

  3. Change the setting Number of network adapters to 2.

  4. Change the setting Adapter 2 to Microsoft Loopback Adapter.

  5. Click OK.

2.2.4.1.3. Install the Operating System

Now that the VM is fully configured in Virtual PC, install an operating system:

  1. In Virtual PC, click Start to power up your virtual machine.

  2. If you have a Windows Server 2003 Standard SP2 CD or DVD, insert it in your host machine now. If you have a Windows Server 2003 SP2 ISO file (e.g., from MSDN), on the menu bar, click CD, then Capture an ISO Image, and browse to the location of your Windows Server 2003 SP2 ISO image. Open the image.

  3. Follow the on-screen instructions to install the server operating system. Unless you are using an evaluation version, a license key will be required.

    If a Virtual Machine Additions window opens, click OK to close it. If your mouse is "trapped" within the window, you can free it by pressing the right-side Alt key.

When you get to Network Settings, you will configure an IP address for the second network adapter.

  1. Choose Custom settings. Click Next. The primary networking device will come up first (even if #2 is shown in the label). You pegged this to your host's network card in step 2. Leave it with its default settings, and it should be able to use the same DHCP service as your host machine to connect to the Internet.

  2. Click Next. The second card will come up.

  3. Select Internet Protocol (TCP/IP), and click Properties.

  4. Enter a private IP address that is different from, but in the same subnet as, the one you used for your host machine's Microsoft Loopback Adapter. Enter the same subnet mask that you used for the Loopback Adapter. Ignore gateway and DNS.

    • IP address: e.g., 10.50.50.4 or 192.168.50.4

    • Subnet mask: 255.255.255.0

    • Default gateway: Leave this blank.

  5. Leave DNS entries blank. You will create a HOSTS file on your host machine for resolving addresses. Click OK.

  6. Back on the Windows Setup Networking Components panel, click Next.

  7. Allow this machine to be a member of WORKGROUP, unless you have a reason for joining it to an existing domain. Click Next.

  8. Wait for 15 to 25 minutes as files are copied. Once the process is complete, Windows will start.

  9. Press the right-side Alt and Del keys together to log in to your virtual machine. The Administrator password was configured during substep 3. Now is a good time to create a text file (e.g., readme.txt) in the virtual machine folder that contains the password.

2.2.4.1.4. Edit the HOSTS File on the Local Machine

The virtual network will not be served by the same DNS server used by the host machine. Therefore, to locate a virtual machine by name rather than IP address, an entry must be added to the HOSTS file of the host machine.

  1. Open File Explorer and navigate to C:WINDOWSsystem32driversetc.

  2. Right-click the HOSTS file and select Open. In the pop-up, select Notepad. Click OK.

  3. Add the IP address and machine name of your virtual machine on a blank line.

  4. Close the Window, and click Yes when prompted to save the changes.

2.2.4.1.5. Activate Windows

Until the operating system is activated, an expiration date is set. The server will not operate beyond the expiration date. This set of steps removes the expiration date:

  1. Click the keys in the desktop tray to open the Let's Activate Windows Wizard.

  2. Select Yes, let's activate Windows over the Internet now, and click Next.

  3. Select No, I don't want to register now, let's just activate Windows, and click Next.

  4. The Checking for connectivity... page will open, then Configure your network settings. If your local network does not require proxy settings, click Next.

  5. Thank You! will be displayed. Click OK. If activation is unsuccessful, verify that the network settings from previous steps are complete.

  6. Run Windows Update to ensure that the latest service packs and updates are installed.

2.2.4.1.6. Install Virtual Machine Additions

Virtual Machine Additions will allow you to access folders on your local machine, and to move the mouse freely in and out of the Virtual PC window.

  1. If you connected to an ISO image to install the OS, you can disconnect it now.

  2. Click Action on the Virtual PC's menu bar, and select Install or Update Virtual Machine Additions.

  3. A message is displayed, click Continue. Once the image is mounted, click Next.

  4. Click Finish. Click Yes to restart your virtual machine.

  5. Log in again and close the Manage Your Computer panel.

2.2.4.1.7. Install ASP.NET 3.0 on the VM

ASP.NET 3.0 includes ASP.NET 2.0 and Windows Workflow Foundation (WF). Both are required by SharePoint. Follow these steps to install ASP.NET 3.0:

  1. If you have a folder containing the .NET setup (version 3.0 or above) on your local machine, open File Explorer on your local machine and drag the folder onto the little folder icon on the bottom of your Virtual PC window. This makes the folder available from within your VM, starting with drive Z: and working backward.

  2. Open File Explorer inside the VM and run the setup for the .NET Framework.

  3. If prompted to Run, Open, or Cancel, click Run or Open. Prerequisites will be checked and files will be copied.

  4. If you agree with the terms, accept the license and click Install. Clicking on the balloon in the lower right will show the progress in detail.

  5. When installation is complete, click Exit.

2.2.4.1.8. Back Up Your Base Image

You have now created a reusable base image. At this point, it is prudent to make a backup of this image to save time when creating servers in the future.

  1. Click Start and Shut down your VM. Enter a reason of "Base Image Complete."

  2. Copy the folders containing the VHD and VMC files (set during step 1) into a folder named Do Not Touch.

  3. Once the files are backed up, you can create a new machine by moving or copying the VHD into another folder, renaming it according to purpose (e.g., WSSBaseImage.vhd or MOSSBaseImage.vhd) and using Virtual PC to create a new virtual machine configuration (VMC) in the same folder. This is how subsequent instructions will begin to prepare a virtual machine for SharePoint.

2.2.4.2. Use SYSPREP to Create Server Farms

Though not required for a development environment, you may want to build a virtual SharePoint farm. Each machine in your farm will need a unique security identifier (SID), which is generated with a SYSPREP script which also initializes a machine image and (optionally) joins it to a domain. While the SysInternals utility called NewSID will also reset the SID, issues with the resulting images will not be supported by Microsoft, and there is a known issue with installing SharePoint on such a machine.

Note that this task is not required for the environment used in the remainder of this book.

2.2.4.2.1. Copy a VM to Use for the Windows Server SYSPREP Image

To create virtual server farms now or in the future, follow these steps to create a SYSPREP image:

  1. Remember the Do Not Touch folder you created to back up your first image? Create a subfolder there called WindowsServerSysprep and copy your Windows Server 2003 Base virtual machine's hard drive (VHD) into it (e.g., F:vmsDoNotTouchWindowsServerSysprep). Rename the VHD to match the folder name (e.g., WindowsServerSysprep Hard Disk.vhd). Create a new virtual machine configuration (VMC) in Virtual PC, also with the same name, and be sure to browse to the same folder. Rather than create a new VHD, select An existing hard disk, and browse to your new VHD. Do not click Enable undo disks.

  2. Add a second network adapter and configure it as you did for your Windows Server Base image.

  3. Start your VM and log in.

2.2.4.2.2. Copy the Deployment Utilities and Run Setupmgr.exe

Before running SYSPREP, you run SETUPMGR to define the default settings for new servers. Follow these steps to define your server settings:

  1. Copy the files from your Windows Server media located in the ...support ools folder to a new folder inside the VM named C:deploy. You can alternately locate and download these files from Microsoft Downloads by searching for your server name and "Deployment Tools." For example, search online for Windows Server 2003 SP1 Deployment Tools.

  2. Download the wsname utility, and copy the wsname.exe executable to the C:deploy folder. To locate this file, search online for David Clarke wsname.

  3. Open Windows Explorer, navigate to C:deploy and run setupmgr.exe. Click Next.

  4. Select Create new. Click Next.

  5. Select Sysprep setup. Click Next.

  6. Select your version of Windows 2003 Server (Standard or Enterprise). Click Next.

  7. Select Yes, fully automate the installation. Click Next.

  8. The next window allows you to set answers for unattended setup. If you leave any entries blank, the user will be prompted for answers during installation. The following items should be set:

    • Name and Organization

    • Time Zone

    • Product Key should be set if you subscribe to Microsoft Licensing.

    • Computer Name. A utility will be used to rename the machine. For now, either select Automatically generate... or select Use the following... and provide a default name (e.g., SPSERVER).

    • Administrator Password. Optionally check the box to Encrypt the Administrator password in the answer file.

    • Regional Settings. Select your region.

    • On the Run Once page, type c:deploywsname.exe, and click Add.

    • Identification String may be left blank. On this page click Finish. Then click Cancel to close the wizard.

  9. Add a subfolder to C:deploy to save your answer file: C:deploysysprepsysprep.inf and click OK. The utility generates your answer file and makes a copy in C:sysprep.

  10. Copy the files sysprep.exe and setupcl.exe into the C:sysprep folder.

2.2.4.2.3. Run Sysprep.exe

Once your machine definition is configured with SETUPMGR, SYSPREP will seal the image and force it to invoke your configuration steps the next time it is opened.

  1. Get your virtual machine into a clean state. Close any running applications and make any final adjustments. This is your last chance!

  2. Click Start, then Run; type c:sysprepsysprep.exe, and click OK.

  3. Click OK.

  4. Check the box labeled Don't reset grace period for activation. Click Reseal.

  5. Click OK. This will force the generation of a unique SID when you launch your new machine. A unique SID will be required to avoid conflicts in the virtual server farm.

Sysprep will then do its thing and shut the machine down.

2.2.4.2.4. Prepare and Test the SYSPREP Image

The virtual machine you prepared will now automatically run a series of tasks when started. You don't want this to happen until you are actually ready to build a farm. Next, you will remove the virtual machine from Virtual PC, move it to a safe location, copy it to a trial location, and test it to make sure it works.

  1. Open the Virtual PC Console.

  2. Select the WindowsServerSysprep virtual machine, and click Remove. Click Yes to confirm this.

  3. Copy your VHD to a new location where you can test it. For example, F:vmsSharePointFarm-DC. Rename the VHD file to match the folder name.

  4. Create a new Virtual PC machine with the same name. When naming the machine, browse to your new folder so that the VMC is stored there with the VHD (New, Next, Create, Next, SharePointFarm-DC, Browse, Save, Next, Windows Server, Next, 256 MB, Next, An existing virtual hard disk, Next, browse to the VHD and Open, Next, Finish).

  5. Open Settings, configure a second network adapter, and assign it to the Microsoft Loopback Adapter as you did for your Windows Server Base image. Click OK.

  6. Start the new virtual machine. Windows will be prepared. Click through any prompts or answer any questions unanswered during SETUPMGR configuration. It is normal to see an Error message regarding the Administrator password. The server will then automatically restart.

  7. Log in as Administrator using the password supplied during setup.

  8. You will be prompted to enter a machine name. Supply a unique name that this machine will use on your virtual network. For example, SPFARM-DC. Click Set Name. Click Yes to restart.

  9. Log in and click Start Control Panel Network Connections Local Area Connection 2. Click Properties.

  10. Select Internet Protocol (TCP/IP), and click Properties.

  11. Enter a private IP address which is different from, but in the same subnet as, the one you used for your host machine's Microsoft Loopback Adapter. Enter the same subnet mask that you used for the Loopback Adapter. Ignore the gateway and DNS.

    • IP address: e.g., 10.50.50.2 or 192.168.50.2

    • Subnet mask: 255.255.255.0

    • Default gateway: Leave this blank.

    • DNS Servers: Leave these blank.

    You will create a HOSTS file on your host machine for resolving addresses. Click OK. Click Close.

  12. Your virtual machine is now configured.

Optionally, at this time you can install Active Directory and DNS on this virtual machine by following the instructions in the next section. You can further test this virtual machine by starting your Windows Server Base image (or a copy) in Virtual PC and joining it to your new domain. To join another virtual machine to the domain, configure the DNS for Adapter #2 with the SPFARM-DC IP address. Then click Start, right-click My Computer, and click Properties. Click on the Computer Name tab and then click Change to enter the name of your domain. If the two machines can coexist on your virtual network, you've succeeded.

2.2.4.3. Prepare the Virtual Machine for SharePoint

The preparation stage is identical for both WSS and MOSS. WSS and MOSS are composed of ASP.NET applications, and ASP.NET requires IIS server. SharePoint also needs access to an Active Directory domain controller (for authentication) and a DNS server (for machine name to IP resolution), though these are network services and in a production environment they would rarely be installed to SharePoint servers. In your development environment, they will coexist nicely with a stand-alone configuration. Plan on this taking you roughly one hour.

2.2.4.3.1. Copy a VM to Use for SharePoint

SharePoint will be installed to a copy of the base virtual server you created earlier. These steps describe the process for copying a virtual machine into a space where you can continue its preparation to be used as a SharePoint (WSS or MOSS) server.

  1. Copy your Windows Server 2003 Base virtual machine's hard drive (VHD) into a folder named IIS6Base and rename the VHD to match the folder name (e.g., IIS6Base Hard Disk.vhd). Create a new virtual machine configuration (VMC) in Virtual PC also with the same name. Rather than create a new VHD, select An existing hard disk, and browse to your new VHD. If you also check Enable undo disks, you will be able to roll back the state of your VM to the point of your last save, which is the end of the last VM session where you committed changes. For base images, you can skip undo disks; for live development machines, you may want to enable them.

  2. Add a second network adapter and configure it as you did for your Windows Server Base image.

  3. Start your VM and log in.

2.2.4.3.2. Install Active Directory and DNS on the Virtual Machine

AD and DNS only need to be installed once in any given subnet. If you are building a server for a farm where they already occur, you may skip this step.

You could follow these steps independently of the other tasks to create a server that provides only AD and DNS services. You might want this when recreating a production farm where AD and DNS pre-exist SharePoint and you want to keep the two separate in your development environment as well. Since AD and DNS services will be required for all SharePoint development, you can also install these on a separate server (with 256 MB or less RAM required) so that you only need to build it once, and then carry the same test accounts from project to project.

Note that after these steps have been run and a machine is a domain controller, you can no longer use the image with the SYSPREP utility to create new virtual machines; a machine must be SYSPREPed before it is either a domain controller or a member of a domain.

  1. Click Start, Administrative Tools, and then Configure Your Server Wizard. Click Next, then Next again.

  2. Select Typical Configuration for a first server.

    If this option is not available, select Domain Controller (Active Directory), click Next, confirm your choice, and click Next again, then follow the steps to install and configure Active Directory and DNS from step 4 forward. When complete, come back to step 3 here.

  3. Type the full DNS name for the new domain. This is not a web domain, so you can give it an entirely different suffix to avoid confusion with web domains (e.g., dev.myCompany.local). Click Next.

  4. Accept the default NetBIOS name (DEV if you used the above example). Click Next.

  5. Review your options and click Next. Active Directory is configured. Read the message and click OK. Once the process begins, never click Cancel. To uninstall the program or make changes, it is better to let the process complete and start over.

  6. Select the virtual card that connects you to the Internet. This will be Local Area Connection; the other will be the IP address you configured for Adapter #2. Leave checked the option to set up a Basic Firewall. Click Next. Click Finish.

  7. If prompted to insert the Windows 2003 Server media, either insert the disk in the host machine or recapture your ISO image through the CD menu on the menu bar.

  8. When complete, the VM will automatically restart. Log in to resume.

  9. Review the Server Configuration Progress page, and click Next. Click Finish. The server is now configured.

2.2.4.3.3. Install Internet Information Server (IIS) on the Virtual Machine

IIS is required to host web applications. Follow these steps to install IIS on your virtual machine by assigning it to the Application Server role.

  1. The Manage Your Server window will be displayed. Click Add or remove role. If you disabled the Manage Your Server window, click Start Administrative Tools, and select the Configure Your Server Wizard.

  2. Click Next, then Next again.

  3. Select Application Server (IIS, ASP.NET), and click Next.

  4. On the Application Server Options page, check the second box, Enable ASP.NET. Click Next. Click Next again. Installation will begin.

  5. The wizard will declare This Server Is Now an Application Server. Click Finish.

2.2.4.3.4. Install and Enable ASP.NET 2.0 on the Virtual Machine

ASP.NET 2.0 was installed on your machine along with 3.0 during the preparation of Windows 2003, but IIS doesn't yet know about it. The following steps explicitly install ASP.NET 2.0 and mark it as Allowed in IIS Web Service Extensions:

  1. Locate and execute the ASP.NET 2.0 setup.

  2. Select Repair, and click Next. During the repair, ASP.NET is installed to IIS and marked as allowed.

  3. When setup is complete, click Finish.

  4. Confirm that ASP.NET 2.0 is installed and allowed:

    • Open IIS Manager. Click Start Administrative Tools, then Internet Information Services (IIS) Manager.

    • Click the + by the server name to expand its node.

    • Click the Web Service Extensions node. ASP.NET v2.0.50727 should be listed as Allow. If not, check your Event Viewer to locate any errors that occurred during installation.

  5. If you will be creating more than one server in a farm, now is a good time to run Windows Update, and shut down your virtual machine and backup your VHD and VMC files for reuse. Note that once a machine is joined to a domain, you can no longer use SYSPREP to reuse it for subsequent images.

2.2.4.4. Create a Stand-Alone WSS 3.0 Virtual Machine

This process describes the installation of WSS 3.0 and assumes a Basic setup. If Advanced is selected, you also have the option of specifying a database server external to the local machine, which creates a small farm rather than the stand-alone configuration. You should plan on this process taking about 30 minutes.

2.2.4.4.1. Create a Virtual Machine for WSS

In the last section, you prepared a base image for SharePoint. From here you can install either WSS or MOSS. Follow these steps to create a virtual machine on which to build a WSS server:

  1. Copy your SharePoint-prepped virtual machine's hard drive (VHD) into a folder marked WSS3Base and rename the VHD to match the folder name (e.g., WSS3Base Hard Disk.vhd). Create a new virtual machine configuration (VMC) in Virtual PC, also with the same name. Rather than create a new VHD, select An existing hard disk, and browse to your new VHD.

  2. Add a second network adapter and configure it as you did for your base image.

  3. Start your VM and log in.

2.2.4.4.2. Set Up WSS 3.0

Now that you have a virtual machine created, install WSS.

  1. Locate and run setup.

  2. If you agree to the terms of the agreement, check the box and click Continue.

  3. Choose the installation to perform. Advanced allows you to select between Web Front End and Stand-alone, and to set the location of the Content Index file. Basic is fine unless you have a reason to change these options. Either click Basic or click Advanced, then click Install Now to proceed.

  4. When the process is complete, leave the check box selected and click Close.

  5. Now you're in the WSS Configuration Wizard. Click Next. Click Yes. After that, it may seem that the 10 tasks will never complete (particularly 2 and 8). Be patient.

  6. Once configuration is complete, click Finish.

  7. A web browser opens. Enter your Administrator credentials and click OK.

  8. When the message box appears, click Add to include this server as a trusted site.

  9. Uncheck the box: Require server verification (https:) for all sites in this zone. Click Add. Click Close.

  10. If a message appears, check the box In the future, do not show this message, and click OK.

  11. Congratulations! Welcome to Windows SharePoint Services 3.0.

  12. Create a backup: Shut down this virtual machine, and copy the VHD and VMC to a safe location.

2.2.4.5. Create a Stand-Alone MOSS 2007 Virtual Machine

This process describes the automatic setup for MOSS 2007. The process should take you about 30 minutes. In a complete setup, you would also define service accounts and have the option of creating the SharePoint databases on an external SQL database. In the Basic setup described here, the SharePoint application pool will run with the identity of NETWORK SERVICE. While it is useful to understand how to correctly configure a domain service account, the purpose of this setup is to create a development environment.

2.2.4.5.1. Create a Virtual Machine for MOSS

Previously, you prepared a base image for SharePoint. From that image you can install either WSS or MOSS. Follow these steps to create a virtual machine on which to build a MOSS server.

  1. Copy your Windows Server 2003 Base virtual machine's hard drive (VHD) into a folder marked MOSS2007Base and rename the VHD to match the folder name (e.g., MOSS2007Base Hard Disk.vhd). Create a new virtual machine configuration (VMC) in Virtual PC also with the same name. Rather than create a new VHD, select An existing hard disk, and browse to your new VHD.

  2. Add a second network adapter and configure it as you did for your base image.

  3. Start your VM and log in.

2.2.4.5.2. Install SQL Server Developer Edition (Optional)

If you want to use SQL Server Developer Edition on this server, install it now. Note that the primary benefit is SQL Server Management Studio, and this can also be installed (with SQL Server Client Tools) and run from your host machine.

2.2.4.5.3. Install MOSS

Now that your virtual machine is prepared for the purpose, install MOSS.

  1. Locate and run setup for MOSS 2007.

  2. Enter your Product Key (PID) and click Continue. Note that it is the PID that determines the version that is deployed (Evaluation, Standard, or Enterprise). The installation bits for all versions are identical. You can upgrade from Evaluation to either Standard or Enterprise, or from Standard up to Enterprise by entering a new PID. However, you cannot downgrade after deployment.

  3. If you agree to the terms of the agreement, check the box and Continue.

  4. Click either Basic or Advanced. Advanced will allow you to choose between Complete (can add servers to form a farm), Web Front End, or Stand-alone (cannot add server to create a farm). If you installed SQL Server Developer or Standard Edition, or another SQL Server is available, select Complete. Advanced will also let you set locations for Administration applications and the Content Index. Click Continue when you are satisfied. Installation will begin.

  5. When it is complete, leave the check box selected, and click Close to run the Configuration Wizard.

  6. This is the SharePoint Products and Technologies Configuration Wizard. Click Next. Click Yes. In time, the 10 tasks will complete.

  7. When you see Configuration Successful, click Finish.

  8. A web browser opens. Enter your Administrator credentials and click OK.

  9. When the message box appears, click Add to include this server as a trusted site.

  10. Uncheck the box Require server verification (https:) for all sites in this zone. Click Add. Click Close.

  11. If a message appears, check the box In the future, do not show this message, and click OK.

  12. Congratulations! Welcome to Microsoft Office SharePoint Server 2007.

  13. Back up your virtual machine. Shut down this virtual machine, and copy the VHD and VMC to a safe location.

2.2.4.6. Install and Configure Active Directory and DNS

Active Directory server is an LDAP server that provides authentication services for SharePoint. The DNS server provides IP address translation services. Both are typical in a production intranet and will be required to create a development environment that simulates the production environment. The following steps are provided to create an AD/DNS server separately from a SharePoint server. If used to create these services on a SharePoint server, they must be followed before SharePoint (WSS or MOSS) is installed.

  1. Click Start, then click Command Prompt.

  2. Type dcpromo and press Enter.

  3. Click Next, Click Next again.

  4. Select Domain controller for a new domain. Click Next.

  5. Select Domain in a new forest. Click Next.

  6. Type the full DNS name for the new domain. This is not a web domain, so you can give it an entirely different suffix to avoid confusion with web domains (e.g., dev.myCompany.local). Click Next.

  7. Accept the default NetBIOS name (DEV if you used the above example). Click Next.

  8. Accept the default database and log folders unless you have a reason to use different locations. Click Next.

  9. Ditto for this page: Accept the default location unless you have a motive to do otherwise, and click Next.

  10. Select Install and configure the DNS server on this computer..., and click Next.

  11. Select Permissions compatible only with Windows 2000 or Windows Server 2003 operating systems, and click Next.

  12. Type a restore mode password. This can (and probably should) match your Administrator password. Click Next.

  13. Review your options and click Next. Active Directory is configured. Once the process begins, never click Cancel. To uninstall it or make changes, it is better to let the process complete and start over.

  14. If prompted to insert the Windows Server 2003 media, either put the disk in the local machine or use Virtual PC's CD menu to capture the ISO image you used when installing the OS. The DNS Service will be configured. Again, never click Skip DNS Installation.

  15. When the process is complete, click Finish. The next message will ask you to restart the computer.

  16. After logging in, a message may indicate say This Server Is Now a Domain Controller. Click Finish.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.170.239