Vagrant 无法正确启动且无法挂载共享文件夹 [英] Vagrant does not start correctly and not mount shared folders

查看:23
本文介绍了Vagrant 无法正确启动且无法挂载共享文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我执行 vagrant up 时,我明白了:

when I do vagrant up I get this:

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

sed -e '/^#VAGRANT-BEGIN/,/^#VAGRANT-END/ d' /etc/network/interfaces > /tmp/vagrant-network-interfaces

并且同步文件夹不可用.如何解决这个问题?我用

And synced folders are not available. How to fix this? I use

Linux precise64 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

推荐答案

当你运行 vagrant up 时,它会注入如下配置到 /etc/network/interfacescode> 文件以启用默认的 NAT 网络模式.

When you run vagrant up, it'll inject the configuration like below into /etc/network/interfaces file to enable default NAT networking mode.

#VAGRANT-BEGIN
# The contents below are automatically generated by Vagrant. Do not modify.
auto eth1
iface eth1 inet dhcp
    post-up route del default dev $IFACE
#VAGRANT-END

这个命令sed -e '/^#VAGRANT-BEGIN/,/^#VAGRANT-END/d'/etc/network/interfaces >/tmp/vagrant-network-interfaces 删除 vagrant 生成的块并将输出重定向到新文件.不知道为什么 vagrant 会抱怨非零退出代码.即使没有这样的代码块,sed 也应该返回 0.

This command sed -e '/^#VAGRANT-BEGIN/,/^#VAGRANT-END/ d' /etc/network/interfaces > /tmp/vagrant-network-interfaces removes the block generated by vagrant and redirect the output to a new file. No idea why vagrant complains about a non-zero exit code. Even if there is no such code block, sed should return 0.

尝试启用调试输出VAGRANT_LOG=debug vagrant up,看看它是否提供了更多信息.

Try to enable debug output VAGRANT_LOG=debug vagrant up and see if it gives more information.

注意:Vagrant 1.3.0 刚刚发布.尝试将您的 vagrant + virtualbox 组合升级到最新版本.

NOTE: Vagrant 1.3.0 has just been released. Try to upgrade your vagrant + virtualbox combo to latest versions.

这篇关于Vagrant 无法正确启动且无法挂载共享文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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