TFS2010: Installing pre-requisites from the command line

Grant Holliday’s blog

Senior Service Engineer, Microsoft Visual Studio Team Foundation Service

TFS2010: Installing pre-requisites from the command line

  • Comments 1

On the Team Foundation Server team, there is a new build of the server every night that comes out of our build lab. These vary in quality throughout the development cycle and the QA teams look at them and rate them as “Self Test”, “Self Test (with workarounds)”, or “Self Toast”.  The QA & dev guys have lots of fancy automation for deploying nightly builds and testing them out, but I like to stay away from that stuff and use the builds as if I were a real customer. Once a build is declared “Self Test”, I’ll grab a copy and spin it up in a VM to see what’s changed.

The two preparation things I’ve done that have really sped up my installation turnaround times are:

  1. Create a sysprep’d Windows Server 2008 R2 VHD
  2. Create a SQL2008 SP1 slipstreamed installation point

Once I had those in place, I then just used these two long command lines below to install SQL & IIS. Of course, none of this is necessary for a “TFS Basic” install, since the installer will drop down IIS & SQL Express for you.  See Brian’s blog on TFS 2010 for SourceSafe Users for more details on that.

Creating a sysprep’d Win2008 R2 VHD

Creating a sysprep’d VM is easy. Create a new VM and install a fresh copy of Windows 2008 R2. If you have a domain, join it to the domain and add yourself to the local administrators group (this will be retained after you sysprep & rejoin to the domain again).  I don’t usually add the IIS role at this point, since I use these VHD’s for other things. Once you’re happy with it, run the following command:

C:\Windows\System32\Sysprep\Sysprep.exe /oobe /generalize /shutdown

Then take a copy of the VHD and name it something like ‘Win2008R2Sysprepped.vhd’.  Whenever you need a fresh machine, just copy this VHD to a new file and away you go.

Creating a SQL2008 SP1 slipstreamed installation point

Follow the instructions for creating a slipstreamed drop on the SQL Server Setup team’s blog. Two things to note when doing this:

  • Paths matter – it’s best to pick a folder name and stick with it whenever you use it. e.g. C:\SQL2008SP1\
  • You DO have to download the ia64 & x86 SP1 packages & slipstream them as well, otherwise your setup.exe will fail

Once you’ve created the installation point, save it away somewhere – it’s really useful and it saves so much time by not having to do an RTM install followed by a SP1 install.

Installing TFS pre-requisites from the command line

  • Boot into your fresh 2008 R2 VM
  • Give it a new name, join it to the domain, apply any updates, reboot, etc
  • Install SQL2008 SP1 from your installation point:

Setup.exe /q /ACTION=Install /FEATURES=SQL,FullText,AS,RS,Tools /INSTANCENAME=MSSQLSERVER /SQLSVCACCOUNT="NT Authority\Network Service" /RSSVCACCOUNT="NT Authority\Network Service" /ASSVCACCOUNT="NT Authority\Network Service" /AGTSVCACCOUNT="NT Authority\Network Service" /SQLSVCStartuptype=2 /RSSVCStartupType=2 /ASSVCSTARTUPTYPE=2 /AGTSVCSTARTUPTYPE=2 /BROWSERSVCStartupType=2 /SQLSYSADMINACCOUNTS="Builtin\Administrators" /ASSYSADMINACCOUNTS="Builtin\Administrators" /SQMREPORTING=1 /ERRORREPORTING=1 /INDICATEPROGRESS

  • Install required IIS components:
    • Open a command prompt as administrator
    • Type the following command:

ServerManagerCmd -install WAS WAS-Process-Model WAS-NET-Environment WAS-Config-APIs Web-Server Web-WebServer Web-Common-Http Web-Static-Content Web-Default-Doc Web-Dir-Browsing Web-Http-Errors Web-Http-Redirect Web-App-Dev Web-Asp-Net Web-Net-Ext Web-ISAPI-Ext Web-ISAPI-Filter Web-Health Web-Http-Logging Web-Request-Monitor Web-Security Web-Windows-Auth Web-Filtering Web-Performance Web-Stat-Compression Web-Mgmt-Tools Web-Mgmt-Console Web-Mgmt-Compat Web-Metabase Web-WMI Web-Lgcy-Scripting Web-Lgcy-Mgmt-Console

At this point, you’re now ready to run setup.exe from the TFS media. You have a fully configured SQL server and the requires IIS pre-requisites installed.

Other useful SQL 2008 setup.exe command lines

For a TFS “Application Tier Only” install, IIS is one pre-requisite and the “SQL Client Tools Connectivity” is the other one.  This is required so that the TFS Job Agent can talk to Analysis Services and tell it to process the warehouse.  Here’s how to install just the client tools:

setup.exe /ACTION=Install /FEATURES=Conn /ERRORREPORTING=1 /INDICATEPROGRESS /SQMREPORTING /Q

If you just want to install SQL Server Management Studio on your developer machine:

setup.exe /ACTION=Install /FEATURES=ADV_SSMS /ERRORREPORTING=1 /INDICATEPROGRESS /SQMREPORTING /Q

For more information, see How to: Install SQL Server 2008 from the Command Prompt and available features.

  • If you are installing SQL Server 2008 R2 from the command line you'll need to add:

    /IAcceptSQLServerLicenseTerms

    to the command line.

Page 1 of 1 (1 items)