hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.
https://www.vagrantup.com
Other
26.24k stars 4.44k forks source link

vagrant up does not allow to select network interface for bridged network #13025

Open oskrif opened 1 year ago

oskrif commented 1 year ago

In last version I stuck with error #12996. In this version seems to be fixed, but I stuck on other related error. I stuck on interface select for bridged network.

Debug output

[https://gist.github.com/oskrif/cc20fe082f7183a726852f00d2f29b2b](debug log)

Expected behavior

When up command has been executed, I can select network interface for bridge, or it will be detected automatically.

Actual behavior

I have stuck on infinitive question "default: Which interface should the network bridge to?", regardless I wrote right interface name ('en0' or 'en0: Wi‑Fi'), which I have found with this command "vboxmanage list bridgedifs".

richardfalta@Richard-MacBook-Pro wavecafe % vboxmanage list bridgedifs
Name:            en0: Wi‑Fi
GUID:            00306e65-0000-4000-8000-f8ffc213119a
DHCP:            Disabled
IPAddress:       192.168.1.251
NetworkMask:     255.255.255.0
IPV6Address:     
IPV6NetworkMaskPrefixLength: 0
HardwareAddress: f8:ff:c2:13:11:9a
MediumType:      Ethernet
Wireless:        No
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-en0

Name:            en5: USB Ethernet(?)
GUID:            00356e65-0000-4000-8000-acde48001122
DHCP:            Disabled
IPAddress:       0.0.0.0
NetworkMask:     0.0.0.0
IPV6Address:     
IPV6NetworkMaskPrefixLength: 0
HardwareAddress: ac:de:48:00:11:22
MediumType:      Ethernet
Wireless:        No
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-en5

Name:            ap1
GUID:            00317061-0000-4000-8000-faffc213119a
DHCP:            Disabled
IPAddress:       0.0.0.0
NetworkMask:     0.0.0.0
IPV6Address:     
IPV6NetworkMaskPrefixLength: 0
HardwareAddress: fa:ff:c2:13:11:9a
MediumType:      Ethernet
Wireless:        No
Status:          Down
VBoxNetworkName: HostInterfaceNetworking-ap1

Name:            awdl0
GUID:            6c647761-0030-4000-8000-6ea278b0e3e3
DHCP:            Disabled
IPAddress:       0.0.0.0
NetworkMask:     0.0.0.0
IPV6Address:     
IPV6NetworkMaskPrefixLength: 0
HardwareAddress: 6e:a2:78:b0:e3:e3
MediumType:      Ethernet
Wireless:        No
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-awdl0

Name:            bridge0
GUID:            64697262-6567-4030-8000-82416c43ac01
DHCP:            Disabled
IPAddress:       0.0.0.0
NetworkMask:     0.0.0.0
IPV6Address:     
IPV6NetworkMaskPrefixLength: 0
HardwareAddress: 82:41:6c:43:ac:01
MediumType:      Ethernet
Wireless:        No
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-bridge0

Name:            llw0
GUID:            30776c6c-0000-4000-8000-6ea278b0e3e3
DHCP:            Disabled
IPAddress:       0.0.0.0
NetworkMask:     0.0.0.0
IPV6Address:     
IPV6NetworkMaskPrefixLength: 0
HardwareAddress: 6e:a2:78:b0:e3:e3
MediumType:      Ethernet
Wireless:        No
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-llw0

Name:            en2: Thunderbolt 2
GUID:            00326e65-0000-4000-8000-82416c43ac00
DHCP:            Disabled
IPAddress:       0.0.0.0
NetworkMask:     0.0.0.0
IPV6Address:     
IPV6NetworkMaskPrefixLength: 0
HardwareAddress: 82:41:6c:43:ac:00
MediumType:      Ethernet
Wireless:        No
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-en2

Name:            en1: Thunderbolt 1
GUID:            00316e65-0000-4000-8000-82416c43ac01
DHCP:            Disabled
IPAddress:       0.0.0.0
NetworkMask:     0.0.0.0
IPV6Address:     
IPV6NetworkMaskPrefixLength: 0
HardwareAddress: 82:41:6c:43:ac:01
MediumType:      Ethernet
Wireless:        No
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-en1

Name:            en4: Thunderbolt 4
GUID:            00346e65-0000-4000-8000-82416c43ac04
DHCP:            Disabled
IPAddress:       0.0.0.0
NetworkMask:     0.0.0.0
IPV6Address:     
IPV6NetworkMaskPrefixLength: 0
HardwareAddress: 82:41:6c:43:ac:04
MediumType:      Ethernet
Wireless:        No
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-en4

Name:            en3: Thunderbolt 3
GUID:            00336e65-0000-4000-8000-82416c43ac05
DHCP:            Disabled
IPAddress:       0.0.0.0
NetworkMask:     0.0.0.0
IPV6Address:     
IPV6NetworkMaskPrefixLength: 0
HardwareAddress: 82:41:6c:43:ac:05
MediumType:      Ethernet
Wireless:        No
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-en3

Reproduction information

Vagrant version

Vagrant 2.3.4

Host operating system

ProductName: macOS (Intel) ProductVersion: 13.0.1 BuildVersion: 22A400

Guest operating system

CentOs 7

Steps to reproduce

  1. vagrant up

Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|

  # Create a private network, which allows host-only access to the machine
  # using a specific IP.
  config.vm.network "private_network", ip: "192.168.33.56"

  # Create a public network, which generally matched to bridged network.
  # Bridged networks make the machine appear as another physical device on
  # your network.
  config.vm.network "public_network"

end
soapy1 commented 1 year ago

Heya, thanks for opening up an issue. It looks like you clearly have available interfaces to bridge to. For virtual box > 7 Vagrant will remove host only networks from the list of networks available to bridge to. So, could you share the output of $ VBoxManage list hostonlynets

I'm able to reproduce this issue if I have some host only networks defined in virtualbox that overlapping ip addresses with networks I would otherwise be able to bridge to. For example, the following config for host only networks

% VBoxManage list hostonlynets
Name:            HostNetwork
GUID:            afdc8230-7fb8-4f15-b809-ffd050fb9de6

State:           Enabled
NetworkMask:     255.255.252.0
LowerIP:         192.168.4.43
UpperIP:         192.168.1.199
VBoxNetworkName: hostonly-HostNetwork

.... etc ...

% vboxmanage list bridgedifs  
Name:            en0: Wi-Fi
GUID:            00306e65-0000-4000-8000-f8ffc248d2b8
DHCP:            Disabled
IPAddress:       192.168.4.43
NetworkMask:     255.255.252.0
IPV6Address:     
IPV6NetworkMaskPrefixLength: 0
HardwareAddress: f8:ff:c2:48:d2:b8
MediumType:      Ethernet
Wireless:        No
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-en0

... etc ...
oskrif commented 1 year ago

Thanks, for your reply. Output is.

VBoxManage list hostonlynets
Name:            vagrantnet-vbox1
GUID:            4da377a0-8ca6-4847-8f73-adc53c3f1e9c

State:           Enabled
NetworkMask:     255.255.255.0
LowerIP:         192.168.33.0
UpperIP:         192.168.33.0
VBoxNetworkName: hostonly-vagrantnet-vbox1

thanks