Tuesday, May 03, 2005
« Just a Little Redirection... | Main | Northern Utah .NET User Group - Inaugura... »

I am more and more convinced that Virtual PC (and its Server counterpart) are awesome products.  I've been using them for several years now and I absolutely love them.  That said, however, I do run into the occasional weirdness - mostly involving networking.

This really comes into play when constantly changing networks (home, office, hotel, friend's wireless, some DHCP, some not, etc).  All firewall issues aside, I've run into situations (usually in a DHCP environment) where the host can't access the VPC (by NETBIOS, DNS, IP, etc).  Then all of the sudden it can.  Then a few minutes later it doesn't.  I don't see this often, but occassionally I do ;)  When it does happen it's extremely frustrating; you never know when it's going to work and when it's not (85% of the time it doesn't, so you can probably make a pretty good guess as to when it's going to fail).

I haven't ever thoroughly diagnosed the problem, but I think it's a derivative of the fact that it's sharing the NIC with the host and some NICs/networks can't handle it well.  I've made a practice of setting up a private, virtual network with my VPCs rather than have them participate in the host's network directly.  This allows the host direct, named access to the VPCs and also allows for multiple VPCs (yes I've had up to 3 or 4 running w/o perf hits) to participate in their own private network.  By going through these steps, however, you restrict network access to the VPC from other than the host, but for the vast majority of my VPCs, I don't need any other access (except to occasionally test a website or something like that).

Here's how you set it up:

  • First, if you haven't already, add the Local Loopback Adapter.  This is accomplished (on WinXP) by:
    • opening the 'Add Hardware Wizard' (from the Control Panel)
    • indicating that 'Yes, I have already connected the hardware'
    • selecting 'Add a new hardware device' at the bottom of the list
    • selecting 'Install the hardware that I manually select from a list'
    • selecting 'Network adapters'
    • selecting 'Microsoft' and 'Microsoft Loopback Adapter'
  • Once it's been added, you configure the private network via 'Network Connections' in the Control Panel.  I typically rename my network to 'Local Loopback Network' from 'Local Area Connection X'.  I then assign it a unique, non-routable IP address (such as 172.10.0.1 or 192.168.99.1) - something that won't conflict with the various networks into which the host will be connected.
  • Then, open your VPC and manually assign an IP address to it on the same subnet (e.g. 192.168.99.2).
  • At this point, it's incumbent on us to edit the hosts file (found in %WINDIR%\System32\drivers\etc) to map the host name to its respective IP address.

That's pretty much all there is to it.  I've found this technique to be MUCH more reliable than any other mechanism.

Tuesday, May 03, 2005 2:23:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [2]  |  Trackback