VirtualBox

Opened 14 years ago

Last modified 8 years ago

#8796 new defect

Host-only adapter interface lost it's manual configured ipv4 address

Reported by: kidault Owned by:
Component: network/hostif Version: VirtualBox 4.0.6
Keywords: address Cc:
Guest type: Windows Host type: Windows

Description

I have a host-only interface created by 2.x long time ago. After installation of 4.0.6, I find I have to re-configure the ip address of host-only interface after every reboot. The ip address is manually configured by vbox manager gui, and then I add gateway and dns server in the ipv4 properties。 After reboot,the configuration in the ipv4 properties seems not changed, but in the vbox manager gui, the ip address will be something like "169.254.4.67", and the ipconfig.exe command will show the same address.

Change History (24)

comment:1 by kidault, 13 years ago

not fixed in 4.0.8

comment:2 by Alil, 13 years ago

I have the same on host Win7x64.
And as I figured out problem is in net mask
VBox wants to use 255.255.0.0 mask and when I give it my IP with 255.255.255.0 mask, it refuses it and uses self-generated IP 169.254.*.* with /16 net mask.
But when I type my preferred IP with 255.255.0.0 it goes OK

It is quite reproducible (at every VBox update)

in reply to:  2 comment:3 by kidault, 13 years ago

Replying to diagiman:

I have the same on host Win7x64.
And as I figured out problem is in net mask
VBox wants to use 255.255.0.0 mask and when I give it my IP with 255.255.255.0 mask, it refuses it and uses self-generated IP 169.254.*.* with /16 net mask.
But when I type my preferred IP with 255.255.0.0 it goes OK

It is quite reproducible (at every VBox update)

Thank you for the solution. At least, I won't have to set the ip address after every host reboot. But I have never encounted with this problem until 4.0.6. I used to set ip of host-only interface as 192.168.56.1/24, and this setting had worked well all the time until 4.0.6

comment:4 by kidault, 13 years ago

The problem seems to have been solved in 4.1.4, thank you.

comment:5 by Harald Heigl, 13 years ago

I have the setting 192.168.100.1/24. Everytime I update virtualbox (Win7x64) it goes back to 192.168.56.1/24. Also at update from 4.1.4 to 4.1.6. I have this problem at least since Version 4.0, but I don't have the problem after reboot, when I change the address back after install it stays the same until the next update.

comment:6 by Zarko, 13 years ago

I recently upgraded to 4.1.10 r76795 (from the previous latest version ... not sure which) on Windows XP and I can verify that my setting of 192.168.2.1/24 was reverted as stated above.

comment:7 by mk8, 13 years ago

On my Windows7-64bit installation I have the same problem.

I try to change the address from 192.168.56.1 to 192.168.56.2 and the changed seems to be accepted. Coming back in the ipv4 setup now I have two address, 192.168.56.1 and 192.168.56.2. If I remove the 192.168.56.1 the interface address came back to 169.254.219.

Now if I reboot the machine, the address remain 192.168.56.2.

For now this is the only workaround that I found.

comment:8 by mk8, 13 years ago

Update to 4.1.12r77245 and the problem continues to be present.

Fortunally the workaround is the same, change the local address from 192.168.56.1 to 192.168.56.2.

comment:9 by jinzapper, 13 years ago

I can confirm that this issue exists for 4.1.14r77440. Work around is the same, for me, editing the subnet mask or address did the trick. Interestingly, this problem only came up to me when I upgraded to 4.1.14 from 4.1.12. I did not have this previously.

comment:10 by rousseauhk, 11 years ago

I'm still seeing this on 4.2.16 with a number of hosts (but not all).

comment:11 by apchoo, 11 years ago

I have 2 host-only ethernet adapters and I've have no problems with their manual configs until I upgraded to 4.2.18 (from 4.2.16). Now that I'm on 4.2.18, my manual IP and netmask settings for "Virtual Host-Only Ethernet Adapter" always reverted back to 169.254.x.x and 255.255.0.0 after I pressed OK on the Preferences and Windows UAC windows. The settings for the 2nd "Virtual Host-Only Ethernet Adapter 2" do stick.

My workaround is to create a 3rd "Virtual Host-Only Ethernet Adapter 3" whose settings fortunately did stick as well. I have to re-configure all my VMs to use adapters 2 & 3 instead.

My VirtualBox host env is a Windows 7 Enterprise 64bit running on a Dell Precision M4700 laptop with 32GB memory.

comment:12 by JohnnyCanuck, 11 years ago

I can confirm the report from 'apchoo' with my Windows 7 Home Premium workstation and VirtualBox 4.2.18. As a result, I can't use 'Host Only' unless I perform the workaround (s)he describes.

On the other hand, maybe I'll try using the 169.254.X.X range and see what happens.

comment:13 by Rafael Ruppel, 10 years ago

I have the same problem with 4.3.12 and Windows 8.

For me, the workaround doesnt work. I created more than 3 host-only network adapters and the problem persists.

One thing I realized is that when I try to change the ip manually for the network adapter inside "Network Connections" (Network and Sharing Center -> Change Adapter Settings) it says: In order to configure TCP/IP, you must install and enable a network adapter card.

I opened Device Manager but everything seems normal.

I dont know what to do, its is really frustrating. Its problematic to use with vagrant.

Any help is appreciated.

comment:14 by orgler, 10 years ago

I can confirm that latest behavior seen by Rafael. According to http://support.microsoft.com/kb/308939 it should help to remove the network adapter. however this did solve the issue for other network devices I'm using but not for virtualbox. Any ideas?

Regards

comment:15 by pazoozoo, 10 years ago

This is still an issue with the latest version 4.3.26. Could someone from Oracle comment on this? This is highly annoying, especially when using Vagrant. Workarounds don't work for me either. I can add new host-only adapters and (apparently) set the IP address. But when entering the edit mode again, they will be set to some random IP...

comment:16 by pazoozoo, 10 years ago

Last edited 10 years ago by pazoozoo (previous) (diff)

comment:17 by vboxcomapijunkie, 9 years ago

I can confirm that version 4.3.26 still suffers from this UGLY bug: If you define a host-only network adapter (I use the MS COM API to accomplish this task), then addr=172.16.1.2 and mask=255.255.255.0 (/24) SOMETIMES works, sometimes not, i.e. DHCP is disabled but an arbitrary IPv4 address appears instead of the configured one. The VirtualBox.xml file indicates the ExtraDataItem-Elements with the correct values (172.16.1.2, 255.255.255.0) but VBOX does not seem to care about it.

If you set the mask to 255.255.0.0 (/16), then everything works fine. Took me days to figure out because I thought that my C++ code was just wrong...

Could someone from Oracle please cross-check? Thx.

Version 0, edited 9 years ago by vboxcomapijunkie (next)

comment:18 by Bright, 9 years ago

I encountered same issue in v4.3.20.

The best workaround from my experience is to remove the default host-only ethernet adapter and create a new one instead. In the new adapter, you can configure whatever you want.

comment:19 by danielnashnz, 9 years ago

Still occurs in v5.0.0

comment:20 by VBFixer, 9 years ago

I found a workaround for this issue, perhaps it will help others.

Details of my debugging steps follow. Hopefully there are some bread crumbs that lead to a real solution. My current suspicion is that this is affects people like me who have upgraded VirtualBox in Windows and thus had the Host-Only Adapter driver updated. I think something goes wrong in the update process, but here's what fixed it for me:

1) Open windows command prompt as admin

2) Enter the command:

 netsh interface ip set address name="VirtualBox Host-Only Network" static 192.168.56.1 255.255.255.0

Note: Obviously, you need to change the IP & subnet mask to what you want, but you might also need to change the "name" parameter to match whatever is listed in "View Network Connections". Since there are two identifiers listed there, the one you need for this command is the top identifier (the one that is user modifiable). Other Windows commands use the other identifier, so this may be confusing since the default names are similar ("VirtualBox Host-Only Network" vs "VirtualBox Host-Only Ethernet Adapter"). I also believe it is case sensitive.

3) Verify change with the command:

 netsh interface ip show addresses

When I ran VB, the manually entered settings now appeared in the VB GUI under Preferences->Network->Host-Only. Issuing the following the command also confirmed that DHCP was disabled now:

c:\Program Files\Oracle\VirtualBox>VBoxManage.exe list hostonlyifs

Name:            VirtualBox Host-Only Ethernet Adapter
GUID:            947c0311-30ce-4761-819c-959280a2518c
DHCP:            Disabled
IPAddress:       192.168.56.1
NetworkMask:     255.255.255.0
IPV6Address:     fe80:0000:0000:0000:9c26:7468:8103:8d22
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 0a:00:27:00:00:00
MediumType:      Ethernet
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter

Background for developers: I have encountered this issue with v4.3 and v5 running Windows 8.1 x64. I needed to change my Host-Only adapter's ip address to a static ip. Using the VB GUI or the VBoxManage command line interface both failed silently (it would take my settings, but when I checked them afterward, the settings reverted to a 169.xxx.xxx.xxx ip).

I tried removing and re-adding the host-only adapter from the VB GUI and VBoxManage CLI. I tried uninstalling the Host-Only adapter from device manager (with delete driver option checked). I uninstalled VB 4.3, deleted all registry keys I could find related to VB, rebooted, reinstalled VB v5. Same issue. I rebooted more times than I could count, trying every permutation of commands with a reboot in between. Nothing worked.

The key problem seems to be that the adapter refuses to disable DHCP, and gets stuck with the 169.xxx.xxx.xxx failure IP. Using:

VBoxManage.exe list hostonlyifs

Always showed "DHCP: Enabled" even though I had used VboxManage and VB GUI to assign a static-ip and disable DHCP and no errors were given.

I saw other users were able to access the IPv4 settings through Windows via: View Network Connections -> Host-Only Adapter -> Properties -> IPv4 -> Properties. But I get the error:

Microsoft TCP/IP
In order to configure TCP/IP, you must install and enable a network adapter card. 

which is another indication that Windows thinks the card is missing or disabled, which may indicate why attempting to change the IP address fails silently. I'm not sure why the "netsh" interface (above) works differently, but it works.

Microsoft's Knowledge Base article #308939 describes this error (in 2007) as:

This behavior can occur if your network adapter has been changed 
to another model of network adapter without first being properly
uninstalled by using the Add/Remove Hardware tool in Control Panel. 

...

RESOLUTION
To resolve this behavior after the restoration process, uninstall 
the network adapter in Device Manager, and then run the Add/Remove 
Hardware tool in Control Panel to reinstall the network adapter.

Unfortunately, their "resolution" doesn't seem to work, but this may be a sign than there is a problem during upgrading VB versions since the Host-Only Adapter is updated every time. If it's not being removed properly before the new version is installed, that could be why some people have problems and others don't.

At any rate, I hope this solution works for other people and it saves them some trouble.

Last edited 9 years ago by VBFixer (previous) (diff)

comment:21 by rgevaert, 9 years ago

On Windows 8.1 with VirtualBox 5.0.8 we see the same problem too.

comment:22 by --force, 9 years ago

VBox 4.3.30 here on Windows 8.1.

Tried:

  • Using VBox GUI changing to a different IP won't stick.
  • Adding a new host-only adapter will eventually have its IP lost once virtual machine using it boots up.
  • Deleting all host-only adapters in the Virtualbox interface and re-adding them doesn't help.
  • Going through Windows control panel doesn't help.

I can't use host-only reliably anymore, unfortunately.

comment:23 by HackerBaloo, 9 years ago

I have experienced this in 5.0.16 and a test build 5.0.17-106359 on 64 bit Windows 7 sp1 (two machines), but it seems as if the workaround with netsh interface ip set from VBFixer works for me. thank you

comment:24 by Jjanel, 8 years ago

UPDATE: This glitch seems to have gone away, by 5.1.26 Thanks;)

'bump'. EVERY time I start VBox (5.0.30 r112061; XPsp2 sorry), or even guests!, I have to (in Manager): ctrl-G Network Host-only and re-enter the netmasks! (also shows "Invalid settings detected" icon at bottom) p.s. hovering-over [mouse arrow] the Adapter does show the correct settings!

This is very inconvenient and I often forget to, causing guest's dhclient/dhcpcd to fail to get an address.

Thanks to all VBox'ers for their great contributions to WONDERFUL VBox! -Y2K_4OP4'er ;)

Last edited 7 years ago by Jjanel (previous) (diff)
Note: See TracTickets for help on using tickets.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette