Team Foundation Server 2010 Build Agent not part of the domain


 

image
Figure: Ports Required
Technical Details

To support this initiative we employ the use of shadow accounts (mirrored local accounts). In our test case we created local accounts named “localTfsBuild” on the Team Build Server and Team Foundation Server Application Tier using identical passwords. A host entry was also added on the Team Build Server with the TCP/IP address and host name of the Team Foundation Server Application Tier.

Using the Team Foundation Server Administration Console on the TFS Application Tier we add the local account created above into the “Project Collection Build Service Accounts” group.

The Build Service is installed but not configured initially, with the Project Collection information added later. In the build configuration wizard don’t select a project collection just leave it blank, then use network service and get to the end.

 

Steps (performed on the Build Server)

Run the Team Foundation Server 2010 Setup

Click on the Team Foundation Build Service Checkbox

On the last install dialog uncheck the Launch Team Foundation Server Configuration Tool Checkbox and click Finish

Install TFS 2010 SP1

Install TFS 2010 SP1 Cumulative Update

Launch the Team Foundation Administration Console

Click on Build Configuration

Click Configure Installed Features

SNAGHTML29d1c04d

Click Start Wizard

Click Next

SNAGHTML29d3044f

Do not select a team project collection and Click Next

SNAGHTML29e572ca

Click Next 

SNAGHTML29e60e3e

Click Verify

SNAGHTML29e6f217

Click Configure

SNAGHTML2a94fe2b

Click Next

SNAGHTML2a96f871

Click Close

SNAGHTML2a97ba78

Click Close

SNAGHTML2a99115d

Click Stop to stop the Build Service, then Click Properties

SNAGHTML2a9a420e

Click Browse

SNAGHTML2a9b4e2e

Click Servers…

SNAGHTML2aad7ccd

Enter the Name or URL of your Team Foundation Server and Click OK

SNAGHTML2ab03938

Enter the credentials of a user (like DOMAIN\_tfsInstaller) with Admin permissions on TFS 2010 and click OK

SNAGHTML2ab13dca

Click Close

SNAGHTML2ab200cb

Select the Team Project Collection you want to add the Build Service and click Connect (You may be prompted again for credentials – just enter them a second time)

SNAGHTML2ab3bb24

In the Credentials section select This account and enter the credentials of the build account .\localTfsBuild and the password.and click Start

SNAGHTML2ab54f77

If you made it here then the service should be running and configured, if you received an error connecting verify the localTfsBuild account is the same on both machines and that the passwords match, do not specify an alias for the TFS server use the real machine name and if a DNS lookup is not available make sure the name and IP address of the TFS server is defined in the local HOSTS file of the build server.

Click New Agent…

SNAGHTML2ab96fc3

Click OK (unless you want to change any of the default settings)

SNAGHTML2ad167a8

The Agent should be started (indicated by the Green color)

 

If the Agent does not start, you must make sure your build server resolves from the TFS side of the network (try PING) if the HOST name does not resolve to an IP then add it to the DNS.

Use the Test Connection on the Build Agent Properties dialog to test communications between the Build Agent, TFS Server and Build Controller.

SNAGHTML2ad4e041

If you have still have connection issues verify the Windows Firewall is not causing your problem, verify the network connection shown in Network and Sharing Center is either Private Network or Domain Network otherwise inbound traffic will fail.

Below is an example of a FIREWALL issue blocking communications on TCP Port 9191

SNAGHTML2af33c75

Default Agent – Not Really Ready (indicated by the Red color)

SNAGHTML2af3f815

Clicking Build Agent Properties shows status as Build Agent Unavailable

About Wes MacDonald

Wes MacDonald is a DevOps Consultant for LIKE 10 INC., a DevOps consulting firm providing premium support, guidance and services for Azure, Microsoft 365 and Azure DevOps.

21 Responses to “Team Foundation Server 2010 Build Agent not part of the domain”

  1. Wes, thanks for your post.
    After reading this, we could configure build agent as workgroup envrn.
    However, it only works for those machine that running as server 2k3, but for window server 2008 R2.
    We could register the build service to TeamProject collection, but when creating an agent, it’s always stopped or at unknown state.

    What operating system that your build server running on?

    Like

    • I did the walkthrough on Windows Server 2008 w/SP2 (x32). It should not matter though, what error are you receiving when you try to create the agent?

      Like

      • I don’t get any error. The build service create ok but the agent staying at unknown or stop state somehow. I don’t see any error from event viewer thou.
        How’s strange…..

        Like

      • I would check three things: Disable the firewall on the build agent to see if the agent works, then make sure the NIC connection is either set to Private or Domain so the firewall exclusions work properly. Make sure you can ping the build agent by name from the controller and application tier and the build agent can see the controller and application tier. Check the TFS Application Tier and the Build Controller for errors.

        Like

  2. Does that trick work for TFS11?

    Like

  3. Mac,

    I was looking for just the same info and lucky to find yours.

    We have Development server where We installed both TFS 2010 Application tier and also TFS build server. And this server OS is Windows Server 2008 R2 and lets say located in domain X. I followed the steps mentioned as,
    1. created a local account (localtfsbuild) on this server.
    2. I added the user localtfsbuild into Project Collection Build Service Accounts.
    3. I did build configuration first not selecting any project collection and initially ran under NT Authority\SYSTEM credentials. Then added project collection(residing on the same server) and now changed credentials to run under localtfsbuild.

    We have workstation running Windows XP and in other domain lets say ‘Y’.
    we wanted this to be our BuildMachine so we installed TFS 2010 Build Service and now trying to configure with mirror account as you mentioned.
    1. Created localtfsbuild a local account.
    2. Initially without selecting any project collection, configured with NT AUTHORITY\SYSTEM credentials. Now when I try selecting Project Collection created on TFS Server and trying to use localtfsbuild credentials but it NOT started and I am seeing the following message in eventviewer log,

    Build Service received Stop command and will be stopped. Details: Could not open http channel

    when I was using NT AUTHORITY\NETWORK SERVICE in both Build Server and Build Machine we are running into sgen.exe errors.
    any information on this will be greatly appreciated.
    Thanks
    Bug

    Like

  4. Problem here doing this configuration for two different domains. When I set the user for the build service to “.\localTfsBuild” and press start I receive the following error:

    “Cannot register Team Foundation Build Service: User account TFS\localTfsBuild not found”

    I don’t know from where the “TFS\” came from.

    If a change my username to “TFSES\localTfsBuild” (where TFSES is my TFS Application Tear) the message changes:

    “Cannot register Team Foundation Build Service: Failed to grant TFSES\TfsBuilds access to the IIS configuration and other directories used by ASP.NET. Details: aspnet_regiis.exe failed with code 1.”

    I supposed this is due to the “TFSES\”… Any help here? Any information on this will be greatly appreciated.

    Like

    • Hi,

      Are you trying this with TFS 2010 or 2012?

      1. You created local accounts on both the build server and tfs application tier and the passwords match.
      2. Make sure the machines have name resolution for each other on both sides (using the HOSTS file)
      3. If you have a firewall between the machines ensure port 9191 is open

      Let me know if you’re still stuck. TFS 2012.2 supports TFS 2010 Build Servers, see the following blog post: http://blogs.msdn.com/b/visualstudioalm/archive/2013/04/04/10407416.aspx

      Wes

      Like

      • Hi Wes,

        I’m trying this with TFS2010. My Application Tier is inside my corporate network but I want to configure the Build Controller/Agent in my client network, so I have different domain and networks and the connection to my client network is through Juniper Terminal Services, so I’m not able to open ports nor map my client IP Address through the HOSTS file.

        Maybe this is the problem. This scenario maybe not supported…. 😦

        Any help would be very appreciated.

        Regards,

        Like

      • Hi,

        That scenario you describe is not supported. The build agent has to be able to contact the TFS Application Tier directly which is not possible over Terminal Services.

        Wes

        Like

  5. Followed all the steps, however when trying to setup the agent, the “Controller” drop down is not being populate. Could this be a firewall issue?

    Like

Trackbacks/Pingbacks

  1. Links–09/08/2011 » ALM Rocks! - September 8, 2011

    […] Team Foundation Server 2010 Build Agent not part of the domain […]

    Like

  2. September 13, 2011 – Learn TFS Daily | Learn TFS - September 13, 2011

    […] Team Foundation Server 2010 Build Agent Not Part of the Domain from Wes Macdonald Wes has a post that expands on Neno’s explanation and provides a bit more detail on the step-by-step process required to install a build agent on a machine not part of the same domain as your TFS server. Between the two posts, you should be in good shape. Networking issues can be a nightmare, so be sure to read Wes’s comments for some best practices to troubleshoot connectivity issues you may run into. This post authored by Trent Nix Read more from Blog Click here to cancel reply. […]

    Like

  3. What to do when your TFS build agent says it is ready, but the icon says it is not - But it works on my PC! - September 17, 2011

    […] if you are trying to use build agents that are not directly on your LAN/AD (see this lovely clear blog post on how to set up using a non-domain joined build agent) there is a good chance you will not have DNS working as expected. So make sure the controller can […]

    Like

  4. What to do when your TFS build agent says it is ready, but the icon says it is not - Richard Fennell - September 17, 2011

    […] if you are trying to use build agents that are not directly on your LAN/AD (see this lovely clear blog post on how to set up using a non-domain joined build agent) there is a good chance you will not have DNS working as expected. So make sure the controller can […]

    Like

  5. Développement Logiciel Microsoft et Industrialisation TFS | Configuration Build Controller et environnement de lab complexe - October 1, 2013

    […] donc un petit lien qui peu vous sera bien utile pour faire cette configuration et passer outre ce petit problème de […]

    Like

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.