vagrant + virtualBox 安裝centos7

瀟凝子瀟發表於2020-12-09
  1. 下載vagrant  

      https://www.vagrantup.com/downloads

        安裝不再贅述,下一步下一步即可,完事後續重啟電腦

      2. 搜尋應用

       https://app.vagrantup.com/boxes/search

       

      3. vagrant init  centos/7 

     

   4.vagrant up 

上邊過程比較漫長,可以單獨通過一下地址下載

https://vagrantcloud.com/centos/boxes/7/versions/2004.01/providers/virtualbox.box

 

Microsoft Windows [版本 10.0.18363.1198]
(c) 2019 Microsoft Corporation。保留所有權利。

D:\devtools\centos-7>vagrant init centos/7
==> vagrant: A new version of Vagrant is available: 2.2.14 (installed version: 2.2.5)!
==> vagrant: To upgrade visit: https://www.vagrantup.com/downloads.html

A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.

D:\devtools\centos-7>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: virtualbox
    default: 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: virtualbox
    default: Downloading: https://vagrantcloud.com/centos/boxes/7/versions/2004.01/providers/virtualbox.box
    default: Download redirected to host: cloud.centos.org
    default:
    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: centos-7_default_1607523377195_91437
==> 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...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["startvm", "e3ae9df8-826a-43e5-89b4-fbc4ae201cd2", "--type", "headless"]

Stderr: VBoxManage.exe: error:  (VERR_NEM_MISSING_KERNEL_API).
VBoxManage.exe: error: VT-x is not available (VERR_VMX_NO_VMX)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component ConsoleWrap, interface IConsole

 

最終還是沒裝成,BIOS 開啟了虛擬化功能 還是報 以下 錯誤

 

Microsoft Windows [版本 10.0.18363.1198]
(c) 2019 Microsoft Corporation。保留所有權利。

C:\WINDOWS\system32>bcdedit

Windows 啟動管理器
--------------------
識別符號                  {bootmgr}
device                  partition=\Device\HarddiskVolume1
path                    \EFI\Microsoft\Boot\bootmgfw.efi
description             Windows Boot Manager
locale                  zh-CN
inherit                 {globalsettings}
badmemoryaccess         Yes
flightsigning           Yes
default                 {current}
resumeobject            {e0052045-902d-11ea-b00f-bca1725cf141}
displayorder            {current}
toolsdisplayorder       {memdiag}
timeout                 0

Windows 啟動載入器
-------------------
識別符號                  {current}
device                  partition=C:
path                    \WINDOWS\system32\winload.efi
description             Windows 10
locale                  zh-CN
inherit                 {bootloadersettings}
recoverysequence        {e0052047-902d-11ea-b00f-bca1725cf141}
displaymessageoverride  Recovery
recoveryenabled         Yes
badmemoryaccess         Yes
isolatedcontext         Yes
allowedinmemorysettings 0x15000075
osdevice                partition=C:
systemroot              \WINDOWS
resumeobject            {e0052045-902d-11ea-b00f-bca1725cf141}
nx                      OptIn
bootmenupolicy          Standard
hypervisorlaunchtype    Auto

C:\WINDOWS\system32>bcdedit/set hypervisorlaunchtype off
操作成功完成。

C:\WINDOWS\system32>

 

win + i  開啟windows 設定

 

 

 

虛擬機器手動啟動報的錯

相關文章