Page 1 of 1

Problem with host-only networking

Posted: 23. Nov 2016, 21:29
by dlharper
Does anyone have any idea why host-only networking should have stopped working, and how to correct the problem?

I am running VirtualBox version 5.1.10 (after failing with 5.1.6) on Windows 10. I am running a number of (mainly quite old) OSes in VMs with this setup, and wish to network them with one another and the host. Networking works perfectly well with all the VM adapters set to “Bridged” or “Internal”, but if I set them to “Host-only”, none of the machines can see any of the others.

I suspect the problem may lie with DHCP. A DOS virtual machine with MS Network Client hangs at “Initializing TCP/IP with DHCP….”. By contrast, running a Windows for Workgroups VM, if I check “Enable Server” for the host-only network and give it what look like reasonable values, the machine crashes out with the error: “This DHCP client was unable to obtain an IP network address from a DHCP server”; but if I leave it unchecked, then the VM runs fine apart from having no network connection.

I have tried removing VirtualBox completely and re-installing, but this makes no difference, and curiously the adapter is still called “VirtualBox Host-Only Ethernet Adapter #4”. (Where did the “#4” come from?)

At one stage Host-only networking did work, so something has changed. I think (though I am not 100% certain) that it has worked since I was “upgraded” to Windows 10.

Re: Problem with host-only networking

Posted: 24. Nov 2016, 11:05
by socratis
dlharper wrote:Networking works perfectly well with all the VM adapters set to “Bridged” or “Internal”, but if I set them to “Host-only”, none of the machines can see any of the others.
What's the host's output of "VBoxManage list dhcpservers"?
dlharper wrote:I check “Enable Server” for the host-only network and give it what look like reasonable values
You shouldn't have to give it any value if you enable the DHCP server, that's the whole idea. I only go back to WfW 3.11 and Win98, but both work fine...
dlharper wrote:At one stage Host-only networking did work, so something has changed.
I haven't noticed anything in the VirtualBox front in that regard. How about your side and the guests' side?

Re: Problem with host-only networking

Posted: 24. Nov 2016, 12:21
by dlharper
socratis wrote:What's the host's output of "VBoxManage list dhcpservers"?
That's interesting. The result is this.

Code: Select all

C:\Program Files\Oracle\VirtualBox>vboxmanage list dhcpservers
NetworkName:    HostInterfaceNetworking-Virtual8ox Host-Only Ethernet Adapter
IP:             192.168.56.100
NetworWMask:    255.255.255.0
lowerIPAddress: 192.168.56.101
upperlPAddress: 192.168.56.254
Enabled:        Yes

NetworkName:    HostInterfaceNetworking-VirtualBox Most-Only Ethernet Adapter #4
IP:             192.168.134.0
NetworkMask:    255.255.255.0
lowerlPAddress: 192.168.134.1
upperlPAddress: 192.268.234.227
Enabled:        No
It seems that I have two DHCP servers, only one of which is active, whereas VirtualBox is trying to use the other one for host-only networking.

How do I:
1. Get rid of the adapter I don't want (the one with #4 at the end of the name) and
2. Make VirtualBox use the active one?

I cannot see how to do this using the GUI. Is it a matter of diving deep into the manual and finding VBoxManage commands to do it?
socratis wrote:
dlharper wrote:At one stage Host-only networking did work, so something has changed.
I haven't noticed anything in the VirtualBox front in that regard. How about your side and the guests' side?
I am sure you are right here. The changes are at my end, but I don't know what they are.

Re: Problem with host-only networking

Posted: 24. Nov 2016, 12:46
by socratis
  1. I replaced the image with the text of the command prompt output with the actual text. Much easier to read compared to a sized-down compressed JPEG image. Please copy/paste the actual text next time enclosed with the <code> tag.
  2. dlharper wrote:I cannot see how to do this using the GUI.
    What happens if you go to Virtual Manager preferences » Network » Host-only networks? What do you have there?
  3. dlharper wrote:The changes are at my end, but I don't know what they are.
    Since you also have a #4 network adapter in your host, I'd say that some sort of left overs from previous installations. Uninstall VirtualBox and run CCleaner? Or your favorite Win cleanup app? Then re-install VirtualBox?
  4. You still didn't mention what happens if you do not manually plug in the TCP/IP parameters whilst having DHCP enabled. What IP do you get in your guests? 192.168.56.xxx?

Re: Problem with host-only networking

Posted: 24. Nov 2016, 15:06
by dlharper
socratis wrote: I replaced the image with the text of the command prompt output with the actual text. Much easier to read compared to a sized-down compressed JPEG image. Please copy/paste the actual text next time enclosed with the <code> tag.
Sorry. That is obviously more efficient.
What happens if you go to Virtual Manager preferences » Network » Host-only networks? What do you have there?
This lists just one network: VirtualBox Host-Only Ethernet Adapter #4

This gives the options of: Creating a new adapter (which I guess will be #5 if I try it); Deleting the current one; or Editing the existing one. It doesn't seem to have the option of connecting another one that is not on the list.

Selecting the Editing button tells me that the IP address is 192.168.134.1 (and subnet mask is 255.255.255.0). I have not touched these numbers, and they correspond with the details given for the #4 adapter in the "VBoxManage list" command. The DHCP Server tab currently has "Enable Server" unchecked. If I check it, then the default values (all 0.0.0.0) raise an "Invalid Settings" flag. I tried changing them to 192.168.134.0; 255.255.255.0; 192.168.134.1; 192.168.134.127. These no longer flag up as Invalid, but the adapter still won't work. However, the "VBoxManage list dhcpservers" command now says both adapters are enabled.
Since you also have a #4 network adapter in your host, I'd say that some sort of left overs from previous installations. Uninstall VirtualBox and run CCleaner? Or your favorite Win cleanup app? Then re-install VirtualBox?
I am sure you are right here. I have tried this technique of uninstalling and cleaning, but after re-installation the situation is still the same. It seems that uninstalling VirtualBox does not get rid of the extra host-only adapters. Maybe a different cleanup program might do it, but I don't know what.
You still didn't mention what happens if you do not manually plug in the TCP/IP parameters whilst having DHCP enabled. What IP do you get in your guests? 192.168.56.xxx?
The guests all report an IP address of 0.0.0.0 or give nothing at all.

Re: Problem with host-only networking

Posted: 25. Nov 2016, 10:40
by dlharper
I think I may have solved this.

By a judicious (or maybe foolhardy) use of VBoxManage, I removed unwanted host-only network adapters and DHCP servers and (largely accidentally) created others. I now have one adapter and DHCP server, both of which are called "VirtualBox Host-Only Ethernet Adapter #3". I have set the adapter to have the address 192.168.56.101 (mask 255.255.255.0, of course); and DHCP server to have address 192.168.56.100 and bounds 192.168.56.102 to 192.168.56.254. All these are values that appeared in the process at various stages.

With these settings the system usually works. (Failures are perhaps because I have tried swapping around between adapters, and Windows doesn't really like that.)

I have still not been able to restore the original adapter (without the number at the end of the name). I also notice that guests take significantly longer to boot with host-only than with bridged networking. Is this last a known issue?

Re: Problem with host-only networking

Posted: 25. Nov 2016, 11:15
by socratis
dlharper wrote:I have still not been able to restore the original adapter (without the number at the end of the name)
I vaguely remember reports about this previously. If I'm not mistaken it involves messing up with the registry. I believe that every time there is a VirtualBox installation, without uninstalling first, although it is the same adapter that gets installed, Windows assigns it a consecutive number. Take a look at: