可以使用VBoxManage
工具來找出哪些是你的接口。
這樣你就可以運行 - 如果VBoxManage是不是在你的路徑,需要從你的VBoxManage目錄
VBoxManage.exe list bridgedifs
Name: en0: Wi-Fi (AirPort)
GUID: 00306e65-0000-4000-8000-b8f6b1126bcf
DHCP: Disabled
IPAddress: 192.168.1.33
NetworkMask: 255.255.255.0
IPV6Address:
IPV6NetworkMaskPrefixLength: 0
HardwareAddress: b8:f6:b1:12:6b:cf
MediumType: Ethernet
Status: Up
VBoxNetworkName: HostInterfaceNetworking-en0
Name: en1: 1 Thunderbolt
GUID: 00316e65-0000-4000-8000-3200139bff20
DHCP: Disabled
IPAddress: 0.0.0.0
NetworkMask: 0.0.0.0
IPV6Address:
IPV6NetworkMaskPrefixLength: 0
HardwareAddress: 32:00:13:9b:ff:20
MediumType: Ethernet
Status: Up
VBoxNetworkName: HostInterfaceNetworking-en1
Name: en2: 2 Thunderbolt
GUID: 00326e65-0000-4000-8000-3200139bff21
DHCP: Disabled
IPAddress: 0.0.0.0
NetworkMask: 0.0.0.0
IPV6Address:
IPV6NetworkMaskPrefixLength: 0
HardwareAddress: 32:00:13:9b:ff:21
MediumType: Ethernet
Status: Up
VBoxNetworkName: HostInterfaceNetworking-en2
etc etc
運行此,如果你有cygwin的什麼,你甚至可以運行VBoxManage list bridgedifs | grep -e "^Name:*"
,你會得到在您的Vagrantfile中使用的確切名稱。
上的VirtualBox 5.0.6的Windows中運行
C:\Program Files\Oracle\VirtualBox>vboxmanage list
Oracle VM VirtualBox Command Line Management Interface Version 5.0.6
(C) 2005-2015 Oracle Corporation
All rights reserved.
Usage:
VBoxManage list [--long|-l] vms|runningvms|ostypes|hostdvds|hostfloppies|
intnets|bridgedifs|hostonlyifs|natnets|dhcpservers|
hostinfo|hostcpuids|hddbackends|hdds|dvds|floppies|
usbhost|usbfilters|systemproperties|extpacks|
groups|webcams|screenshotformats
C:\Program Files\Oracle\VirtualBox>vboxmanage list bridgedifs
Name: Intel(R) PRO/1000 MT Network Connection
GUID: 754f0866-bd85-43bc-b403-3c85945b3226
DHCP: Enabled
IPAddress: 172.16.42.165
NetworkMask: 255.255.255.0
IPV6Address: fe80:0000:0000:0000:64b8:b1cf:962f:7aa1
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 00:0c:29:64:09:f3
MediumType: Ethernet
Status: Up
VBoxNetworkName: HostInterfaceNetworking-Intel(R) PRO/1000 MT Network Connection
Name: Juniper Network Connect Virtual Adapter
GUID: ed9c3519-e796-42ce-b782-14ec6819b743
DHCP: Enabled
IPAddress: 169.254.251.149
NetworkMask: 15.0.0.0
IPV6Address: fe80:0000:0000:0000:5525:2e65:10a8:fb95
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 00:ff:10:e0:06:1a
MediumType: Ethernet
Status: Down
VBoxNetworkName: HostInterfaceNetworking-Juniper Network Connect Virtual Adapter
爲什麼你就不能離開'config.vm.network 「public_network」'?否則把'bridge:<接口名稱>''比如'bridge:「en1:Wi-Fi(AirPort)」' –
你不能只放置'config.vm.network「public_network」'離開那樣,流浪者會仍然問你的接口名稱。你在這裏給出的例子'bridge:「en1:Wi-Fi(AirPort)」'是用於MAC的,我在windows上,無法找到我可以在這裏輸出的名字'bridge:'when我做'ipconfig'並且把不同的名字變成可能的,vagrant不接受它,所以我的問題是,我如何找到流浪者想要的名字? –
babababa