一、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. freemarker if判断
  2. 2010提高组-乌龟棋 [记忆优化搜索]
  3. Spring Cloud Alibaba - 09 Ribbon 饥饿加载及其他配置参数解读
  4. linux改变文件夹权限吗,linux改变文件/文件夹权限
  5. 1.2.4 Selecting a defualt database
  6. NGINX-RTMP复杂度分析
  7. Asp.net服务器端控件替换客户端控件
  8. AI头发笔刷_笔刷不够用?给你送1000款~快来拿走
  9. 选择排序 简单选择排序 直接选择排序的区别
  10. 将视频或动态壁纸设置成桌面
  11. 使用ApiPost按顺序传参及测试多个接口
  12. 易语言 文件捆绑机的原理【转载】
  13. 判断日期是否是明天,今天,昨天
  14. 77、自动喷水灭火系统的巡查内容
  15. 虚拟机的虚拟化如何开启?
  16. 三年级优秀书籍推荐_三年级推荐书单
  17. python numpy 二维数组reshape成三维数组
  18. 人大金仓 日常命令 已解决
  19. 【转帖】论创新工场、职业发展、offer如何比较选择、移动互联网
  20. Android画中画模式-看这篇就够啦

热门文章

  1. C++ 强制关闭进程 Force Terminate Process
  2. 使用CGlib实现Bean拷贝(BeanCopier)
  3. Daily English Dictation NO.1 ~ NO.30
  4. 几何约束求解器算法的实现
  5. python 基金量化分析_「Python量化」怎么在基金定投上实现收益最大化
  6. PTA L1-056 猜数字 (20 分)
  7. Netapp fundamental trainning 笔记2 basic admin
  8. Spring+Quartz实现动态添加定时任务
  9. RAMOS系统 WIN7+VHD+GURB map
  10. RAID6 Vs RAID-DP比较