栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

Vagrant搭建虚拟机

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Vagrant搭建虚拟机

概述

我参考此文在个人电脑成功用Vagrant搭建虚拟机,本文记录在搭建过程中遇到的问题和解决方法。

遇到的问题

vagrant up启动报错

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: importing base box 'centos-7'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: demo_default_1588406874156_65036
==> 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.
如何解决

网上搜索出来最多的解决方法是设置BIOS的虚拟化,而我的BIOS已经开启了虚拟化但仍然出现这种错误。后来我通过查看virtualbox的日志定位到问题,具体方法如下

1. 打开virtualbox

2. 右击启动报错的虚拟机,点击日志

 3. 查看日志发现关键信息

kernel panic - not syncing fatal exception

4. 参考此文通过升级vagrant和virtualbox解决了问题

原来的版本

vagrant: 2.2.9

virtualbox: 6.0.24

升级到当前最新版本

vagrant: 2.2.18

virtualbox: 6.1.28

所以, 我的经验是这种错误日志是通用日志,需要查看virtualbox的日志具体问题具体分析。

最后,感谢下面所有参考文献。

参考

超详细 Vagrant 入门指南,建议收藏_DavyCloud-CSDN博客_vagrant

vagrant 启动 报错:Timed out while waiting for the machine to boot_lw545034502的博客-CSDN博客

虚拟机安装报错kernel panic - not syncing fatal exception_u013761049的专栏-CSDN博客

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/450898.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号