问题:使用vagrant up指令启动linux,流程走到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.
解决:
网上看了很多方法,比如开启电脑vt,修改vagrantfile文件等。
因为自己电脑用的matebook14,本身就默认开启vt,所以以上方法都不管用。
在google时看到有外国网友说可以使用最新版本的virtualbox和vagrant来解决,于是我就把自己的旧版本卸载了,重新安装最新版本的virtualbox和vagrant。
在初始化centos7时,使用中科大的镜像版,可以达到10M/s,很快下载完。
- vagrant init centos7 https://mirrors.ustc.edu.cn/centos-cloud/centos/7/vagrant/x86_64/images/CentOS-7.box
这套流程下来,vagrant up终于可以正常启动,也可以vagrant ssh登录了。
具体的出错环节不确定,可能是版本问题,如果有相同情况的朋友可以考虑这样尝试一下。