Update: Modified PowerShell script to install missing Windows Identity Foundation feature and added instructions for SP1 slipstream install.
SharePoint 2013 service-pack 1 is officially out bringing with it support for Windows Server 2012 R2. This is most excellent news for SPDevs because finally SharePoint can be used on generation-2 virtual machines which for developer boxes is a much needed improvement due to the much improved integration for the standard VM viewer. Think remote-desktop type integration; this has been sorely lacking before R2 as Hyper-V is a server-room technology first & foremost so client-side integration has had to take a back-seat for the beginning of Hyper-V’s lifetime at least. Regardless, we now have it finally but it does involve rebuilding the entire virtual machine from scratch as generation 1 VMs can’t be converted or upgraded.
This environment will just consist of x2 VMs for now to try and save on memory/hard-disc:
- Domain controller box
- DNS services
- Active Directory services
- Certificate Authority services if needed later on
- SharePoint box
- SharePoint 2013 with all roles
- SQL Server – core database engine only
SharePoint just isn’t supported on AD servers as domain controllers have no concept of local security groups – something SharePoint uses a lot. Lots of SharePoint does work on AD machines; more than does not in fact but there’s plenty of functionality that just won’t work unless it’s on a standard member-server so that’s what we’re going to do too.
This guide will run through setting up the environment in the following stages:
- Configure Hyper-V + virtual networks
- Install Windows
- Prepare the AD + add SharePoint machine.
- Install software – SQL + SharePoint.
- Install developer apps.
- Update/tweak SharePoint VM ready to start developing.
1. Configure Hyper-V + Virtual Networks
For our setup we’re going to have a private network and a public one. The private network will be so the VMs can communicate directly. Create a private network (not “internal”; we don’t want the VM host on the private VM network).
Connect an external network to one of your physical network adapters so machines can see out to the internet when necessary.
You’ll want to download the Windows Server R2 image, from MSDN most likely as this is just for development:
Also if possible, use the SP1 slipstream ISO for SharePoint.
Both RTM + SP1 install methods are documented below.
Create new Generation 2 Virtual Machine(s)
Now create a new VM in your local Hyper-V. Hyper-V can be installed on Windows 8.1 or Windows 2012 R2 – for simple development environments you’ll not notice any difference between the two.
Call it whatever you fancy really.
Make sure you select “generation 2” – this is the new option that Hyper-V in Windows 8.1/2012 R2 gives us and it provides a much cleaner virtual machine over generation 1.
Give your VM 8 GB of memory with the option to grow. Once everything’s running it’ll consume up-to 16 GB easily; SharePoint development isn’t for developers on a shoe-string-budget for hardware that’s for sure.
8 GB is a nice starting amount of RAM – with dynamic memory enabled (not supported for SharePoint normally) Hyper-V will shrink the memory allocation if it’s not needed, which until SharePoint is on & configured will very likely happen. Setting it too low will cause of lot of disc thrashing once SharePoint’s installed and configured due to how quickly memory grows on start-up. This would likely cause various timeouts on a cold boot with an initial allocation of 8 GB at least; remember that SQL Server’s on this machine too. Don’t save money on memory for SPDev – that’s something everyone learns quickly if they fall short.
As for networking, select the internal network for now. Later we’ll add an external adapter too.
Next, put a disk somewhere local to the host machine; somewhere that has decent read/write speeds as it’ll be pretty disk intensive (hint: not a USB drive). Also give it up-to 200 GB of space (or more), not the default 127 GB as by the time we’ve installed all the tools & bits it’s going to get quite full. You can expand the disk later if necessary of course, and if you’ve got bags of actual hard-disk space it’s preferable to not use dynamically expanding disks if possible.
Finally, select the ISO to install from – pick your downloaded Windows 2012 R2 ISO as the install source.
Create an Active Directory/Domain Controller Server
SharePoint needs an AD to work properly; either use an existing AD box or build a new one by repeating the process for the SharePoint machine but with a starting memory allocation of 2 GB & x2 CPUs when you edit the machine…
Edit Virtual Machines to Add More Hardware
The “new VM” wizard for some reason doesn’t ask about CPUs or any other extras for that matter – presumably for simplicity’s sake. SharePoint at least needs at least 4 physical cores so be functional, especially given it’s an “all-roles-in-one” box + developer tools on-top installation so we need to go back and edit each VM to give them more CPU power.
For networking, you might want to also add an external adaptor too so the machine can see out to the big-wide-world when needed. When we don’t we can disable the adapter in the VM so as to avoid reconfiguring Hyper-V again.
2. Install Windows Server
Next up; a good old clean Windows install. Being generation-2 machines, this won’t take long at all. It’s so fast in fact I’ve seen gen-2 VMs install quicker than some real servers boot up, but I digress – start the ball rolling…
I’m based in Spain so I need a Spanish keyboard layout; get the right layout here so you don’t get keyboard rage later.
Click next; you want a GUI install. Server core is the preferred install generally but SharePoint doesn’t support it, not to mention this is a dev environment so unless you’re a PowerShell master you’ll be wanting a nice & easy GUI to get things done.
Select “advanced” setup so you can partition the virtual disc etc, and start the process. After a couple of reboot you’ll need to set a local administrator password and you’re done!
Enable New Virtual Machine Integration
At some point, you’ll see this window pop-up which you might not’ve seen before:
This is basically the new integration tools kicking in now Windows is fully loaded and the generation-2 interfaces kick-in. Think RDP for Hyper-V – you can connect host discs, copy/paste freely, play sounds, etc. It’s just much friendlier than the traditional integration. Configure this now – I’d highly recommend you connect up local discs (show options; local resources; more)
Make sure you select “drives” to connect your local disks to the VM for file-copying – a very convenient improvement in generation-2. Once you confirm the integration settings, the VM viewer tool will reconnect.
To edit these settings again you need to close the viewer, right-click on the VM in Hyper-V manager and click “Connect…” and which point the viewer will re-open and allow you to change the integration configuration.
I have to admit this wasn’t so obvious to me either but there you go.
Configure Local Network
At some point you’re going to have to setup the private network for your SharePoint + AD + any other boxes you want for testing (Office Web Apps server for example). Static IP allocation is the way to go; in this demo my DC is 192.168.100.10 and my SharePoint box is 192.168.100.20; DHCP is nice but prone to causing upsets later.
Every “client” machine, SharePoint included needs to reference the AD machine as its’ DNS server if it’s to join or be functional on the domain. It’s possible to configure the DNS server on the AD box to forward DNS requests if you wanted to route external requests on the private network instead of going out directly on each box, but anyway, the point is client DNS needs a healthy AD DNS to work.
3. Prepare the AD + Add SharePoint Machine.
Now first, we need an Active Directory setup. It’s a bit outside the scope of this guide but in short, give your AD server a static internal IP, install AD + DNS, configure a new forest & AD and reboot. You should now be good to go; you’ll find out when you try and add the SharePoint box to the domain if you’ve done this bit right or not 🙂
Prepare SharePoint VM – Add to Domain
Now all the system prep is done we want to add our new SharePoint machine to our domain. As ever it’s in system-properties:
If your SharePoint VM DNS settings are correct you should see this when you click “OK” and enter a domain admin credentials:
Good times. Reboot to complete the configuration.
4. Install Local SQL Server + SharePoint
After domain-joining the SharePoint VM you should now log in with a domain account; an administrator preferably. Remember the login is “domain\Administrator” not just “Administrator” as there’s a local account with that name too.
Get hold of SQL Server 2012 with SP1 integrated. Install a standalone instance – install the SQL setup files (let the installed find and install the newer setup files)
Anyway, follow the rest of the wizard – install just the database engine & management tools, use the default instance name (MSSQLSERVER) & add your current domain user to the list of DBAs when prompted. We’re going for a skinny SQL install because that’s all SharePoint needs for the most part.
Next step is to install SharePoint bits after running the prep-tool. At the time of writing there’s no slipstreamed SharePoint 2013 + SP1 install yet so we’re going to have to work around the fact the pre-requisites installer just doesn’t work very well on 2012 R2 – just running it will fail.
Install SharePoint 2013 + SP1 Prerequisites
If you have SharePoint 2013 installer with SP1 slipstreamed this is definitely the easiest way because the prerequisite installer actually works.
If however that’s not an option…
Install SharePoint 2013 RTM Prerequisites
What we need to do is manually what the installer would do; download & install the prerequisites. We need to configure the server roles and then install the list of packages that would normally happen automatically.
Install the roles needed with:
Add-WindowsFeature NET-WCF-HTTP-Activation45,NET-WCF-TCP-Activation45,NET-WCF-Pipe-Activation45 -Source D:\Sources\sxs
Add-WindowsFeature Net-Framework-Features,Web-Server,Web-WebServer,Web-Common-Http,Web-Static-Content,Web-Default-Doc,Web-Dir-Browsing,Web-Http-Errors,Web-App-Dev,Web-Asp-Net,Web-Net-Ext,Web-ISAPI-Ext,Web-ISAPI-Filter,Web-Health,Web-Http-Logging,Web-Log-Libraries,Web-Request-Monitor,Web-Http-Tracing,Web-Security,Web-Basic-Auth,Web-Windows-Auth,Web-Filtering,Web-Digest-Auth,Web-Performance,Web-Stat-Compression,Web-Dyn-Compression,Web-Mgmt-Tools,Web-Mgmt-Console,Web-Mgmt-Compat,Web-Metabase,Application-Server,AS-Web-Support,AS-TCP-Port-Sharing,AS-WAS-Support, AS-HTTP-Activation,AS-TCP-Activation,AS-Named-Pipes,AS-Net-Framework,WAS,WAS-Process-Model,WAS-NET-Environment,WAS-Config-APIs,Web-Lgcy-Scripting,Windows-Identity-Foundation,Server-Media-Foundation,Xps-Viewer,Windows-Identity-Foundation -Source D:\Sources\sxs
The software packages to be installed are as follows:
- Microsoft SQL Server 2008 R2 SP1 Native Client – click “download” and select “1033\x64\sqlncli.msi” – the client install only.
- Microsoft Sync Framework Runtime v1.0 SP1 (x64) – direct file link.
- Microsoft AppFabric 1.1 for Windows Server – pick x64 version – this must be installed only from the command-line with “.\WindowsServerAppFabricSetup_x64.exe /i CacheClient”,”CachingService”,”CacheAdmin /gac”
- Microsoft Information Protection and Control Client (MSIPC) – direct file link.
- Microsoft WCF Data Services 5.0 for OData V3 – only one download.
- Cumulative Update Package 1 for Microsoft AppFabric 1.1 for Windows Server (KB 2671763) – pick x64 for your language (ENU probably). Install after AppFabric.
Install SharePoint Server
Now we can install SharePoint 2013 by running “setup.exe” to launch the normal setup program. Select “complete” installation as we already have SQL Server ready (plus management tools).
When this finishes, do not run the wizard if this is RTM! We’ll do that once it’s all patched-up to SP1, which if your install isn’t slip-streamed will need to be done separately.
5. Install Development Tools and Office Apps
Next we want to get all our development tools & dependencies installed. First up; Visual Studio. 2013 now comes with the Office tools built-in which is nicer than before as they were separate. Install Visual Studio first.
Then we want to get Office + Visio + Project + SharePoint Designer on at the same time because installing new Office components requires the service-packs & some patches to be reapplied afterwards. Yes, SharePoint Designer is technically a part of Office so if you install SPD after patching Office to SP1 for example you’d have to re-apply SP1 again.
Obviously we need to create a new farm at some point soon. Some people have all-singing, all-dancing scripts to do it (and even me too) but for developer environments I tend to prefer a more practical approach of just creating stuff as it’s needed. Everything will run under the one service-account which is a local admin (and thus breaking every best-practise in the book) but as we’re in dev-land we don’t care for now. Add your farm account to the local admins group:
Then fire up the wizard and create a new farm.
Make it clear this is a development farm.
I’ll not go into the ins’ & outs of configuring a developer “farm”; needless to say on a dev-box most good practises go out the window anyway. Just make sure your testing/staging/production environments do not in any way mirror the lazy setup that’s fine in development. Seriously don’t; minimum security practises are essential for security but we don’t need it in dev.
6. Updates, Tweaks, and Tools
Once you’ve got everything installed, the system will need patching. Start by installing Office 2013 service-pack 1 – http://support.microsoft.com/kb/2817430 as that covers a multitude of sins.
After that, run Windows Update too to bring everything up-to-date too
You’ll probably have lots to update; leave it updating overnight to reduce patch-stress.
Final Touches – Make Your VM Nice to Develop With
This is going to be a development environment which means maximum convenience 1st; security and correct architecture 2nd. The machine can die and it won’t matter in other words so we’re going to make it all cosy to use, which servers by default aren’t. This next bit is completely subjective – what’s comfortable to me might not be to someone else but I thought I’d jot it down anyway.
Install Useful Tools
I have a standard set of SPTools I like to use on dev machines and even some production machines. These are:
- My very own ULS Studio for capturing ULS logs in real-time. It’s a work in progress and there are other tools out there but my version isn’t bad either (not that I’m biased at all, honest). There is of course also ULS Viewer too which most people seem to use. For now 😉
- Fiddler – for HTTP tracing. Very useful.
- Network Monitor for taking lower-level traces & not just HTTP.
- SMTP4Dev – SMTP server for testing alerts. It shows just a log of messages received; perfect for development.
- Telnet Windows component – useful for probing firewalls & raw network responses. Installable via Server Manager (Windows Features).
- Process monitor – kernel-level troubleshooting for access denied issues.
- Firefox + Firebug add-on for alternative browser testing. Firebug is a great HTTP debugging tool if you don’t want to use the IE11 tools (which have had a major overhaul since IE10).
- SharePoint Manager – great for traversing the SharePoint object-model from farm to individual list items.
- WinRAR – archiving tool.
- ILSpy – handy for peeking inside any assembly quickly.
- LINQPad – execute C# directly against SharePoint, PowerShell style.
Disable Overly Protective Security
Start by turning off UAC and the IE lock-down mode. Don’t do either of these in production of course; they’re there for a good reason. In server manager, under “local server” you’ll see a link called “IE Enhanced Security Configuration”. Click it and disable IE ESC for both types of users. To disable UAC, search on the start screen for “UAC” and you’ll see “Change User Account Controls setting” – open and move setting to “Never notify” – a dangerous move normally as UAC is a great help in making sure nothing wants to sneakily change your system configuration (for better or worse) but on this development environment there’ll be nothing of any real value running except our code.
Again, this security is normally pretty useful as humans don’t do such a good job of checking files for threats but I digress…
Configure Windows for Development Environment
Related to that it might be an idea to install the “desktop experience” role as things like Windows Explorer library views don’t work without this. I tend to keep a Windows 8 test client around for when I need to check things like that just to make sure the communication setup is realistic for testing purposes (in reality, nobody connects to “localhost” for their SharePointing).
The other thing is stopping the server manager from constantly popping up; under the “Manage” menu, select “Server Manager Properties” – in there you can stop it loading each login.
Last thing – you might want to enable smart-screen; Windows will keep bothering you until you at least choose.
Finally turn off screen power-down in power options. This isn’t a real machine so powering down the screen and the subsequent password challenge just is a pain.
So that’s it; I hope you’ve got the essentials of setting up SharePoint on the newly supported Windows. This unlocks the full potential of the newest Hyper-V platform and this will ultimately make life easier for SharePoint development projects. Progress!
// Sam Betts