Idea
There are many articles on the web on this subject. They usually focus on instructions to setup particular type of network. I did not find any comprehensive article that would summarize the most common types of networks for virtual PCs (shared networking, loopback adapter) and point out differences among them.
Shared networking (NAT)
Easiest option to setup is Shared networking (NAT).
- In the Edit menu of the Microsoft Virtual PC window, select Settings.
- Settings for <your virtual PC name> dialog pops up.
- Click OK on the message box informing that some of the settings cannot be changed.
- Then select Networking in the left pane.
- In the right pane select Shared Networking (NAT) in Adapter 1 combo box.
- Click OK on the dialog box.
Your host PC becomes a simple router for the virtual PCs. It assigns IP addresses to the virtual PC from the subnet 192.168.131.xxx. The virtual PCs will use the DNS on your network router. Thus the virtual PC can find other computers on the network and on Internet. However, the virtual PCs cannot find each other by name. Other computers on the network cannot access the virtual PCs.
To find the host PC from a virtual PC by name, add your network’s suffix after the name of the host PC (e.g. “<host PC name>.lan” for your home network).
Using shared networking, you can connect from a virtual PC to Internet and to the web server on the host PC. This means that you can load web pages from the web server on the host PC and from web servers on Internet such as the web server where you deploy. However, when you are disconnected from your physical network, it is not possible to reach the host PC from a virtual PC.
Microsoft Loopback Adapter with Internet Connection Sharing
Second common option is to use Microsoft Loopback Adapter with Internet Connection Sharing (ICS). The loopback adapter has to be installed first and then ICS needs to be setup on the network adapter that you use to access your network (Ethernet/WiFi etc). Detailed instructions are described in Configuring NAT via using the Microsoft Loopback Adapter and Internet Connection Sharing (ICS).
After performing these steps, the loopback adapter sets up a small virtual network. The nodes on this network are the virtual PCs and the host PCs. On Windows XP, it assigns addresses from subnet
192.168.0.xxx. To add a virtual PC to this network, you need to do the following:
- In the Edit menu of the Microsoft Virtual PC window, select Settings.
- Settings for <your virtual PC name> dialog pops up.
- Click OK on the message box informing that some of the settings cannot be changed.
- Then select Networking in the left pane.
- In the right pane select Microsoft Loopback Adapter in Adapter 1 combo box.
- Click OK on the dialog box.
To find the host PC by name from a virtual PC, add “.mshome.net” suffix after the host PC’s name.
Using Microsoft Loopback Adapter with ICS, a virtual PC can connect to other virtual PCs on its virtual network, and it can also access the host PC and Internet. There is one advantage in comparison with shared networking. You can access the host PC from the virtual PC even when not connected to the physical network.
Microsoft Loopback Adapter - Isolated Network
Less common option is to use Microsoft Loopback Adapter to create an isolated network that only includes the host PC and virtual PCs. First, install Microsoft Loopback Adapter using the instructions in article How to install the Microsoft Loopback adapter in Windows XP. Then set a fixed IP address of your host PC for the virtual network created by Microsoft Loopback Adapter.
- Open Control Panel.
- Go to Network Connections.
- Right click on the newly added network (“Local Area Connection X”, where X is the highest index among “Local Area Connection” networks).
- In the context menu, select Properties.
- Local Area Connection X Properties dialog pops up. In the list box This connection uses the following items:, select Internet Protocol (TCP/IP).
- Click Properties button.
- In Internet Protocol (TCP/IP) Properties dialog box, select the radio button Use the following IP address:
- Fill in IP address
192.168.X.1. How to determine X? In Command prompt, runipconfig. If your PC has one or more IP addresses 192.168.Y.Z, make sure that X is different from any Y. - Fill in Subnet mask
255.255.255.0(should be pre-filed automatically).
Next step is to connect the virtual PC to loopback’s virtual network.
- In the Edit menu of the Microsoft Virtual PC window, select Settings.
- Settings for <your virtual PC name> dialog pops up.
- Click OK on the message box informing that some of the settings cannot be changed.
- Then select Networking in the left pane.
- In the right pane select Microsoft Loopback Adapter in Adapter 1 combo box.
- Click OK on the dialog box.
A this point, the virtual PC might complain that is has limited network connectivity. Repeat the steps above to set fixed IP address for host PC for the virtual PC. For the first virtual PC, set IP address 192.168.X.2, for the second virtual PC, set IP address 192.168.X.3 etc.
This configuration creates an isolated network. The host PC and the virtual PCs can connect to each other. The virtual PCs cannot connect to the internet and other PCs on the LAN. The PCs can use only the IP addresses to find each other. Example usage of this configuration is a computer class where each student needs own client and server computers.
References
Networking options for virtual PCs are nicely explained in article Networking in Virtual PC and Virtual Server.
Post new comment