When you research how to connect a VMware guest to GNS3, you will find many articles advocating the use of a Microsoft loopback adapter. Here is one such example from Intense School. Equally you will find many requests for help from people who ran into trouble setting up such such a configuration. Reasons for loopback connectivity failure include Microsoft firewall issues, MAC address issues and IPv4 configuration issues.
I typically create a host-only network when I am testing or using VMs as I do not have a need for external connectivity for such VMs. I prefer not to use the Microsoft loopback adapter approach as I have found that approach to be somewhat buggy and temperamental. Instead I prefer to connect my GNS3 network to my VMs via a host-only network.
In this post, I will demonstrate how to connect a Puppy Linux VM to a GNS3 Cisco router via a VMware Workstation 9 host-only network. This post is not an introduction to GNS3; you are assumed to be somewhat familiar with GNS3 if you are here.
First, here are my VMware Workstation network settings:
Nothing unusual about the settings. As you can see, VMnet1 is a host-only network whose network address is 192.168.100.0. You should also disable DHCP on your host-only network but I did not here to demonstrate that you can leave DHCP enabled if you are careful to statically assign an IP address for every network interface on your host-only network.
As shown below, I have given VMnet1 a static IP address in Windows (I am running Windows 7):
Note that I have not specified a default gateway or DNS server as they are not needed here. You may have to reboot your Windows system for these settings to bind; I did not have to.
Here is my demonstration setup on GNS3 v0.8.7:
Again nothing unusual. ROUTER1 can be any router for which you have an image. Mine is a Cisco 3600. VM is a GNS3 cloud. ROUTER1 is connected to VM via port f0/0.
The GNS3 cloud (here depicted by VM) is configured to use VMnet1:
VMware Workstation does not have to be open for this step. Microsoft Windows is aware of the VMnet1 network adapter and hence also is GNS3. The names of the interfaces are not user-friendly and you need to take great care that you pick the correct interface. As an aside, the device strings come from pcap. Specifically, rpcap is the Remote Capture Protocol. On Microsoft Windows, the remote packet capture protocol service is installed by WinPcap.
Here is my network configuration on my Puppy Linux VM:
As you can see, I have assigned a static IPv4 address of 192.168.100.10 to eth0.
Here, using the router console, I configure ROUTER1 to use 192.168.100.20 and test connectivity to 192.168.100.10 (Puppy Linux VM).
Note that you often have some packet loss the first time you ping a VM.
Everything also works in the reverse direction from the Puppy Linux VM:
If you run into trouble configuring your GNS3 cloud, there a two useful tools available in the GNS3 folder which can help you understand the interfaces that are available to you:
One is dynamips itself:
and the other is the network-device-list command:
Well, the above should be sufficient for you to successfully use a VMware host-only adapter to connect via a GNS3 cloud to a GNS3 network device.
[UPDATE 11/21/2014] GNS3 v1.2 was released in the last few days. It has a different look and feel to it than GNS v0.8.7.
One major improvement is in the area of configuring a cloud. Note that the rpcap device strings are no longer displayed by default; instead the standard interface name such as vmnet1 or Microsoft Loopback is displayed.
If you want to see the rpcap device string, just hover over the interface name: