Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vagrant not detect current host-only network adapters - on Windows #1544

Closed
oliverhr opened this issue Apr 4, 2013 · 20 comments
Closed

Vagrant not detect current host-only network adapters - on Windows #1544

oliverhr opened this issue Apr 4, 2013 · 20 comments

Comments

@oliverhr
Copy link

oliverhr commented Apr 4, 2013

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.

@mitchellh
Copy link
Contributor

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

@oliverhr
Copy link
Author

oliverhr commented Apr 4, 2013

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.

@mitchellh
Copy link
Contributor

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.

@mitchellh
Copy link
Contributor

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

@oliverhr
Copy link
Author

oliverhr commented Apr 8, 2013

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.

@mitchellh
Copy link
Contributor

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

@ghost
Copy link

ghost commented Apr 29, 2013

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.

@hugomrdias
Copy link

got it to work this way #1014 (comment)

@starandtina
Copy link

it works following @williambillypaul 's advice. 👍

@mateodelnorte
Copy link

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'.

@bofm
Copy link

bofm commented Apr 5, 2015

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

@bofm
Copy link

bofm commented Apr 5, 2015

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

@troyblank
Copy link

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

@troyblank
Copy link

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.

@filviu
Copy link

filviu commented Dec 11, 2015

Same experience here.

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

@courtney-miles
Copy link

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.

@AlexFdv
Copy link

AlexFdv commented Oct 17, 2016

Have the same issue on Windows 8
vbox

Any solutions?

@courtney-miles
Copy link

Hey @AlexFdv

Any solutions?

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

@AlexFdv
Copy link

AlexFdv commented Oct 18, 2016

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.

@ghost
Copy link

ghost commented Apr 3, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants