Sunday, October 28, 2012

Installing SharePoint 2013 on Windows 2008 R2


1 - Introduction
This installation guide for SharePoint 2013 will help you to install SharePoint 2013 on a single server with SQL Server while leveraging the best performances for a trial or development environment.
Here is the link to the  official Microsoft documentation. And the definition and the purpose of such an environment explained within this documentation:
A single server installation consists of one server that runs both SQL Server and SharePoint 2013. You can install and configure SharePoint 2013 on a single server if you are hosting only a few sites for a limited number of users or if you want to create a trial or development environment. This configuration is also useful if you want to configure a farm to meet your needs first, and then add servers to the farm at a later stage.
Server : Virtual machine based on VMWare Player 4.0.1
Server OS
: Windows 2008 server R2 64 bit
SQL Server
: SQL Server 2012 64 bit
SharePoint
: SharePoint Server 2013 Preview
Duration
: 10 hours if you haven't downloaded the OS and SQL Server 2012 softwares

Ideal for a trial or development environment
As usual All the previous products are either free (VMWare Player) or can be downloaded as a trial version (Windows server 2088 R2, SQL Server 2012), so as you can install SharePoint 2013 using this guide without having to buy any software. SharePoint 2013 is available as a Beta version.
As we encountered performances problems for the development environments with SharePoint from the 2010 version I will provide in this guide, operations, tips and tricks that can improve performances for a trial or development environment.
 I will also use several local service accounts in order to be compliant with the least privilege administration policy.
What's new in SharePoint 2013 installation
1. you have not to configure your server for SharePoint. All is perfectly done by the preinstallation tools of SharePoint 2013

2. The preinstallation tools are working perfectly well. That was not the case for the Beta version of SharePoint 2010
What's new in this post comparatively with the one for SharePoint 2010
As there is almost no configuration tasks to do, I take benefits of it and can leverage in this post the operations to do for enhancing performances of a trial or development environement.


I have to thanks here AndrĂ© Vala and his  fantastic post on the topic . I have here detailed almost all the operations pointed out by AndrĂ© within his post.
2 - Creating the Virtual Machine
2.1 - Using a good external drive
You will increase the machine performance first by choosing a good external drive.The best would be to use an e-Sata SSD drive.
 I personally bought a Kingston Hyperx 3K SSD of 120 GB. It's not e-Sata but I had very good performances with it. Much much faster than with my other external drives. It was not that much expensive either.
2.2 - Downloading VMWare Player
You can downlaod the latest version (5.0) of VMWare Player  here. I personnally still using the 4.0 version in this post...
2.3 - Download Windows Server 2008 R2 Evaluation 
2.4 - Creating the virtual machine
Once you have the .iso file for the OS, open VMWare Player and click on "Create a New Virtual Machine".

Select the "Installer disc image file (iso)" radio button and browse for the .iso file previously downloaded. The wizard will detect the version of the OS.

Click next
The wizard will retrieve automatically your user account.

Don't provide any product key you don't need any for this evaluation version, but take time to provide a password because this account will be one of your Administrator accounts for your new Virtual Machine and using an Administrator account that has not a password will lead to many problems when configuring your machine and more trouble when working with SharePoint 2013.
Choose version of the Windows 2008 R2 OS. for a developement environment,


I advice to choose standard in order to reduce the features and so the use of ressources.

Click OK for the "no license key" warning message

Choose your virtual machine name and location.

Specifying the main Hard Disk settings.For the HD size, I recommend 35 GB especially if you want to install visual studio 2010 or 2012 later. We will also install SQL Server 2012 later and it is more disk space demanding than the previous version.


After having done all the installation (without Visual Studio), I have 13 GB left.
So you could maybe decrease the disk preallocated space to 30GB or at least 27 GB.


As you will see later, all the database files and log files will be placed on other drives, so the main disk free space shouldn't decrease so much after the installation.
Very important : for performance reasons use a single file option for storing the disk
click Next
The wizard prompt you it is ready to create the virtual machine and summarize
your choices, but don't launch the machine creation right now.


Click on the "Customize Hardware..." button, because we have important configuration
operations to be done for increasing the environment performances.
For the machine Memory, it depends on your host memory.


I have 4GB of RAM on my host computer (laptop) and I had the best results with 2.5 GB of RAM for my virtuals machines.
Don't forget to set the same number of processors as your host if you want the best performances
Now, always for performance concerns, disconnect all that can be disconnected for an SharePoint 2013 developement environment, blue tooth and eventually USB
sound card
printer
Then you can close the pop up, go back to the wizard main screen and start the installation of the OS on the virtual machine
I noticed the benefits of using a SSD disk. The installation only lasted 20 minutes.
With normal disks, it is usually 30 to 45 minutes.
3 - Configuring your Virtual machine
3.1 - Windows Activating
Go back to the "Initial Configuration tasks" windows and we are going to go through the standard configuration operations easily because the windows lits them.
Be sure the Virtual machine has an Internet acess.
We have to activate Windows in order to take advantage of the 180 days of the evaluation process.Click on the "Activate Windows" link.


Do not look for any product key, as said before, you do not need any, just click next.
The activation will be done automatically through Internet.


You will notice then the activation number and the number of days remaining on the bottom right corner of the desktop.
3.2 - Changing Computer Name
Now, always on the "Initial Configuration Tasks" panel, click the "Provide computer name and domain" link,then set your new Virtual machine name.
3.3 - Installing updates
Click the "Download and install updates link", and proceed to the latest updates installation.


Then set automatic updates to only warn you when new updates are available for download, because you don't want the download and updates installation to bother you unexpectedly when you are doing a important operation of development on your development environment.
3.4 - Disabling Internet Explorer Enhanced Security
To disable Enhanced Security Configuration to specific users by using a computer running Windows Server 2008:
1. Click Start, point to Administrative Tools, and then click Server Manager.
2. If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Continue.
3. Under Security Information, click Configure IE ESC.
4. Under Administrators, click On (Recommended) or Off, depending on your desired configuration.
5. Under Users, click On (Recommended) or Off, depending on your desired configuration.
6. Click OK.
7. Restart Internet Explorer to apply Enhanced Security Configuration.
3.5 - Adding Desktop Experience feature
It would be interesting for a development machine to be able to use the Windows Photo Viewer in order to check some screenshots taken during configuration phases, or when wanting to report an issue. To be able to use this feature of Windows server 2008 R2 you have to activate the Desktop Experience feature.

Go back to the  "Initial Configuration tasks" window and click "Add feature", then locate "Desktop Experience" check box and check it.

3 - Configuring your Virtual machine for best performances
Warning: most of the following operations are worth for a trial or  development environment, but you shouldn't do it for other environment (QA, staging, test, build, production,etc.)
3.1 Network configuration
In the network configuration options, uninstall the QoS Packet Scheduler and the Link Layer Topology Discovery components, and uncheck IPv6.
3.2 Turning off firewalls
There is three firewalls: Private, domain, Public. Turn them off.
3.3 Settings the system properties for best performances
Go to the computer properties:
Set the system for the best performances
Then in the "Advanced" tab adjust for best performances for program because you don't want a SharePoint or Windows process to bother you when you are programming on your development environment.
4 - Adding 3 new Hard Disks to your machine
We are now going to add disks to our virtual machine in order some files to be stored on them and increase the virtual machine performances.
There are 3 kinds of files we want to be stored on separated hard drives:
The paging file
The log files
The database files
4.1 How to add a new hard drive to a virtual machine
Go to the VMWare settings available at the top of your desktop. On the Hardware tab click the "Add..." button, select Hard disk and click next.
In this disk we are going to store the paging file, some of the database files and some of the log files, so set a preallocated disk space of 15GB.


Preallocate disk space and storing the disk using a single file increase the performances, so let's do it that way.
You can rename the disk if you want and choose a specific location on your external hard drive. I personally let the default options.
You can see the new disk in the VMWare settings when it is created.
4.2 How to add a new volume to the machine with the created hard drive
Now open the Computer Management panel
Under the Storage node, open the Disk Management. The system prompt you to Initialize the new hard drive.
Then right click the "Disk 1" lable and launch the "New Simple Volume" wizard
We are going to call this volume "Data". for best performances, select an allocation unit size of 64K
The new Simple volume wizard is the summarizing your choices. And when you click "Finish" the new volume will be formatted and added to your system.
4.3 Adding two new Hard drives to the machine
We are going to add 2 more hard drives to the machine. 5 GB each and called log and TempDB. You should obtain this after having finished the operations:
4.4 Storing the pagefile on the first hard disk
Go back to the computer properties, then on the performances settings, then on the Virtual Memory group click the "Change.." button.
1. Set the paging file to be stored on the Hard Drive D.

2. The initial size is equal to the RAM of your virtual machine

3. The maximum size is three times the initial size value.
5 - Installing the windows 2008 server R2 SP1
If you had an old version of the Windows 2008 Server R2 trial version you should now have to use the Windows automatic updates to pass the SP1. 
If you have downloaded the trial version of the OS recently, skip this step because the new trial version comes with the SP1 included.
6 - Installing SQL Server 2012
6.1 Creating the SQL_Service account - about least privilege administration
When installing software,  it is safer to use service account that has no permissions at all and to use different accounts for each process or service. This is the least privilege administration policy.
For a SQL Server installation within a SharePoint farm, Microsoft  recommend creating a service account.
6.2 Installing SQL Server 2012
Running the install executable will unzipped the installation files
then run the the SETUP of SQL Server 2012
then, on the SQL Server Installation Center select Installation and "New SQL Server Stand alone installation"
Pass the Product Key screen
the License Terms
Allow Setup Files to be installed
Pass the Setup Support Rules
On the Setup Role screen, let the first default option checked
Pass the installation rules
Then on the feature selection, for a basic SharePoint installation you have ONLY 2 checkboxes to check:Database Engine ServicesManagement Tools - Basic
Then for performances purpose set the root instance directory to be on the D drive
Pass the Disk Space Requirements
now is the time to use the service account previously created. In the next screenshot, I have made a mistake. The service account should have been used for the SQL Server Agent and the SQL Server Browser services.
Then set the collation for SharePoint
On the Database Engine Configuration Screen, choose mixed mode because SharePoint sometimes allows it, and because it is useful to be able to use the sa admin account if there is some problems with the administrator domain or local account. 
Add the current user as administrator because when installing SQL Server you often use the administrator account.
Now is the time to split our database files for them to be stored on the different hard drives in order to increase our machine performances.
regarding the filestream it is not clear yet. Here is a link on the topic (FILESTREAM with SharePoint 2010) where you can read this comment:"Microsoft reckonts its a bad idea to have filestream enabled in Sharepoint." 
I personally let it unchecked on this installation:
Pass the Error Reporting screen
Pass the Installation configuration Rules
The installation wizard summarize our choices and you can run the installation
You should obtain this screen after the installation of SQL Server 2012 is complete:
7 - Configuring SQL Server 2012 for best performances
7.1 Within SQL Server Management Studio
 Open SQL Server management studio
Right click the Database engine and click "Properties".
In the "Memory" screen set the maximum Server Memory to 500 MB.
In the "Advanced" screen set the "Maximum Degree of Parallelism" to 1.
 Locate the tempdb database node, right click it and click properties
In the "Files" screen,
1. For performances reasons, always use, at most, one data file for each CPU core of the system. Ideally, you should use one data file for each 2 CPU cores.
So, if you have two CPU core on your host machine as I have, add a new file that you will name tempdev2, it will be automatically created on the D drive and that is a good thing for performances. 

2. Set the initial size of the three files to 1000 MB (1 GB).
3. Set the autogrowth to 512 MB
Warning.
Don't forget. You will have to do this for other databases as long as you are adding web applications and search services to your farm : 
Use more than one data file in the primary file group for the TempDB, search DBs and content DBs of SharePoint.
7.2 Within SQL Server Configuration Manager
 Open SQL Configuration Manager.
Locate Protocols for MSSQLSERVER and enable "Named pipes"
7.3 The "locked pages" topic
In his post about  increasing the performances of a SharePoint development environment, AndrĂ© Vala recommends to authorize SQL Server to use the Lock Pages in Memory feature to keep Windows from unloading the memory pages that might still be needed, leading to a performance degradation.
I won't illustrate this topic in this post rignt now, but maybe later on an updated version. I provide you with the:

8 - Installing SharePoint 2013
8.1 Starting the SharePoint 2013 Server Installation
 Go to the Virtual Machine Settings of VMWare and navigate to the "CD/DVD (IDE)" settings
In the "Use ISO image file" field, reference the downloaded image of the SharePoint 2013 Server software, and check the "Connected" check box.
When returning to tour machine, the SharePoint 2013 Server installation software will automatically start up.
8.2 Running the SharePoint 2013 Preview Products Preparation Tool (installing the SharePoint 2013 prerequisites)
Click the "install software prerequisites" link, and pass the License terms
Pass the summary
You will have to reboot your virtual machine
the installation will continue then,
and will complete.
8.3 Running the Software Update KB2759112
In the Microsoft official installation guide for SharePoint 2013, after you complete the Microsoft SharePoint Products Preparation Tool, you must also install the following.
KB 2554876
KB 2708075
KB 2759112
The two first items are included in the Windows 2008 Server R2 SP1, so, no need to install them. This is the link to get the third one KB 2759112.
Run the KB 2759112.
8.4 Creating the database access account in compliance with the least privilege administration policy
You can check the  Microsoft recommendations about this topic and then needed accounts that I have already referenced previously in this post when we have installed SQL Server 2012.
Create a new local account and call it SPS_Farm
We are now done with the accounts creation required for the main installation of SharePoint 2013.
The first account, SQL Server service account, SQL_Service was created previously. The setup user account is the one you are currently logged in with, the only one that has the administration permissions for the virtual machine. And we have just created SPS_Farm, the server farm or database
access account.

Go back to the SharePoint 2013 installation screen and this time click on the "Install SharePoint Server" link. You are prompted for the preview license key that is available for free so I did not blur it in my screen shot.
Pass the License terms
In the "Server Type" screen, choose the "Complete" installation.
In the File Location screen, make the search index files to be located on your previously created D drive.
Then, launch the installation.
On the Run Configuration Wizard, UNCHECK the check box, because, as we are using local accounts the SharePoint 2013 Farm creation will fail after we have typed the Server Farm Account with this error message "the specified user SPS_Farm is a local account. Local accounts should only be used in stand alone mode."
So  UNCHECK the check box and CLOSE the wizard

8.5 Using SharePoint 2010 Management Shell to create the SharePoint 2010 Configuration databases
Open the SharePoint 2013 Management Shell
Type the following command
New-SPConfigurationDatabase
run the command by pressing the Carriage Return Key
The Shell willl ask you for:
The database name --> choose any name, for example SharePoint_Config
The database Server name --> type the name of your Virtual Machine in my case VMDEV-016
You will be then prompted for the Farm credentials. This the time to use the Server Farm Account, SPS_Farm. So type the account login and password.
Then you are asked for a passphrase. You can use P@ssw0rd that matches the security policies
required. (This passphrase will be asked when you will add a new server to the SharePoint Farm)
The system will take a LONG time (something like 15 minutes) to create the SharePoint Farm databases, so don't panic and just wait.
You will obtain this screen when it is complete:
8.6 Finalizing the SharePoint installation
Now is the time to finally run the SharePoint 2013 Products Configuration Wizard that we have closed previously.
Click, yes on the warning dialog
do not disconnect from this server farm
I recommend to specify a port number for your trial and development environments that will allow you to always know how to access the SharePoint 2013 central administration by typing an url. I personally always use the 55555 port number.
The wizard is summarizing the farm settings,
then perform the last configuration tasks, for finally announcing a successful configuration.
When you click "Finish" the Central Administration site for SharePoint 2013 is going to be provisioned. Then, the Central Administration site for SharePoint 2013 automatically opens.
You are prompted for your credentials.
The SharePoint 2013 Central Administration site is displayed and you are asked to participate to the Customer Experience Improvment Program.
Then you are asked to use the configuration wizard. For always performance reasons, don't use this wizard, because you want the minimal services and processes to run in your trial or development environement.
you are finally able to display the Sharepoint 2013 Central Administration site while knowing your virtual machine will run with the best performances!
Very well done!