Host Only Adapter Settings uses weird IP address

This is for discussing general topics about how to use VirtualBox.
Post Reply
hallmark
Posts: 1
Joined: 24. May 2013, 13:19

Host Only Adapter Settings uses weird IP address

Post by hallmark »

Hi,

When using VBox in host only mode I found that I could not connect to my virtual machine on 192.168.56.101.

Some investigation revealed that the Adapter settings (File > Preferences > Network : double click the host only adapter entry) had the IP address set to 169.254.42.173

ipconfig on vbox machine

Code: Select all

Ethernet adapter VirtualBox Host-Only Network:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::d1ec:a068:52c1:2aad%48
   Autoconfiguration IPv4 Address. . : 169.254.42.173
   Subnet Mask . . . . . . . . . . . : 255.255.0.0
   Default Gateway . . . . . . . . . :
The DHCP server specified the 192.168.56..... entries as you'd expect

I found that changing the host only adapter entry to 192.168.56.1 fixed my problem - however this value always gets reset each time I boot my windows machine. Is there anyway for this to be persisted? Or is windows forcing this value somehow?

R
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Host Only Adapter Settings uses weird IP address

Post by noteirak »

What is the output of this command when the IP is wrong :

Code: Select all

ipconfig /all
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
ErikW
Posts: 20
Joined: 11. May 2012, 23:59

Re: Host Only Adapter Settings uses weird IP address

Post by ErikW »

Microsoft has reserved the IP addresses beginning with 169.254 for assigning automatic private IP addresses. Addresses beginning with 169.254 are assigned by Windows when no address can be assigned automatically (there is no DHCP server). That happens when you have set the advanced TCP/IP options to "Obtain an IP address automatically" and also on the "Alternate Configuration" tab you have set the option for "Automatic private IP address".

To fix this problem you should change the Windows TCP/IP settings for the Host Only Adapter to "Use the following IP address" and then enter the desired IP address and network mask.

If you are using the VirtualBox DHCP server on a "VirtualBox Host-Only Network", the Windows host OS cannot obtain an address from the DHCP server. I don't know if that is a bug or intentional. Set the "VirtualBox Host-Only Network" address to be on the same network as the DHCP server but not in the range of addresses assigned by the DHCP server. For example, if the DHCP server is 192.168.56.100 and it assigns addresses 192.168.56.101 through 192.168.56.254 then you can assign the Windows "VirtualBox Host-Only Network" 192.168.56.1 or 192.168.56.99.

You can see the current configuration using these commands from the Windows command line.

vboxmanage list hostonlyifs
vboxmanage list dhcpservers

Note that the information for "hostonlyifs" shows a "Dhcp" and "IPAddress" setting. Those are the settings for the Windows network adapter (DHCP client) and NOT the DHCP server. If you don't see the host-only network in the list of "dhcpservers" then there is no DHCP server configured for the host-only network.
shashank.raghunath
Posts: 3
Joined: 3. Feb 2015, 22:20

Re: Host Only Adapter Settings uses weird IP address

Post by shashank.raghunath »

I am facing Exactly the same problem except when i go to Network And Configuration, and Click on properties option of the TCP/IPv4 of Vitual host only adapter, i get this error: In order to configure TCP/IP you must install NIC . What should i do??
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Host Only Adapter Settings uses weird IP address

Post by noteirak »

No the same problem then :) This post is about wrong IP address on the host only.
My solution would be to remove all the host only interfaces via the approrpriate VirtualBox menu (in the global config), reboot, then create a new one and see how it goes.
In any case, the interface would be configured and properly activated when the first VM is using it. So please start a VM first and then see how it goes.

If this doesn't fix your issue, please start a new topic and provide the minimum information needed for assistance.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Post Reply