1

My host machine is RHEL 7 and my guest machine is RHEL 6. I am required to use a host-only connection between the host and guest. I have followed all instructions/documentation I have been able to find online; however, I have an issue that I haven't found documented anywhere else. Origiannly, when I run the command, ifconfig in the guest VM there is no eth1 or eth2 - only "lo". For this, I have now created a virtual ethernet interface on the VM without a physical adapter. Here is the ifconfig output on my guest machine: Guest ifconfig output

Here is the ifconfig output on my host machine: Host ifconfig output.

I have attempted to edit the /etc/vmware/vmnet1/dhcpd/dhcpd.conf by appending

host Linux {hardware ethernet 00:0C:29:0F:41:3A; fixed-address 172.16.167.1; option domain-name-servers 0.0.0.0; option domain-name ""; }

at the end of the "DO NOT MODIFY SECTION" however I am still unable to ping the guest from the host.

The VM mac address is: 00:0C:29:0F:41:3A.

Any ideas?

1 Answer 1

0

I apologize if some of this sounds confusing. I'm familiar with VMWare on Windows but have not used it on Linux. The operation is the same, but getting there might be a bit different. You also didn't make mention of which version of VMWare you are running, and if you are configuring from a GUI or command line.

To visualize what you are hooking up here is a link with a nice graphic: https://www.vmware.com/support/ws55/doc/ws_net_configurations_hostonly.html

In the above link, you see that there is a "virtual switch" called vmnet1 that acts, and for our purposes is, like a real network switch. This network switch exists completely within software, hosted within the VMWare hypervisor.

Next, you notice there is a virtual ethernet adapter on both the virtual machine and on the host. They named it a little different in the image between the two, but they are the same thing. The virtual ethernet adapter, again, exists completely within software hosted within the VMware hypervisor. A driver on the virtual machine and the host allows the virtual ethernet adapter to be installed and to act, for our purposes, just like a real, physical network adapter.

VMWare also provides a DHCP server on this virtual network so that any virtual machines you "plug in" to the virtual switch can obtain a valid IP address automatically.

Now, by default, VMWare already creates the VMNet1 virtual ethernet switch. It also creates the vmnet1 virtual network adapter on the host which is automatically "plugged in" to the vmnet1 virtual switch. In your environment, your virtual network adapter on the host is set to an IP address of 172.16.167.1.

Now, you initially showed an image of your virtual machine's ifconfig output which showed that there were actually NO network adapters installed. You've since updated that and have indicated that you installed a virtual ethernet adapter on the guest. We can see that virtual ethernet adapter as eth1. It currently has an IP address of 172.16.167.2.

Where the questions come in to play is:

  1. Is the eth1 virtual adapter installed properly? How did eth1 get installed? I'm concerned, because your initial image showed no adapters, and now we have an eth1 adapter. If somehow you forced this adapter to show up in the virtual machine, it may not be installed properly.
  2. Which virtual network switch is eth1 "plugged in" to? If it isn't plugged in to the vmnet1 virtual switch it won't communicate on the vmnet1 network. Which is what you are trying to achieve.

Now, here is where the details get blurry, because I don't know the answers to the questions I asked at the beginning of this answer, and I'm also not familiar with VMWare on Linux.

Usually, with VMWare, you will modify the virtual machine's settings from within VMWare and add/remove a network adapter. At this same time, you will also select which network it will be "plugged in" to. Usually, this is done before ever even installing the guest operating system and during the time you create the new virtual machine. However, it is not uncommon to add/remove network adapters on a running virtual machine.

So, if you add a network adapter to a virtual machine, I would expect the virtual machine, either immediately, or after a reboot to automatically install the driver and the new network interface should automatically show up in ifconfig. This is why I suspect you forced something here and the eth1 adapter we are looking at isn't correct.

So, this is what I would do for my own clarity on the situation. I would remove ALL network adapters from the virtual machine's settings in VMWare. I would then reboot, or do whatever cleanup work is necessary on the guest to make sure that no network interfaces show in ifconfig apart from lo. I would also make sure to remove any of that configuration you mentioned you modified in your question in dhcpd.conf.

I would then re-add a new network adapter to the virtual machine's settings in VMWare and I would make sure to choose the Host-Only Network vmnet1 for which network it is "plugged in" to. Then reboot the virtual machine or do what is necessary to make sure that network adapter shows up on it. But, we are really looking for this to show up automatically.

Unless you have disabled DHCP, or changed the default settings in VMWare the virtual machine will automatically get an IP address on the 172.16.167.0/24 network without any other intervention from you. If you are forcing this in some way, something has not been done right.

That's about as precise as I can get. You should explore the documentation for your specific version of VMWare to make sure you are configuring and installing network adapters properly on your virtual machines.

6
  • When first creating the VM I had set the network adapter to be configured for a host only connection, thus vmnet1 should already by default be taken into consideration. Are you saying to create an additional network adapter with a custom specific virtual network and manually set it to /dev/vmnet1? Also, I currently have created a virtual ethernet interface on the VM named eth0. I have set eth0 statically to IP address: 172.16.167.2 which should be on the same network as vmnet1 (172.16.167.1). I have also adjusted my firewall settings to allow incoming SSH from 172.16.167.0/24 - still no luck Commented Jul 24, 2017 at 19:13
  • You should update your original post with the new information. The only screenshot you provided shows a VM that doesn't have any network adapters installed. Think of it like a real network switch and real computer. You have to have a network adapter installed on the VM that is "plugged in" to the vmnet1 virtual switch. Simply assigning an IP address to an interface doesn't plug it in to the proper switch. I need to see updated info because I'm confused by your response. Commented Jul 24, 2017 at 22:27
  • Sorry I am a bit new to this realm so I'm finding it a bit difficult to word some things. I have updated my post with a new guest if config output. Hopefully that helps. Commented Jul 25, 2017 at 13:19
  • Ok, no problem. I have updated my original answer. Commented Jul 25, 2017 at 14:19
  • Wonderful explanation. You are correct in that I did in fact force an eth1 to "happen" by doing a few commands in the guest machine terminal. I only did this simply because when I had first created the virtual machine in VMWare workstation pro, I selected Host Only connection as the network adapter and no other network adapter apart from "lo" was installed or seen on the machine. It seems your answer just about wraps up this discussion and I'll try to troubleshoot why I'm not automatically having an eth1 or eth0 generated for a host only connection. Thanks. Commented Jul 25, 2017 at 14:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .