Vagrant: Vagrant not detect current host-only network adapters - on Windows

Created on 5 Apr 2013  ยท  20Comments  ยท  Source: hashicorp/vagrant

On windows as host, vagrant create a new host-only network adapter on the host, I think is because Vagrant can't identify a matching host-only network adapter and create a new one. no matter what even if the last host-only network adapter is still there.

The host-only network adapters always differs from the specified ip.

This issue just happen on windows as host, because with the same configuration on a Linux machine as host everything run as expected.

Vagrant version: 1.1.5 for windows
Host: windows 7 64 bit
Guest: centOS 6.4 32 bit
VirtualBox 4.2.10 r84104

Thank you in advance.

Most helpful comment

Have the same issue on Windows 8
vbox

Any solutions?

All 20 comments

Are you using cmd.exe, cygwin, msys, etc. (which one)

Hi I am using windows PowerShell

2013-04-04_173001

I test this issue on different machines and different guests, the last was tested on a new fresh box with ubuntu server 12.04 as guest.

So. I'm on Windows 8 and whenever I attempt to use host only networks with VirtualBox I get a blue screen, so I can't check this out right now, which is a huge bummer.

Could you help by getting me the output with VAGRANT_LOG=debug set?

Hi, sorry for answering until now.

I'm going to try to reproduce the error, beacause we decide to reinstall VirtualBox and deleting all HostOnly network interfaces and the problem was fixed.

Got it, let me know if you see it again. Closing since I haven't heard of any others having this issue.

I ran into the same issue. It appears to only happen when you already have a host only ethernet adapter set up in VirtualBox prior to attempting to use the :private_network functionality in Vagrant.

The simplest solution is to either 1) delete all previous host only ethernet adapters from VirtualBox or 2) set the ip using private_network and force the VM's nic (via VirtualBox) to use the already installed host only network... I.e.

vb.customize ["modifyvm", :id, "--nic2", "hostonly", "--cableconnected2", "on", "--hostonlyadapter2", "VirtualBox Host-Only Ethernet Adapter"]

Given that vboxmanage doesn't provide a great way to list already installed host only ethernet adapters, I don't see how this is readily fixable...

Just my two cents.

it works following @williambillypaul 's advice. :+1:

Strange, I've been running for weeks with no issue, but am now seeing this. It survives me deleting all host adapters from Device Manager and restarting.

I perform a vagrant up on box 1, creates 'VirtualBox Host-Only Network' adapter. I perform the vagrant up for box 2, creates 'VirtualBox Host-Only Network #2'.

Same issue. It creates new adapter on host every time.
Vagrant 1.7.2
Windows 8.1 x64
Virtualbox 4.3.26

If Vagrantfile contains the following:

config.vm.network "private_network", type: :dhcp

it keeps creating new host-only interface on Windows host every next <host reboot> && vagrant up (though it happens after host hibernate - wake up as well).
On host I have the following adapters created by Vagrant and VirtualBox:

VirtualBox Host-Only Network
VirtualBox Host-Only Network #2
VirtualBox Host-Only Network #3
VirtualBox Host-Only Network #4
...

I checked the output of vagrant up --debug, and it seems that Vagrant cannot properly check the existing host-only adapters, or it looks for the specific adapter with ip 172.28.128.1 (INFO network: Network not found. Creating if we can.).

...
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
DEBUG subprocess: Exit status: 0
DEBUG network: Normalized configuration: {:adapter_ip=>"172.28.128.1", :auto_config=>true, :ip=>"172.28.128.1", :mac=>nil, :netmask=>"255.255.255.0", :nic_type=>nil, :type=>:dhcp, :dhcp_ip=>"172.28.128.2", :dhcp_lower=>"172.28.128.3", :dhcp_upper=>"172.28.128.254", :adapter=>2}
 INFO network: Searching for matching hostonly network: 172.28.128.1
 INFO subprocess: Starting process: ["C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe", "list", "hostonlyifs"]
DEBUG subprocess: Selecting on IO
DEBUG subprocess: stdout: Name:            VirtualBox Host-Only Ethernet Adapter
GUID:            c9949815-8c8f-493b-9afa-6810f6ea2288
DHCP:            Enabled
IPAddress:       169.254.212.74
NetworkMask:     255.255.0.0
IPV6Address:     fe80:0000:0000:0000:1801:f6a1:4221:d44a
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 08:00:27:00:c8:ea
MediumType:      Ethernet
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter

DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 31999
DEBUG subprocess: Exit status: 0
 INFO network: Network not found. Creating if we can.
 INFO subprocess: Starting process: ["C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe", "hostonlyif", "create"]
DEBUG subprocess: Selecting on IO
DEBUG subprocess: stderr: 0%...
DEBUG subprocess: stderr:
Progress state: E_FAIL
VBoxManage.exe: error: Failed to create the host-only adapter
VBoxManage.exe: error: Operation canceled by the user
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component VirtualBox, interface IVirtualBox
VBoxManage.exe: error: Context: "int __cdecl handleCreate(struct HandlerArg *,int,int *)" at line 66 of file VBoxManageHostonly.cpp
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 31999
DEBUG subprocess: Exit status: 1
ERROR warden: Error occurred: There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["hostonlyif", "create"]
...

This could also be VirtualBox bug, because the ip of it's adapter on host cannot be changed.

C:\>vboxmanage list hostonlyifs
Name:            VirtualBox Host-Only Ethernet Adapter #2
GUID:            f18aab2a-6db3-44ce-8e06-ad07fbd25bf9
DHCP:            Enabled
IPAddress:       169.254.236.211
NetworkMask:     255.255.0.0
IPV6Address:     fe80:0000:0000:0000:21cb:b27d:4510:ecd3
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 08:00:27:00:00:0e
MediumType:      Ethernet
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter #2

Name:            VirtualBox Host-Only Ethernet Adapter
GUID:            5a74cfe7-fb27-4412-b1f3-84fb42fe8366
DHCP:            Disabled
IPAddress:       192.168.56.1
NetworkMask:     255.255.255.0
IPV6Address:     fe80:0000:0000:0000:ec64:63f3:1601:08fe
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 08:00:27:00:ac:a9
MediumType:      Ethernet
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter


C:\>vboxmanage hostonlyif ipconfig "VirtualBox Host-Only Ethernet Adapter #2" --ip 172.28.128.1 --netmask 255.255.255.0

C:\>vboxmanage list hostonlyifs
Name:            VirtualBox Host-Only Ethernet Adapter #2
GUID:            f18aab2a-6db3-44ce-8e06-ad07fbd25bf9
DHCP:            Enabled
IPAddress:       169.254.236.211
NetworkMask:     255.255.0.0
IPV6Address:     fe80:0000:0000:0000:21cb:b27d:4510:ecd3
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 08:00:27:00:00:0e
MediumType:      Ethernet
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter #2

Name:            VirtualBox Host-Only Ethernet Adapter
GUID:            5a74cfe7-fb27-4412-b1f3-84fb42fe8366
DHCP:            Disabled
IPAddress:       192.168.56.1
NetworkMask:     255.255.255.0
IPV6Address:     fe80:0000:0000:0000:ec64:63f3:1601:08fe
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 08:00:27:00:ac:a9
MediumType:      Ethernet
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter

I have this issue as well, sorry to not have any more info but the project I am on has this

config.vm.network "private_network", ip: client_ip

And it's causing major pains for me running the project. Just wanted to chime in as this is still an issue for me and was hoping to raise more awareness. Thanks a lot for all the hard work.

Virtualbox 5.0.10r104061
Vagrant 1.72.
Windows 8.1 64bit

I found a way to get the project I was working on to work despite this issue. Basically we forced vagrant to use a very specific adapter and not the one that was generated. So something like this:

virtualbox.customize ["modifyvm", :id, "--nic2", "hostonly", "--cableconnected2", "on", "--hostonlyadapter2", "VirtualBox Host-Only Ethernet Adapter"]

Granted this does not fix this issue; but I figured in may help someone find away around it. I currently have to remove the excess adapters by hand, but I am sure one can make a script to do that as well.

Same experience here.

Vagrant 1.7.4 running from Cygwin
Virtualbox Version 5.0.10 r104061
Windows 7 Enterprise

For no apparent reason I started having this problem under Windows 10 with Cygwin/Babun. I have the same issue also with Docker, so I'm pretty sure it's a problem with VirtualBox.

I found that enabling VirualBox NDIS6 Bidge Networking Driver in the adapter properties seemed to have fixed the problem. I noticed it was not enabled and thought I would see what difference it made.

I have since found some confirmation about this at Stack Overflow.

Have the same issue on Windows 8
vbox

Any solutions?

Hey @AlexFdv

Any solutions?

Did you try the suggested solution in the comment immediately prior to yours?

Hi @courtney-miles
Yes, it looks like it doesn't work for me :( I am looking for another solution... I appreciate for any suggestions.

Thank you.

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lebogan picture lebogan  ยท  3Comments

gwagner picture gwagner  ยท  3Comments

hesco picture hesco  ยท  3Comments

janw-me picture janw-me  ยท  3Comments

Cbeck527 picture Cbeck527  ยท  3Comments