Share via


Setting up Team Explorer Everywhere on a Linux Virtual Machine

I’m presenting at the JAX event on the 29th September, and my session is covering how we can support Java developers, using Eclipse, to share their use of Team Foundation Server with .NET developers. Our solution is Team Explorer Everywhere which provides a superb plugin for Eclipse and a cross-platform command line tool. This means that developers using Eclipse (not necessarily Java developers) have an almost identical Team Explorer and integration providing access to Team Foundation Server for version control, work items, automated builds (using Ant or Maven), access to SharePoint and contributing to and accessing reports. All good stuff, and I thought it would extra interesting to setup a Linux virtual machine, install Eclipse and Team Explorer Everywhere and do my session in that environment. I hit a few challenges on the way, so I thought I’d post my notes in case anyone else is interested.

In order to remove any lingering feeling of suspense and tension, I’ve got it all working, and the challenges are not presented by Team Explorer Everywhere, but in configuring the virtual machine and access to my TFS server. We’re going to need to use VIrtual PC, Ubuntu, Eclipse, Team Explorer Everywhere, Team Foundation Server, configure a loopback adaptor and PowerShell, so here goes….

Step 1 – Create a new Virtual Machine

I want to run this on my laptop, which is a Windows 7 machine. I therefore wanted to have a Windows 7 Virtual PC based Linux virtual machine, and although I’ve used Redhat/Fedora in the past, Ubuntu tends to be a popular option so I thought I’d go with that.

I downloaded the Ubuntu .iso, created a new virtual machine, started the install and… it all went wrong. There is a problem with the screen resolution during the install.  Scott Hanselman happens to have written a comprehensive how-to post on exactly this – installing Ubuntu into a Virtual PC on Windows 7.  Perfect, and just what I needed to get me through the tricky bit, and following those steps I ended up with a virtual machine running Ubuntu.

image

Step 2 – Install Eclipse and TEE

Pretty straightforward and no dramas here. I downloaded Eclipse (I downloaded the JEE edition but that’s not required) and installed it. The only issue I had was that my path didn’t include Java, an easy fix. The installation of Team Explorer Everywhere is straightforward – as it’s an Eclipse plugin it doesn’t have an installation wizard, you point Eclipse at the archive file and it installs it as a plugin. The installation documents cover this perfectly and it’s quick and simple.

So I now have Eclipse running in Ubuntu, with Team Explorer Everywhere installed.

image

 

image

Step 3 – Connecting Team Explorer Everywhere to Team Foundation Server on my host

The next challenge I came across was to get the Team Explorer Everywhere plugin to be able to connect to the Team Foundation Server instance running on my host machine. Before I make any changes the TFS server can’t be found (I’ve edited my /etc/hosts file to add in a friendly name instead of an IP address):

image

So, why is this? I’ve installed a loopback adapter on my host machine and set the Virtual PC Network settings to use the loopback adapter:

image

Well, there are two extra steps needed. The first is expected – set the network adapter in Ubuntu to use the loopback adapter. You need to set this in the Network Connections (which is rather unintuitively found in the Preferences menu)

image

image

And then set it to the netmask and suitable address range that match your host installed loopback adapter.

The second problem took me a lot longer to fix. I couldn’t work out why I could ping my Team Foundation Server installation on my Windows 7 host from the Ubuntu virtual machine, but Team Explorer Everywhere couldn’t connect. I was looking at firewalls and network adapter settings (Windows 7, Ubuntu and Virtual PC) before I realised that Windows 7 treats a network connection without a DNS server as an unidentified connection, and sets it’s category to “Public”. Public is too locked down for connecting to Team Foundation Server, but you can’t change the category of an unidentified network in the Network Settings user interface. How to solve this? I was saved by this post.  There’s a powershell script in the post that you can run to recategorise all Public connections as Work connections. The script has an error in it – the comments need to be prefixed with #, here’s my corrected version:

 #// 
#// Name: ChangeCategory.ps1 
#// Copyright: Microsoft 2009 
#// Revision: 1.0 
#// 
#// This script can be used to change the network category of 
#// an 'Unidentified' network to Private to allow common network 
#// activity. This script should only be run when connected to 
#// a network that is trusted since it will also affect the 
#// firewall profile used. 
#// This script is provided as-is and Microsoft does not assume any 
#// liability. This script may be redistributed as long as the file 
#// contains these terms of use unmodified. 
#// 
#// Usage: 
#// Start an elevated Powershell command window and execute 
#// ChangeCategory.ps1 
#// 
$NLMType = [Type]::GetTypeFromCLSID(‘DCB00C01-570F-4A9B-8D69-199FDBA5723B’)
$INetworkListManager = [Activator]::CreateInstance($NLMType)

$NLM_ENUM_NETWORK_CONNECTED  = 1
$NLM_NETWORK_CATEGORY_PUBLIC = 0x00
$NLM_NETWORK_CATEGORY_PRIVATE = 0x01
$UNIDENTIFIED = "Unidentified network"

$INetworks = $INetworkListManager.GetNetworks($NLM_ENUM_NETWORK_CONNECTED)

foreach ($INetwork in $INetworks)
{
    $Name = $INetwork.GetName()
    $Category = $INetwork.GetCategory()

    if ($INetwork.IsConnected -and ($Category -eq $NLM_NETWORK_CATEGORY_PUBLIC) -and ($Name -eq $UNIDENTIFIED))
    {
        $INetwork.SetCategory($NLM_NETWORK_CATEGORY_PRIVATE)
    }
}

To run this you need to start a PowerShell command line as Administrator, then set the Execution Policy to remotesigned:

image

Then run the script (cd to the directory you saved it in and run it)

image

Now the network should show as “Work”:

 

image

and now Team Explorer Everywhere will work:

image

image

Summary

Installing Team Explorer Everywhere into Eclipse (whether on Windows or another platform) is easy. Connecting Team Explorer Everywhere to Team Foundation Server is easy, as long as you’ve got network access Smile. For me, getting the network access configured between the Ubuntu virtual machine and my local host was the tricky bit in the process.

I hope this is of interest or use to anyone else that might be interested in going down the same route and help to avoid some of the time I spent on the connectivity issues. If you’re interested in Team Explorer Everywhere (or other topics) we have a range of LiveMeetings that you could join that can be found here: https://www.microsoft.com/visualstudio/en-gb/visual-studio-events

Alternatively, if you’d like us to setup a Team Explorer Everywhere LiveMeeting contact us at ukvsts@microsoft.com and we’ll add one into the agenda.

Cheers,

Giles

Comments

  • Anonymous
    August 10, 2012
    Wow, perfect!