今天早上vagrant up报错:

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

一开始我启动的时候报错了网上找了一下错误原因,之后看到了这个文章:

vagrant up启动虚拟机出现Time out问题时可尝试的解决_TCCTTCCT的博客-CSDN博客_config.vm.boot_timeout vagrant

发现这个文章的修改太大了,直接重装vagrant+virtualbox,太麻烦。

之后我就在virtualbox中手动启动,之后打开界面看错误,发现启动界面报错了:如下
systemd[1] : failed to load SELinux policy

        我就想起了前一天因为SELinux修改了配置SELINUXTYPE=targed 改成了disabled
因为这个会影响我golang项目访问文件的权限,所以我关闭了,导致启动问题。

        最后按照进入linux启动界面按一直按E,进入启动界面修改配置:
找到 linux16 最后 加上 selinux=0

之后启动了虚拟机,最后修改虚拟机中 /etc/selinux/config配置为:

最后正常关闭虚拟机:

最后进行vagrant up; 就成功啦~!

 喜欢的话点个赞,评个论,如果遇到问题,大家一起探讨,我发现如果启动不了,直接进行手动启动虚拟机,之后查看虚拟机自身的抛出异常,也能很好的解决vagrant启动报错不准确问题,希望大家共勉~

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐