Vagrant 网络与非主机网络发生冲突 [英] Vagrant network collides with a non-hostonly network

查看:34
本文介绍了Vagrant 网络与非主机网络发生冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试启动并运行一个 vagrant box,但我不断收到网络冲突错误.这个盒子是trusty64的全新下载.我一直在搜索与 vagrant 打交道的每个文件和文件夹,试图找到一些指定我不能指定 IP 的东西.我在 Windows 7 机器上运行 vagrant.这是我的 Vagrantfile:

I am trying to get a vagrant box up and running, but I keep getting network collide errors. This box is a fresh download of trusty64. I have been searching every file and folder dealing with vagrant trying to find something specifying an IP I can't. I am running vagrant on a windows 7 machine. Here is my Vagrantfile:

C:\Users\.vagrant\boxes...\Vagrantfile

C:\Users\.vagrant\boxes...\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 命令收到的错误:

This is the error I receive from a vagrant up command:

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.

如何让我的虚拟机上的 IP 不冲突?

How do I get the IP on my virtualbox not to collide?

更新

我的 Vagrantfile 的图像

A image of my Vagrantfile

推荐答案

检查 LAN 连接上的 IP,并确保没有设备与 Vagrantfile 上的 IP 发生冲突.

Check the IP you have on your LAN connection and make sure no devices are colliding with the IP on your Vagrantfile.

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

I got this error and I had 192.168.1.2 on my laptop's wifi and I was setting 192.168.1.10 on my Vagrantfile. So I changed the IP on my Vagrantfile to 192.168.2.10 to make sure it won't collide with any device on my network.

这篇关于Vagrant 网络与非主机网络发生冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆