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
- 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启动
- 从VirtualBox UI启动
- 使用vagrant halt停止虚拟机
- 接下来就可以使用vagrant up正常启动了
4.2. 更新box
试了下将CentOS7替换为CentOS8最新版本不存在这个问题,测试通过的CentOS-8-Vagrant-8.3.2011-20201204.2.x86_64.vagrant-virtualbox.box。