一、Vargant是什么?

这里我就不赘述了,附上知乎大佬的详细解答:

超详细的 Vagrant 上手指南:
https://zhuanlan.zhihu.com/p/259833884

题主所使用的环境是:Window10专业版+ Vagrant 2.2.5 + VirtualBox 6.1

二、问题描述

1.在我成功安装好Vagrant和VirtualBox,下载好镜像文件在Vagrant up的时候发现需要开启Hyper-V

在Windos10上开启Hyper-V:
https://docs.microsoft.com/zh-cn/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v

装好只后成功且可以Vagrant ssh 但是VirtualBox却不显示我安装的虚拟机为此我重装Vagrant和VirtualBox很多次没有完全解决。

查阅读资料后发现Hyper-V和VirtualBox都是Vagrant的供应商看来是我选择错误导致的

之后我卸载了Hyper-V,这时Vagrant up 和上次一样报错了提示要我重新安装Hyper-V;

PS E:\Program Files (x86)\.vagrant.d> vagrant up
Bringing machine 'default' up with 'hyperv' provider...
==> default: Verifying Hyper-V is enabled...
The Hyper-V cmdlets for PowerShell are not available! Vagrant
requires these to control Hyper-V. Please enable them in the
"Windows Features" control panel and try again.

最终定格在 **Bringing machine ‘default’ up with ‘hyperv’ provider…**明显看到我不是通过VirtualBox来启动的而是hyperv…

但是就此问题困惑了我一天,我开始怀疑是不是因为我安装的时候设置了默认Hyper-V?

2.官方文档

https://www.vagrantup.com/
在此强调有什么问题一定要看官方文档!!!

终于找到了解决办法-代码如下:

PS E:\Program Files (x86)\.vagrant.d> vagrant box list
centos7 (virtualbox, 0) ##我们在使用 Box list的时候会在括号后面显示提供商vagrant up --provider=virtualbox ##那么我们就可以通过up时指定virtualBox即可##新的报错
PS E:\Program Files (x86)\.vagrant.d> vagrant up --provider=virtualbox
The provider 'virtualbox' that was requested to back the machine
'default' is reporting that it isn't usable on this system. The
reason is shown below:Vagrant has detected that you have a version of VirtualBox installed
that is not supported by this version of Vagrant. Please install one of
the supported versions listed below to use Vagrant:4.0, 4.1, 4.2, 4.3, 5.0, 5.1, 5.2, 6.0A Vagrant update may also be available that adds support for the version
you specified. Please check www.vagrantup.com/downloads.html to download
the latest version.

此报错一出就已经很好解决了
Vagrant 2.2.6 无法使用VirtualBox 6.1解决办法:
https://blog.csdn.net/daxiang52/article/details/103518589

成功:!!

PS E:\Program Files (x86)\.vagrant.d> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'centos/7' could not be found. Attempting to find and install...default: Box Provider: virtualboxdefault: Box Version: >= 0
==> default: Loading metadata for box 'centos/7'default: URL: https://vagrantcloud.com/centos/7
==> default: Adding box 'centos/7' (v2004.01) for provider: virtualboxdefault: Downloading: https://vagrantcloud.com/centos/boxes/7/versions/2004.01/providers/virtualbox.boxdefault: Download redirected to host: cloud.centos.orgdefault:default: Calculating and comparing box checksum...
==> default: Successfully added box 'centos/7' (v2004.01) for 'virtualbox'!
==> default: Importing base box 'centos/7'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'centos/7' version '2004.01' is up to date...
==> default: Setting the name of the VM: vagrantd_default_1625360020354_29009
==> 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:2222default: SSH username: vagrantdefault: SSH auth method: private keydefault:default: Vagrant insecure key detected. Vagrant will automatically replacedefault: this with a newly generated keypair for better security.default:default: Inserting generated public key within guest...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...default: No guest additions were detected on the base box for this VM! Guestdefault: additions are required for forwarded ports, shared folders, host onlydefault: networking, and more. If SSH fails on this machine, please installdefault: the guest additions and repackage the box to continue.default:default: This is not an error message; everything may continue to work properly,default: in which case you may ignore this message.
==> default: Rsyncing folder: /cygdrive/e/Program Files (x86)/.vagrant.d/ => /vagrant

同时VirtualBox也识别到了:

然而在我高兴的时候

PS E:\Program Files (x86)\.vagrant.d> vagrant ssh
vagrant@127.0.0.1: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

我使用ssh链接不上

解决办法:https://blog.csdn.net/ai_0922/article/details/106366521

至此:链接成功!!

PS E:\Program Files (x86)\.vagrant.d> vagrant ssh
Last login: Sun Jul  4 01:16:21 2021 from 10.0.2.2
[vagrant@10 ~]$

总结

一点要先看官方文档(泪目~)

Vagrant与VirtualBox踩坑记录相关推荐

  1. VirtualBox VM+Vagrant 启动失败踩坑记录

    VirtualBox VM+Vagrant 启动失败踩坑记录 今天天气晴朗,是个学项目的好日子啊好日子. 卧槽,怎么访问Redis超时了.迅速打开Xshell看能不能连接,断了,我猜肯定是我内存不够, ...

  2. 为Jupyter notebook配置R kernel过程及踩坑记录

    为Jupyter notebook配置R kernel过程及踩坑记录 注意:本文为作者安装过程及折腾的过程,内容比较冗杂,如果读者想直接创建一个属于自己的子环境则参考: 如下文章: anaconda下 ...

  3. Python打包工具Pyintealler打包py文件为windows exe文件过程及踩坑记录+实战例子

    Python打包工具Pyintealler打包py文件为windows exe文件过程及踩坑记录+实战例子 目录 Python打包工具Pyintealler打包py文件为windows exe文件过程 ...

  4. TVM: Deep Learning模型的优化编译器(强烈推荐, 附踩坑记录)

    本文作者是阿莱克西斯,原载于知乎,雷锋网(公众号:雷锋网)获得授权转载. (前排提醒,本文的人文内容部分稍稍带有艺术加工,请保持一定的幽默感进行阅读) 关注我最近想法的同学应该知道我最近都在把玩 TV ...

  5. 使用Java读取 “Python写入redis” 的数据踩坑记录

    https://my.oschina.net/u/2338224/blog/3061507 使用Java读取 "Python写入redis" 的数据踩坑记录 https://seg ...

  6. osx php7 imagick,[PHP] MacOS 自带php环境安装imagick扩展踩坑记录 | 码农部落

    前言 最近学习yii2,在搭建环境后,发现在访问contact页面时报错,如下: "Either GD PHP extension with FreeType support or Imag ...

  7. vue-i18n使用及踩坑记录

    使用步骤 1. 安装 npm i vue-i18n 2. vue-cli下使用 //1. 引入 vue-i18n import Vue from 'vue' import VueI18n from ' ...

  8. SpringBoot踩坑记录 Invalid bound statement (not found)引发的一些列问题

    SpringBoot踩坑记录 Invalid bound statement (not found)引发的一些列问题 当你开开心心搭建了一个SpringBoot项目,用插件生成了entity.dao. ...

  9. mysql 使用sum limit_mysql踩坑记录之limit和sum函数混合使用问题

    问题复盘 本次复盘会用一个很简单的订单表作为示例. 数据准备 订单表建表语句如下(这里偷懒了,使用了自增ID,实际开发中不建议使用自增ID作为订单ID) CREATE TABLE `order` ( ...

最新文章

  1. linux c实现函数回调,c语言实现linux抓包
  2. Linux 第70天 mariadb transaction, log
  3. python3.7和3.8的区别-python3.8.0与3.7.0哪个好?
  4. 据阿里云EMR快速搭建数据平台(二)
  5. 不服来战!这才是产品汪与程序猿撕逼的正确方式
  6. python drawline_基于python,OPenCv中基本的绘图函数
  7. 360无痕浏览器_浏览器如何开启老板键?
  8. [转]微信小程序登录逻辑梳理
  9. python object单引号变成双引号_Python学习第163课--Linux命令行中的单引号和双引号...
  10. TensorFlow笔记(12) VGG16
  11. selenium中,运行测试用例,报NosuchElementException错误,用try --except 捕获异常
  12. jquery选择器的总结
  13. mysql 改变 执行计划_诡异的MySql执行计划的更改
  14. VC资源编辑器里对话框的大小和实际的像素尺寸显示问题
  15. mASK调制在AWGN信道下的可达信息速率的积分计算法
  16. 小srf的游戏 题解
  17. aauto桌面小应用-简单番茄钟
  18. 2019中南大学计算机考研分数线,中南大学2019年硕士研究生招生复试基本分数线...
  19. 面试常见的功能测试考试题关于测试方法的
  20. 数据结构常见问题系列(二)

热门文章

  1. js中的eq语句_jQuery中eq()方法用法实例
  2. cloudcompare2.12.4编译全过程
  3. 排序算法之 归并排序 及其时间复杂度和空间复杂度
  4. Authentication
  5. Android各种好看吐司设计
  6. freenas php5.56,FreeNAS中文网
  7. 爱拼车退出市场 有感
  8. Opengl ES系列学习--glViewport API使用
  9. linux逻辑文件块,Linux文件系统和逻辑卷管理命令(一)
  10. a tag中span居中