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 , 13 years ago
follow-up: 3 comment:2 by , 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)
comment:3 by , 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:5 by , 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 , 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 , 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 , 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 , 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:11 by , 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 , 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 , 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 , 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 , 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:17 by , 9 years ago
[UPDATE]
I have performed a lot of testing with host-only networks (up to and including version 4.3.28) and it seems that there are several bugs with this thing at least on MS Windows hosts:
When 1st (default) adapter is there and you add a second one, then:
a) Set IP address to 172.16.1.2 with mask 255.255.255.0; new network adapter in Windows network control panel is OK. In VirtualBox UI, a generated IP address with mask 255.255.0.0 is shown instead. Interface is malfunctioning (of course).
b) Workaround posted by 'Bright' does not work either. You can remove all network adapters and create a new one. New one will not work as expected (at least sometimes).
c) It randomly happens that if I remove all adapters and create two new ones, then no error are reported. After closing and re-opening the VirtualBox UI, none of the network adapters are still there (also not in the MS Windows network control panel).
Moreover, once the host-only interface gets configured in the right way, then starting a virtual machine and pinging the (static) IP configured on eth1 in the VM (in my case: 172.16.1.15) from the physical host takes up to fifteen (15!!!) seconds until the interface comes up and pongs. Please note that the services in the VM bound to this IP are up and running after approx. four seconds. Once it is up and running, then everyhting works smoothly, though.
[PREVIOUS POST]
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.
comment:18 by , 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:20 by , 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.
comment:22 by , 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 , 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 , 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 ;)
not fixed in 4.0.8