Lab Management in TFS2010

Lab Management is a great piece of software that takes great use of virtual machines in order to create virtual labs where you, your team and your testers can test out an application in a clean environment. Lab Management integrates with Team Foundation Server 2010 and thus enables you to create the lab environements out of Visual Studio with ease.

So I started upgrading our TFS 2008 with the not-so-brand-new TFS 2010, on a completely different new machine. Besides the hassle regarding upgrading the databases, prepairing the user accounts, the shared folders, the services etc. I got to the point where I had everything working (except SharePoint Services 3 integration; will talk about that later) and was getting ready to install the Lab Management stuff.

Before starting of with the real subject of this post, let me tell you, in short, the environment topology: Active Direcotory with several domain controllers running WS2003, one WS2008R2 machine running two instanced of SQL Server 2008 R2 (one for TFS 2010, one for SCVMM 2008 R2 –> it is important not to use the first instance for SCVMM), System Center Virtual Machine Manager 2008 R2, Team Foundation Server 2010 and SharePoint Services 3. Also, for running SCVMM that machine has the Hyper-V role activated.

First things are first, so I installed the Hyper-V role on my Windows Server 2008 R2 machine and afterwars System Center Virtual Machine Manager 2008 R2, because Lab Management works with SCVMM. After putting everything up and creating the SCVMM configuration to work with Hyper-V, I got the the final (and, in the end, not so final after all) point where I would configure the Lab Management in Team Foundation Server Admin Console.

So I put in the machine’s fully qualified domain name and click Test, but then suddenty a dialog box pops up requesting a user account. So I enter the user account I created for the Lab Management stuff (TFSLAB), insert the password and click Test. The credentials are fine, so I click Ok. Boom! I get this error:

TF260078: Team Foundation Server could not connect to the System Center Virtual Machine Manager Server: servername. More information for administrator: You cannot contact the Virtual Machine Manager server. The credentials provided have insufficient privileges on servername.

Ensure that your account has access to the Virtual Machine Manager server on servername, and then try the operation again.

Right. Now what? I double-check the password. Password’s fine. I double-check the username. Username’s fine. Obsiously this doesn’t have anything to do with the credentials. I check the Configuring Lab Management for the First TIme article on MSDN (here). Scroll down the site, and come across a Troubleshooting link. Click the link and come across a short text that basically tells me to check some blog or the forums. Check the blog. Nothing there about 260078. Check the forums. No similar error.

Obsiously, I’m special! Search the Web some more. After about an hour or so, I decide to post in the MSDN forums: maybe a wise man does have an answer after all. Post the error in the forum. Wait for two hours. I’m notified on my phone that someone has replied to my post. Don’t really have the time to check the post in that moment, so I’ll leave it for a couple of minutes, but than another notification alerts me! Surely I must have found gold! Two replies one after the other? Problem is as good as solved. Check the thread and find out only that someone else if trying to figure out the same thing.

Ok, enough with the introductory chit-chat.

What I did:

1. (don’t really know if it helps, or not, but this was required for similar errors) Added TFSLAB (and eventually TFSSERVICE – the account Team Foundation Service runs under) to these AD groups Pre-Windows 2000 Compatible Accessand Windows Authorization Access Group.

I tried running the Lab Configuration again, but still no luck.

2. Changed the accounts the Virtual Machine Manager and SQL Server (this is absolutely required) and Virtual Machine Agent run under to the TFSLAB account. Restart the services, but Virtual Machine Agent doesn’t start. The Service Manager posts some extremely generic error message (The Virtual Machine Manager Agent service terminated with service-specific error %%-2147217405.), so I check the Event Viewer and find this: The machine-default permission settings do not grant Local Activation permission for the COM Server application with CLSID {9C38ED61-D565-4728-AEEE-C80952F0ECDE} and APPID {5364ED0E-493F-4B16-9DBF-AE486CF22660} to the user domain\tfslab SID (S-1-5-21-1004336348-790525478-1801674531-15332) from address LocalHost (Using LRPC). This security permission can be modified using the Component Services administrative tool.

As the message suggest, VMM Agent cannot start because of a component. My suspicion is that TFSLAB doesn’t have priviledges to that component, so I immediately open Component Services. However, the components are only listed by their friendly name, so I open the registry editor in order to find the component’s friendly name: Virtual Disk Service Loader. Sounds promising. I go back to Component Services, search for Virtual Disk Service Loader, right-click it in order to configure the security permission and find that everything is grayed out, as it were disabled. I check whether DCOM is enabled (right-click on the computer in the Component Services list) and find that it is.

Search online books some more and find that for Windows Server 2008 R2 Microsoft, for some “security” reason decided that Administrators, no matter their level of godness, are no longer permitted to configure anything in the Component Services and instead, a user called TrustedInstaller has acces (not even the godlike SYSTEM accound is no longer permitted acces there –> WHY?!).

Some article on the Web stated that going back to registry editor, back to HKEY_CURRENT_ROOT\CLSID\idHere, clicking on the permissions option in the CLSID’s context menu (replace CLSID with that long ID your’s looking for 9C38…) and configuring the FULL CONTROL permission for the Administrator should solve the problem. However, it didn’t. What I did though (as a temporary resort, because it was getting frustrating) was to add the TFSLAB account to the local admin accounts group.

So, in conclusion:

  • add the TFSLAB account to the local admins
  • add TFSLAB to the AD built-in groups I mentioned earlier
  • run SQL Server instance service with the TFSLAB account
  • run the VMM service with the TFSLAB account

and you should have everything up and running (after finishing the configuration, of course).

Till next time,


Tagged , , , , , , , , , , , , ,

Did you know?

Today I just found out a lot of interesting shortcuts I wish I knew years ago!

For example, did you know that if you keep the control key (Ctrl) down and press the + key (it has to be the + key, not the combo += key close to the backspace key; if you don’t have a numeric keypad, you could first lock the numberpad on a laptop keyboard and then use the + key), Windows automatically resizes all your columns in a column-ish UI (such as Task Manager). There you go! 15 years of computing!

One other cool thing I found out today was that Windows allows you to balance between the open apps + windows. So if you Alt+Tab in Windows, you only scroll between the open apps. And if you Ctrl+Tab, you scroll around the open views/windows inside an app. But if you hold down the Ctrl key and click the Left-button of the mouse, you can scroll between all the views open in the application group that the mouse curso if over. You have to try this! I absolutely love it!

One more cool thing I had no idea about: if you hold down the Ctrl key when you click the New Task menu option in Task Manger, you automatically get an command prompt opened! How cool is that?

Hope you’ll find this shortcuts as usefull as I do!

Happy Easter!

Querying for a specific set of entries in a SQL table

I was talking today to another follower of the OradeaDevs Facebook page ( about querying data on a specific set, based on whatever column, e.g. Name.

Considering a Product table which has the following columns IDProduct, ProductName, one would probably try to query the set-data by using something we call a sub-query select (or sometimes inner select). Even though the expected result is correct, in my opinion it is best to stay away from any kind of sub-queries, because these are usually the reason for why SQL databases respond slow (after the use of cursors, of course). Keep in mind that even if you’re Chuck Norris and do some sort of magic indexes configuration, once the SQL query engine will scan the clustered/non-clustered index tables, spool the tables over and over again, remove the carthesian products resulted from the subquery values etc. the query result will respond slow.

In my opinion, it is best have a larger set of the data kept in a buffer memory-like area and query the last set from there. For example, if one would like to query the entries, ordered alphabetically by their name, from 21 to 30, it would be a better solution to query the data from 1 to 30 and afterwards to query the last 9 values (which is bassically the case of using a simple WHERE clause).

And since it comes to temporary data tables, considering SQL Server 2K5 is around for some time now, I would suggest the use of common table expressions, which are a great way, from the performant p.o.v., to save your temporary data you want to query on.

So, there the use of a CTE which lists the entries between 29989 and 30000 of a table called Product, ordered by their product name:

WITH TopCTE AS (     SELECT TOP 30000        ROW_NUMBER() OVER(ORDER BY ProductName) AS RowNumber, ProductName        FROM Product        ORDER BY ProductName ) SELECT *     FROM TopCTE     WHERE RowNumber > 29990

That’s it for now!


There and back again!

Hey guys! First of all, thanks a lot for checking my blog out!

Sorry for not posting for such a long time now! I suppose the Live Spaced-Wordpress transition kind of killed it for me! I’m extremely glad I had 4 unapproved comments and I approved them all at once! I will try and do my best in posting new things from now on on a regular basis! I promise I’ll do my best!

So, in conclusion, thanks again for your comments and for following my blog!

See you soon, in another comment 🙂


Eveniment Ronua, acasa

Intra, inregistreaza-te si ne vedem acolo la 18!

Junction points in Windows 7

Today I’ve discovered that I’m denied access to several folders in Windows 7. Now, you might be thinking ‘Did you try running Explorer with Administrative privileges?’. Of course I have!

The list of folders that I was denied access to is the following:


  • Access to the path ‘C:\Documents and Settings’ is denied.
  • Access to the path ‘C:\ProgramData\Application Data’ is denied.
  • Access to the path ‘C:\ProgramData\Desktop’ is denied.
  • Access to the path ‘C:\ProgramData\Documents’ is denied.
  • Access to the path ‘C:\ProgramData\Favorites’ is denied.
  • Access to the path ‘C:\ProgramData\Microsoft\WwanSvc\Profiles’ is denied.
  • Access to the path ‘C:\ProgramData\Start Menu’ is denied.
  • Access to the path ‘C:\ProgramData\Templates’ is denied.
  • Access to the path ‘C:\RRbackups’ is denied.
  • Access to the path ‘C:\System Volume Information’ is denied.
  • Access to the path ‘C:\Users\<username>\AppData\Local\Application Data’ is denied.
  • Access to the path ‘C:\Users\<username>\AppData\Local\History’ is denied.
  • Access to the path ‘C:\Users\<username>\AppData\Local\Temporary Internet Files’ is denied.
  • Access to the path ‘C:\Users\<username>\Application Data’ is denied.
  • Access to the path ‘C:\Users\<username>\Cookies’ is denied.
  • Access to the path ‘C:\Users\<username>\Documents\My Music’ is denied.
  • Access to the path ‘C:\Users\<username>\Documents\My Pictures’ is denied.
  • Access to the path ‘C:\Users\<username>\Documents\My Videos’ is denied.
  • Access to the path ‘C:\Users\<username>\Local Settings’ is denied.
  • Access to the path ‘C:\Users\<username>\My Documents’ is denied.
  • Access to the path ‘C:\Users\<username>\NetHood’ is denied.
  • Access to the path ‘C:\Users\<username>\PrintHood’ is denied.
  • Access to the path ‘C:\Users\<username>\Recent’ is denied.
  • Access to the path ‘C:\Users\<username>\SendTo’ is denied.
  • Access to the path ‘C:\Users\<username>\Start Menu’ is denied.
  • Access to the path ‘C:\Users\<username>\Templates’ is denied.
  • Access to the path ‘C:\Users\All Users\Application Data’ is denied.
  • Access to the path ‘C:\Users\All Users\Desktop’ is denied.
  • Access to the path ‘C:\Users\All Users\Documents’ is denied.
  • Access to the path ‘C:\Users\All Users\Favorites’ is denied.
  • Access to the path ‘C:\Users\All Users\Microsoft\WwanSvc\Profiles’ is denied.
  • Access to the path ‘C:\Users\All Users\Start Menu’ is denied.
  • Access to the path ‘C:\Users\All Users\Templates’ is denied.
  • Access to the path ‘C:\Users\Default\AppData\Local\Application Data’ is denied.
  • Access to the path ‘C:\Users\Default\AppData\Local\History’ is denied.
  • Access to the path ‘C:\Users\Default\AppData\Local\Temporary Internet Files’ is denied.
  • Access to the path ‘C:\Users\Default\Application Data’ is denied.
  • Access to the path ‘C:\Users\Default\Cookies’ is denied.
  • Access to the path ‘C:\Users\Default\Documents\My Music’ is denied.
  • Access to the path ‘C:\Users\Default\Documents\My Pictures’ is denied.
  • Access to the path ‘C:\Users\Default\Documents\My Videos’ is denied.
  • Access to the path ‘C:\Users\Default\Local Settings’ is denied.
  • Access to the path ‘C:\Users\Default\My Documents’ is denied.
  • Access to the path ‘C:\Users\Default\NetHood’ is denied.
  • Access to the path ‘C:\Users\Default\PrintHood’ is denied.
  • Access to the path ‘C:\Users\Default\Recent’ is denied.
  • Access to the path ‘C:\Users\Default\SendTo’ is denied.
  • Access to the path ‘C:\Users\Default\Start Menu’ is denied.
  • Access to the path ‘C:\Users\Default\Templates’ is denied.
  • Access to the path ‘C:\Users\Default User’ is denied.
  • Access to the path ‘C:\Users\Public\Documents\My Music’ is denied.
  • Access to the path ‘C:\Users\Public\Documents\My Pictures’ is denied.
  • Access to the path ‘C:\Users\Public\Documents\My Videos’ is denied.
  • Access to the path ‘C:\Windows\Registration\CRMLog’ is denied.
  • Access to the path ‘C:\Windows\System32\com\dmp’ is denied.
  • Access to the path ‘C:\Windows\System32\config\systemprofile\AppData\Local\Application Data’ is denied.
  • Access to the path ‘C:\Windows\System32\config\systemprofile\AppData\Local\History’ is denied.
  • Access to the path ‘C:\Windows\System32\config\systemprofile\AppData\Local\Temporary Internet Files’ is denied.
  • Access to the path ‘C:\Windows\System32\config\systemprofile\Application Data’ is denied.
  • Access to the path ‘C:\Windows\System32\config\systemprofile\Cookies’ is denied.
  • Access to the path ‘C:\Windows\System32\config\systemprofile\Local Settings’ is denied.
  • Could not find a part of the path ‘C:\Windows\System32\config\systemprofile\SendTo’.
  • Access to the path ‘C:\Windows\System32\LogFiles\WMI\RtBackup’ is denied.
  • Access to the path ‘C:\Windows\SysWOW64\com\dmp’ is denied.
  • Access to the path ‘C:\Windows\SysWOW64\config\systemprofile\AppData\Local\Application Data’ is denied.
  • Access to the path ‘C:\Windows\SysWOW64\config\systemprofile\AppData\Local\History’ is denied.
  • Access to the path ‘C:\Windows\SysWOW64\config\systemprofile\AppData\Local\Temporary Internet Files’ is denied.
  • Access to the path ‘C:\Windows\SysWOW64\config\systemprofile\Application Data’ is denied.
  • Access to the path ‘C:\Windows\SysWOW64\config\systemprofile\Cookies’ is denied.
  • Access to the path ‘C:\Windows\SysWOW64\config\systemprofile\Local Settings’ is denied.
  • Could not find a part of the path ‘C:\Windows\SysWOW64\config\systemprofile\SendTo’.

As you’ve probably already figured it out, the list contains also the special folders from the 64bit environment that aren’t accessible.

The thing is, as it appears, that these aren’t actual folders, but so-called junction points, created to offer backward compatibility with other operating systems (Vista, XP…).

Now, if you might have been able to see them in Vista (as shortcuts), and access them (which would have redirected you to the actual folders), there is a small glitch in Seven: you don’t see them, not even as shortcuts, and if you try to manually insert these folder paths and open them, instead of being redirected to the actual folders, you’ll get an error saying that access is denied. Honestly, I would have liked to get an ‘path does not exist’ or something similar.

So, how did I get this list? Well, I ran a folder-listing application I’ve written in .NET Framework, and the GetDirectories() method returned these folders as sub-folders of their parents (sounds fishy :)).

So here’s the thing with backward compatibility:

  1. you have an app that does some IO ops in the special environment folders
  2. the .NET Framework returns these special folders as existing
  3. you run your app with elevated privileges to make sure no errors occur
  4. boom, you get an access denied error on some special folders that don’t actually exist.

Is it just me, or is there a glitch somewhere?

P.S.: more about junction poins here:

Eveniment RONUA

Evenimentul merita, fiindca:

  • e in lb. romana
  • e legat de VS2010
  • e in orasul tau!!!



P.S.: esentialul:

I’ve found a great post on Alan’s blog

I found this great post on Alan Skorkin’s blog. Click here to go to the original post on his blog, or read it below! 🙂

The post is called:


Did Your Boss Thank You For Coding Yourself to Death?

Programmers love to work long hours! There I said it, c’mon admit it, your job/boss doesn’t make you do it, we do it to ourselves. Alright, I’ll concede, maybe not all programmers love long hours, but surely with the amount of overtime that is prevalent in this industry at least half of us must love it. Right?

I can hear the excuses already. "No, no that’s not it, we just love working with cool tech and don’t want to leave a problem unsolved. It is actually a good thing it’s what makes us awesome!"

I say – you’re not seeing the forest for the trees. Here is some perspective, you’re not doing this for yourself, you’re doing it for "the man". Admittedly he might be a nice man, but you don’t owe him slavish commitment. Here is even more perspective, how often are you actually playing with interesting problems and cool tech and how many times are you churning out code desperately trying to get something delivered and meet some arbitrary deadline that someone has assigned to you? But hey, you’re a business savvy developer, you’re helping the company succeed, your manager has explained the financial situation to you – it has to be done, we’re relying on you. Well, unless that same manager is right there with you, entertaining you with amusing anecdotes at 2 am, his words are worthless.

Let me tell you a story that a friend once told me. It is about a brilliant developer – lets call him John.

John was a superstar, a one in a million programmer. He had an uncanny ability to understand and write code and was 20 times more productive than anyone else. One day the company got a big contract that needed a fast turn-around. The client sent a massive spec document – to everyone’s dismay. John came to the rescue, he took the spec home and noone heard from him for 3 days. When he came back to work, he looked like hell, but he had gone through the whole spec and had an outline of the solution already finished. Except for one bit which was impossible to implement, though the spec said otherwise – even the client didn’t realise this, but John picked it up. Amazing!

When I first heard that story, I was pretty impressed, my first question was, "So, where is this guy now?". To which my friend replied – "He is dead, too much hard living!". Too much hard coding would be more like it. Kinda takes the wind out of that story a little bit – John was in his early 30s.

Programmers take a perverse pleasure from sharing death-march war stories. Even when we do it with disgust, it is a disgust tinged with pride – daring our peers to do "better". But it is a bit like those guys who wear their pants so low you can see ALL of their underwear or the people who take up smoking for the "trendy image". They and their friends think it’s cool – everybody else thinks it’s stupid.

Making A Bad Situation Worse

I can see the necessity of occasionally putting in some extra effort and burning the midnight oil at work for a day or two. But when "occasionally" turns to "often", when your boss stops thanking you profusely for your efforts and just treats it as norm, this is when we’re all in trouble. It sets bad expectations, not just for you, for the whole industry. Humans are like dogs, we’re eminently susceptible to positive and negative reinforcement. And this whole industry has been conditioned by years of death-marches to the point where it even rewards this behaviour. Every time we give-in to the long hours argument, we continue to negatively reinforce this trend.

It doesn’t help that we’re herd animals, you only need to get one person and everyone else wants to conform. Guilt comes into the equation – "we can’t leave our mates by themselves to do the hard-yards, we gotta help them". The more people conform, the more pressure on the rest of the herd to do so until the whole team is chugging coke and eating pizza at midnight. But how do they suck even one person in, where is that famed programmer independence. We’re happy to "stick it to the man" and do whatever we want in school, but as soon as we’re in the workforce all bets are off. It is puzzling.

Interestingly, sometimes these gargantuan efforts aren’t even tracked properly, as it would make the project look bad. So they "cook the books", as far as the client is concerned everybody is doing 40 hours a week (i.e. they get billed for 40 hours) and the project is coming in on schedule (maybe), never mind the other 40 hours that everyone on the team puts in. OK, maybe they’ll track the real effort in a "second set of books". Accountants go to jail for these kinds of shenanigans, but our industry expects it – nay almost demands it.

The Sustainable Pace Effort

Most Agile processes talk about sustainable development pace. But, I’ve seen even self-confessed agile teams knuckle under and put in the hours, you know, for the greater good and all. They were still agile though, and don’t you dare say otherwise.

When I think about this stuff I am always reminded of lawyers. You come in as a new lawyer and you put in massive amounts of effort and time, it is the accepted way to get ahead in that industry. No developer wants to be compared to lawyers, but often the situation is similar except you’re not going to get ahead by doing a lot of overtime as a developer (unless you’re working for a big 4 consulting company and then you might as well be a lawyer :)). So, lawyer vs programmer, which one is the chump?

Studies about productivity declines when working more than 40 hours a week surface with disturbing regularity. As a developer your creativity declines, you make more mistakes, you miss existing issue etc., to the point where you’re doing more harm than good. Should I even mention the health concerns when you spend that much time engaged in the same activity (they even had rules about spending too much time at work in the Soviet Union, and those guys were all about putting in the time for the good of the people). What about diet, you can only survive on coke for so long – poor John couldn’t even make it to 40.

Can you tell that I am against long hours and death marches yet :)? Maybe one of these days I’ll tell you how I got my wake-up call, it is an interesting story. Herding cats is easy compared to getting developers to make a concerted effort in the same direction, it is something I both love and hate about our people (programmers) :). But I do wish that once in a while all the smart developers just took a stand to eliminate at least one of the truly crappy and counter-productive trends in our industry. As far as I am concerned, smart programmers don’t like to work long hours and won’t be pressured into it – there is more to life.

At last!… >:)

Hey guys! These were truly some days when evil was hovering over me!… or at least, so I thought!

I’ve been trying since last Saturday to deploy a Win CE application I’ve written in C# for a new embedded board I’ve received from Microsoft as a prize, but I kept getting this annoying errors, like “the Compact version used is too old” or “the application is already running” (and of course, it wasn’t running) and so on.

Since I’ve got that first error, I believed that there was a problem with the WinCE image I’ve built. So, just to be 100% sure that the problem was the image (which I admit, didn’t find to have build-logic problems), I’ve tried deploying the image on another older board, with another image of course, also on an x86 architecture, an image that I knew was perfectly capable of running anything I had in mind.

But what about this? I plug in the cross-over cable, boot the image, run Coreman for deploying the app I’ve written and boom: “Deployment and/or registration failed with error: 0x8973190e. Error writing file ‘\Windows\’. Error 0x8007274c: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.” I try the Coreman again, run the debug again, and then I get “the process is already running bla-bla-bla”.

So what to do next? Well, first I was thinking of writing an e-mail for support, but whom to write to? And what to write? Writing an e-mail with “nothing works” as subject, and the posted error in the body of the e-mail would have probably been ignored… And then it came to me: what if the network board is broken (to be read as f***** up”)?

A short history lesson: back in December I had to buy a new network board for my laptop because I’ve accidentally broken a pin of the original on-board Intel gigabit network board. And since it isn’t possible to change the on-board network module, I’ve decided to buy the best PCMCIA network board on the market: the D-Link DGE-660TD Gigabit board.

Enough with the history lesson. So here I am, unplugging my D-Link network board. I dock the laptop in the Lenovo docking station, plug the cable into the docking station network socket, change the IP addresses as required, start Coreman all over again, press deploy and taa-daam: deploy succeeded.

Don’t know if any of you ever had similar problems, but googling any of the errors I’ve got during these last 4 days I had absolutely didn’t help at all, so…

Ok, that’s it for today!


How to insert that ampersand into a label (WinForms)

This was a rough morning, all right! Especially since it was so difficult to insert an ampersand (&) in that freakin’ label!

So the problem is that & is used for the mnemonic function (you know… in case you want the File menu to pop up when you press the ‘F’ key on your keyboard, you would name the File menu as ‘&File’).


Therefore, having a label text called ‘a&b’ would require:

1. disable the menmonic function: UseMnemonic = False

2. change the label’s text to a&&b


I admit it’s kind of lame to have a post about this, but you just might wonder one day why your label isn’t listening 🙂