Unable to install kubernetes via vagrant in my ubuntu VirtualBox

saurabhubuntu@worker01:~/kubernetes/certified-kubernetes-administrator-course$ vagrant up
Bringing machine ‘kubemaster’ up with ‘virtualbox’ provider…
Bringing machine ‘kubenode01’ up with ‘virtualbox’ provider…
Bringing machine ‘kubenode02’ up with ‘virtualbox’ provider…
==> kubemaster: Importing base box ‘ubuntu/bionic64’…
==> kubemaster: Matching MAC address for NAT networking…
==> kubemaster: Setting the name of the VM: kubemaster
==> kubemaster: Clearing any previously set network interfaces…
==> kubemaster: Preparing network interfaces based on configuration…
kubemaster: Adapter 1: nat
kubemaster: Adapter 2: hostonly
==> kubemaster: Forwarding ports…
kubemaster: 22 (guest) => 2711 (host) (adapter 1)
kubemaster: 22 (guest) => 2222 (host) (adapter 1)
==> kubemaster: Running ‘pre-boot’ VM customizations…
==> kubemaster: 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”, “a6eb74c3-edc4-411f-9421-77765bbecbc8”, “–type”, “headless”]

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

Hello all , i am unable to install kubernetes via vagrant in my ubuntu machine , i tried to remove and install vagrant and vboxmanage many time but it does not help , below is the verison installed in my machine. please have a look and let me know if u have any idea

saurabhubuntu@worker01:~/kubernetes/certified-kubernetes-administrator-course$ vagrant --version
Vagrant 2.2.6
saurabhubuntu@worker01:~/kubernetes/certified-kubernetes-administrator-course$ vboxmanage --version

the vagrant file resource i use is from :

what is the current version of VirtualBox? Also, what is the output of vagrant up --debug?

Version is VirtualBox 6.1 , vagrant debug output is huge size and i cant upload as attachment as i am new user.
however i will paste errors that i see. al,ost all the error like below comes.

INFO warden: Recovery complete.
INFO warden: Beginning recovery process…
INFO warden: Recovery complete.
ERROR warden: Error occurred: There was an error while executing VBoxManage, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: [“startvm”, “a6eb74c3-edc4-411f-9421-77765bbecbc8”, “–type”, “headless”]

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

INFO warden: Beginning recovery process…
INFO warden: Recovery complete.
ERROR warden: Error occurred: There was an error while executing VBoxManage, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: [“startvm”, “a6eb74c3-edc4-411f-9421-77765bbecbc8”, “–type”, “headless”]

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

INFO warden: Beginning recovery process…
INFO warden: Recovery complete.
INFO warden: Beginning recovery process…
INFO warden: Recovery complete.
INFO warden: Beginning recovery process…

ERROR warden: Error occurred: There was an error while executing VBoxManage, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: [“startvm”, “a6eb74c3-edc4-411f-9421-77765bbecbc8”, “–type”, “headless”]

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

Command: [“startvm”, “a6eb74c3-edc4-411f-9421-77765bbecbc8”, “–type”, “headless”]

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

ERROR vagrant: There was an error while executing VBoxManage, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: [“startvm”, “a6eb74c3-edc4-411f-9421-77765bbecbc8”, “–type”, “headless”]

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

The last section in your log says there is something with virtualization in your system.
First, we need to check if virtualization is enabled on your system or not.

In PowerShell run: Get-ComputerInfo -property "HyperV*"

    ```
    PS C:\temp> Get-ComputerInfo -property "HyperV*"

    HyperVisorPresent                                 : True
    HyperVRequirementDataExecutionPreventionAvailable : True
    HyperVRequirementSecondLevelAddressTranslation    : True
    HyperVRequirementVirtualizationFirmwareEnabled    : True
    HyperVRequirementVMMonitorModeExtensions          : True
    ```

You should see the line with true HyperVRequirementVirtualizationFirmwareEnabled : True

IF the line HyperVisorPresent : True then you should disable it using PowerShell again, Run the below in PoweShell
Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Hypervisor

Then we can restart the machine and retry using virtual box and see what will happen

Answer quoted from intel-virtualization

thanks the current out out is as below.

PS C:\Users\user> cd PS C:\Users\user> Get-ComputerInfo -property “HyperV*”

HyperVisorPresent : True
HyperVRequirementDataExecutionPreventionAvailable :
HyperVRequirementSecondLevelAddressTranslation :
HyperVRequirementVirtualizationFirmwareEnabled :
HyperVRequirementVMMonitorModeExtensions :

Can u confirm what the final output should be ?? should it be
HyperVRequirementVirtualizationFirmwareEnabled : True
HyperVisorPresent :

Yes,
HyperVisorPresent should be false
and
HyperVRequirementVirtualizationFirmwareEnabled should be true.
Regarding the first point it’s mentioned in the first comment, regarding the second point please try the below steps to enable virtualization in your BIOS.

  • Reboot your computer
  • Right when the computer is coming up from the black screen, press Delete , Esc , F1 , F2 , or F4 . Each computer manufacturer uses a different key but it may show a brief message at boot telling you which one to press. If you miss it the first time, reboot and try again. It helps to tap the key about twice a second when the computer is coming up. If you are not able to enter the BIOS via this method, consult your computer’s manual.
  • In the BIOS settings, find the configuration items related to the CPU. These can be in under the headings Processor , Chipset , or Northbridge .
  • Enable virtualization; the setting may be called VT-x , AMD-V , SVM , or Vanderpool . Enable Intel VT-d or AMD IOMMU if the options are available.
  • Save your changes and reboot.

hi ,

Now HyperVisorPresent is false
and
HyperVRequirementVirtualizationFirmwareEnabled is true but still not working
PC:\WINDOWS\system32> Get-ComputerInfo -property “HyperV*”

HyperVisorPresent : False
HyperVRequirementDataExecutionPreventionAvailable : True
HyperVRequirementSecondLevelAddressTranslation : True
HyperVRequirementVirtualizationFirmwareEnabled : True
HyperVRequirementVMMonitorModeExtensions : True

output vagrant up:
saurabhubuntu@worker01:~/kubernetes/certified-kubernetes-administrator-course$ vagrant up
Bringing machine ‘kubemaster’ up with ‘virtualbox’ provider…
Bringing machine ‘kubenode01’ up with ‘virtualbox’ provider…
Bringing machine ‘kubenode02’ up with ‘virtualbox’ provider…
==> kubemaster: Importing base box ‘ubuntu/bionic64’…
==> kubemaster: Matching MAC address for NAT networking…
==> kubemaster: Setting the name of the VM: kubemaster
==> kubemaster: Clearing any previously set network interfaces…
==> kubemaster: Preparing network interfaces based on configuration…
kubemaster: Adapter 1: nat
kubemaster: Adapter 2: hostonly
==> kubemaster: Forwarding ports…
kubemaster: 22 (guest) => 2711 (host) (adapter 1)
kubemaster: 22 (guest) => 2222 (host) (adapter 1)
==> kubemaster: Running ‘pre-boot’ VM customizations…
==> kubemaster: 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”, “cd4c8767-99f7-4d17-9edd-5f55adf6329a”, “–type”, “headless”]

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

That’s weird,
Please go back to BIOS and if there is VT-d rather than VT-x, then enable it please.

Also, it seems you are trying to run Vagrant inside Ubuntu VM which is running inside your windows host.
This way will make nested virtualization which will not work. You should run Vagrant on your windows directly.