Vagrant 流浪网络与非主机网络冲突

Vagrant 流浪网络与非主机网络冲突,vagrant,virtualbox,Vagrant,Virtualbox,我正试图让一个流浪者盒子启动并运行,但我不断收到网络冲突错误。此框是trusty64的新下载。我一直在搜索每一个和流浪汉打交道的文件和文件夹,试图找到一些指定IP的东西,但我找不到。我在Windows7机器上运行“流浪者”。这是我的档案: C:\Users\.vagrant\box…\Vagrantfile Vagrant::Config.run do |config| # This Vagrantfile is auto-generated by 'vagrant package' to

我正试图让一个流浪者盒子启动并运行,但我不断收到网络冲突错误。此框是trusty64的新下载。我一直在搜索每一个和流浪汉打交道的文件和文件夹,试图找到一些指定IP的东西,但我找不到。我在Windows7机器上运行“流浪者”。这是我的档案:

C:\Users\.vagrant\box…\Vagrantfile

Vagrant::Config.run do |config|
  # This Vagrantfile is auto-generated by 'vagrant package' to contain
  # the MAC address of the box. Custom configuration should be placed in
  # the actual 'Vagrantfile' in this box.
  config.vm.base_mac = "0800278493DB"
end

# Load include vagrant file if it exists after the auto-generated
# so it can override any of the settings
include_vagrantfile = File.expand_path("../include/_Vagrantfile", __FILE__)
load include_vagrantfile if File.exist?(include_vagrantfile)
这是我从一个vagrant up命令收到的错误:

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set network interfaces...
The specified host network collides with a non-hostonly network!
This will cause your specified IP to be inaccessible. Please change
the IP or name of your host only network so that it no longer matches that of
a bridged or non-hostonly network.
如何使我的virtualbox上的IP不发生冲突

更新

我的流浪汉档案的图像

Vagrant::Config.run do |config|
  # This Vagrantfile is auto-generated by 'vagrant package' to contain
  # the MAC address of the box. Custom configuration should be placed in
  # the actual 'Vagrantfile' in this box.
  config.vm.base_mac = "0800278493DB"
end

# Load include vagrant file if it exists after the auto-generated
# so it can override any of the settings
include_vagrantfile = File.expand_path("../include/_Vagrantfile", __FILE__)
load include_vagrantfile if File.exist?(include_vagrantfile)
1。 在homestead.rb中找到

配置专用网络IP config.vm.Network:Private_Network,IP:settings[“IP”]| |=“192.168.10.10” 因为ip是固定的

二,。 设置您自己的ip地址 config.vm.network:public_network,ip:settings[“ip”]| |=“192.168.1.234”,:bridge=>“您自己的ip”

三,。 重新加载该框并选择您正在使用WIFI
现在,您可以在本地网络中访问

检查LAN连接上的IP,确保没有设备与文件上的IP冲突


我收到了这个错误,我的笔记本电脑的wifi上有
192.168.1.2
,我正在我的文件上设置
192.168.1.10
。因此,我将Vagrant文件上的IP更改为
192.168.2.10
,以确保它不会与网络上的任何设备发生冲突。

我遇到了同样的挑战,并采取了以下措施来解决它:

在VirtualBox中,转到文件->主机网络管理器

请注意此窗口中的IPv4地址。在文件中,使用保留的专用IPv4网络范围内的任何IP。假设您的VirtualBox IPv4地址为192.168.56.1/24。在您的文件中,您可以添加

config.vm.network“专用_网络”,ip:“192.168.56.5”


如果需要,请记住相应地配置主机文件。

我通过断开与internet的连接来解决此连接,然后运行vagrant up。一旦流浪者完成了它的处理,所以我再次连接


在这个问题之前,我检查了我的ip,所以它是10.1,我的家园运行在10.10,我解决了这个iss,当我在家工作时,我也遇到了同样的问题,所以我在我的
流浪者文件上所做的是:

#app.vm.network:private#u网络,ip:'10.0.0.07'#工作
app.vm.network:private_network,ip:'192.168.56.77'#home

我会根据我的位置进行注释/取消注释。

显示你的整个
vagrant文件。
。不,不是。它甚至不包含对您提到的
trusty64
框的引用。请查找上面我的Vagrant文件的图像。这不是您的
Vagrant文件
。这是盒子里的一块。请出示您用来运行机器的
vagrant文件
。我不知道还有另一个vagrant文件。我在windows计算机上的位置如何?这并不能解决问题,只是一个解决办法,每次这样做都会非常痛苦。同意,@ZacGrierson如果我们从homestead.yml文件更改ip地址呢。这将是一个快速解决办法,对吗?我的流浪机器只有在我回家的时候才会表现得很奇怪。发现它在共享我路由器的IP地址。更改流浪IP地址修复了该问题。