Wednesday, January 14, 2009

Networking a Virtual PC when disconnected from the network

So I'm sitting on a very long flight (when I wrote this, watching 'Flight of the Conchords'), wishing I had wifi as my current project involves distributed WCF services between virtual PCs.  Without network access, I'm dead in the water (probably not the best thing to say while in a plane).  After banging it out, here's a quick tip on how to set up networking for your virtual PCs when you don't have any network.

The irony here is this post is really only useful after you connect to the network.  Still, this may be good reference material for me at some point later on, if you benefit from it, that's good too.

Install a Loopback Adapter

On the host operating system, install a Loopback adapter.

  1. Open the "Add Hardware" applet in the Control Panel.
  2. Choose the "Install the hardware that I manually select from a list (Advanced)"
  3. Select the "Microsoft", "Loopback Adapter"

    Loopback Adapter
  4. Once installed, configure the loopback adapter with a static IP Address (ie, / subnet

Configure the Virtual PC

Configure the VPC to use the Loopback Adapter.

  1. Using the VPC settings, configure the VPC to use the Loopback adapter for it's network connection

    Virtual PC Settings
  2. In the guest OS, configure the network adapter with a static IP Address on the same network and subnet (

Testing it out

To test it out, on the host OS "ping".  Voila! Network without Network.  Now, where's that drink cart?

Monday, January 05, 2009

Year in Review

I was pretty sure by the end of 2008, I wasn't going to succumb to peer-pressure and write a Top 10 posts of 2008 post, but there may be some value in this retrospective thing.  After all, 2008 was a huge year for me, not only did I have my second child, but I also changed jobs and bought a new car.  On a much smaller scale, but very relevant here, I also changed the focus of this blog from day-to-day diary to a technical focus: .NET, TDD, Software Development Process, ALT.NET -- it's been an experiment of tinkering and hacking blogger templates and plugins, blog writing software and analytics. 

Though it hasn't been a runaway hit, it's been successful in my books: blog posts, traffic and readership are up.  There's been a few kicks and some comments, which are not only encouraged but greatly appreciated: thanks.

Since I have only 35 posts for 2008, a top ten list seemed unlikely, so I thought I'd post a handful of the popular ones. I ended up with ten anyway...

Test Driven Development:

  • Naming Conventions and Guidelines.  My most popular post by far, I provide some guidance in Do/Don't/Consider format on how to structure and name your tests.  I anticipate that if I adopt BDD style tests this year, I'll have a different set of guidelines for those.
  • Testing Legacy Projects with Selenium or WatiN.  This article was one of a series in dealing with Legacy Projects.
  • Unit Test Namespace Considerations.  Although there were a few other more popular TDD posts, I was surprised this didn't rank higher.  The ability to write classes along side tests and drag them into their respective solution is not only my favourite tip, but is one of the best ways to encourage pure TDD.  Incidentally, one more dot-net kick would have likely placed this higher in the rankings, so if you're reading this post and you find that article helpful, consider giving it a bump.


  • Producing readable log4net output.  I love writing about log4net, it's a great framework and this post shows off some its rarely used extensibility features.  A few simple settings, and your log output is ready for Excel.
  • Log4Net Configuration made simple through Attributes.  Again, a simple configuration article ranks as one of the most popular articles.  This post shows how to take advantage of the log4net assembly-level configuration attributes and shows side-by-side usage for class-libraries and stand-alone applications.

Windows Services

  • Running Multiple Services within a Single Process.  This post was inspired by quirky behaviour of ServiceBase.Run() which takes multiple Services as an argument, but doesn't work as expected.
  • Redirect Standard Output of a Service to Log4net.  This post must be a good reference as it seems to get a lot of repeat traffic.  I wrote this post when I was working with Selenium, I left the reference to the selenium-server.jar as part of the article -- I was surprised how many visitors were searching for Selenium when they hit this quick tip.

The Odd Bucket

I thought I'd round out the top-ten with a few weird posts that were very popular:

  • Visual Studio "Format the whole document" for Notepad++ using Tidy.  This is a handy tip on how to configure Notepad++ to quickly format XHTML / XML documents, complete with reference Tidy.cfg and setup instructions.  I think it's a pretty good tip, but looking at the analytics, people found this article with some pretty strange queries.
  • .NET Garbage Collection Behavior for Release Code.  This is one of those bizarre mind-benders I picked up while reading CLR via C#.  It's a good example of why state is both good and bad, how to not structure asynchronous code, as well as exposing the internals of the CLR.  Oddly enough, this post got picked up by a Russian forum and I had a week where most of my traffic was from Russia.  I never tried to translate their comments, I hope it wasn't taken out of context?
  • Selenium 0.92 doesn't work in IE over VPN or Dialup.  Again, a really odd post that visitors found in strange ways.  IE treats proxy servers differently for VPN, proving once again that IE is one of the most frustrating applications on the planet.

Plans for 2009

2009 is shaping up to have a huge focus on testing in new and odd ways.  Expect to see lots about parameterized tests, Office automation using White, and hopefully, more Surface and WPF work.

Happy New Year, and may all your tests be green.