Vagrant:vagrant up卡死

Vagrant:vagrant up卡死

1. 环境

  • OS:macOS 10.15.7
  • Vagrant:Vagrant 2.2.14
  • VirtualBox:6.1.18 r142142
    • box:
      • CentOS-7-x86_64-Vagrant-2004_01.VirtualBox.box

2. 错误日志

vagrant up日志:

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'centos8'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: demo_default_1612023130938_87148
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (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
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.

If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.

VirtualBox日志:

# VirtualBox打开虚拟机查看虚拟机情况显示
virtual box vagrant random: crng init done

3. 原因

查找了一些资料也没有确定到底是什么问题导致的。

4. 解决办法

下面两种是独立的解决方案,没有上下关系

4.1. 从VirtualBox UI启动

  1. 从VirtualBox UI启动
  2. 使用vagrant halt停止虚拟机
  3. 接下来就可以使用vagrant up正常启动了

4.2. 更新box

试了下将CentOS7替换为CentOS8最新版本不存在这个问题,测试通过的CentOS-8-Vagrant-8.3.2011-20201204.2.x86_64.vagrant-virtualbox.box。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

yimtcode

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值