Sunday, May 21, 2006

Virtual Server LAN Configuration Settings

I don't know about the rest of you, but I have always wanted to know what the optimal setting for configuring network cards on virtual machines are. Because I have Active Directory on a guests OS, I don't like to boot using my company LAN.  Especially since it is DHCP enabled and Active Directory "should" be on a static IP.  I can give my guest OS a static IP, but I can't garantee against IP conflict, nor do I want static IPs for VMs popping up on the corporate network. 

So for a while I've set both of my VM's to a guest only virtual adapter: An adapter with "Network adapter on physical computer set to None (Guest Only)").  I then configured my guests to static IPs on a 10.1.0.X subnet. This allows both VM's to speak to each other but it still does not allow direct file sharing between host/guest or get the guests on the Internet.  To solve that I added a second adapter to each guest and by default set it to Not Connected. Since I typically don't need the internet, I leave it off.  But during the times I do need the connectivity I can switch the adapter to an active adapter with internet connectivity on my host OS.  This is convenient because you can perform this step without shutting down your guest OS.

I still felt there was a better way to do this.  I looked into the Microsoft Loopback adapter. The Microsoft Loopback adapter is a tool for testing in a virtual network environment where access to a network is not feasible.  Once I installed the loopback adapter on my host, I added it to my virtual server network adapters.  Then you can configured a guest to use the loopback adapter instead of the None (Guest Only) one. 

The result is something like this where the host has:
IP:           10.1.0.1 (as long as its a private range)
Subnet:    255.255.255.0

And the guests with:
IP:           10.1.0.X (Same private range as host)
Subnet:    255.255.255.0

Bingo! They can now talk to each without going out on a network.  I still have a second adapter that I keep on each guest just in case I want to get out on the internet, but I don't need it for file sharing anymore.  Hope this helps some people!!!

No comments: