问题描述
我是VM的新手,但一直在使用vagrant在Ubuntu 14.04上运行Centos VM。突然 vagrant up
命令发出此错误:
root @shanky:〜/ centos #vagrant up
使用'virtualbox'提供商将机器默认上传...
==>默认:检查'chef / centos-6.5'框是否是最新的...
==>默认值:清除之前设置的所有转发端口...
==>默认值:清除以前设置的所有网络接口...
==>默认值:可用的桥接网络接口:
1)eth0
2)wlan0
==>默认:选择界面时,通常是
==>默认:用于连接互联网。
default:网络桥接到哪个接口? 1
==>默认值:根据配置准备网络接口...
默认值:适配器1:nat
默认值:适配器2:桥接
==>默认:转发端口...
默认值:80 => 5444(适配器1)
默认值:22 => 2222(适配器1)
==>默认值:引导VM ...
==>默认值:等待机器启动。这可能需要几分钟...
默认值:SSH地址:127.0.0.1:2222
默认值:SSH用户名:vagrant
默认值:SSH身份验证方法:私钥
默认值:警告:连接超时。正在重试...
default:警告:远程连接断开连接。正在重试...
==>默认:机器启动并准备就绪!
==>默认值:在VM中检查访客添加内容...
==> default:配置和启用网络接口...
以下SSH命令以非零退出状态响应。
Vagrant认为这意味着命令失败了!
ARPCHECK = no / sbin / ifup eth1 2> / dev / null
来自命令的标准输出:
确定eth1的IP信息... PING 10.1.34.1(10.1.34.1)来自10.1.34.183 eth1:56(84)字节的数据。
--- 10.1.34.1 ping statistics ---
发送3个包,0个接收,+ 3个错误,100%丢包,时间2999ms
pipe 3
PING 10.2.56.1(10.2.56.1)来自10.2.56.156 eth1:56(84)字节的数据。
--- 10.2.56.1 ping statistics ---
发送3个包,0个接收,+ 3个错误,100%丢包,时间3000ms
pipe 3
失败了。
来自命令的Stderr:
我能够将ssh变为VM但是eth1不是更长时间给出一个可解析的ip(即它不给 inet addr
参数。如何解决这个问题?
PS
I已经尝试过修改eth1,如上面的链接所示,但是没有用.PLz帮助。
谢谢。
事实证明,eth2是将虚拟盒直接连接到外部Internet的适配器,因此注释掉
config.vm .network:public_network
来自VagrantFile的
停止了正在加载的公共网络接口,从而解决了这个问题。 / p>
I am new to VMs, but have been using vagrant to run a Centos VM on Ubuntu 14.04. All of a sudden vagrant up
command is giving this error:
root@shanky:~/centos# vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'chef/centos-6.5' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Available bridged network interfaces:
1) eth0
2) wlan0
==> default: When choosing an interface, it is usually the one that is
==> default: being used to connect to the internet.
default: Which interface should the network bridge to? 1
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: bridged
==> default: Forwarding ports...
default: 80 => 5444 (adapter 1)
default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection timeout. Retrying...
default: Warning: Remote connection disconnect. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
ARPCHECK=no /sbin/ifup eth1 2> /dev/null
Stdout from the command:
Determining IP information for eth1...PING 10.1.34.1 (10.1.34.1) from 10.1.34.183 eth1: 56(84) bytes of data.
--- 10.1.34.1 ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2999ms
pipe 3
PING 10.2.56.1 (10.2.56.1) from 10.2.56.156 eth1: 56(84) bytes of data.
--- 10.2.56.1 ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3000ms
pipe 3
failed.
Stderr from the command:
I am able to vagrant ssh to VM but eth1 is no longer giving a resolvable ip (i.e. it does not give inet addr
paramater. How to resolve this?
I have tried some tinkering with eth1 as suggested in above link but to non avail. PLz help.Thanks.
It turns out that eth2 is the adapter to connect the Virtual-box directly to the outside Internet, so commenting out
config.vm.network :public_network
from the VagrantFile stopped the public network interfaces being loaded and so solved the issue.
这篇关于vagrant up命令给出错误,eth1没有显示可解析的ip地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!