Vagrant up - VBoxManage.exe error: VT-x is not available (VERR_VMX_NO_VMX) code E_FAIL (0x80004005) gui headless [closed] - vagrant

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
Machine: Window10 (64bit).
I downloaded the latest VirtualBox, Vagrant and initialized CentOS 6.7 64bit image/url.
The following worked successfully in Git-Bash session.
1. vagrant box add "centos67x64" "https://github.com/CommanderK5/packer-centos-template/releases/download/0.6.7/vagrant-centos-6.7.box"
2. vagrant init
3. Updated Vagrantfile (and turned vb.gui option i.e. uncommented that config section in the file).
config.vm.provider "virtualbox" do |vb|
# Display the VirtualBox GUI when booting the machine
vb.gui = true
# Customize the amount of memory on the VM:
vb.memory = "2048"
end
After that, I tried the following command but I'm getting this error message.
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'centos67x64'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: vv_default_1466548735200_80300
==> 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: Running 'pre-boot' VM customizations...
==> 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", "ae74ebaa-8f01-48cf-bdad-956c59ef1208", "--type", "gui"]
Stderr: VBoxManage.exe: error: VT-x is not available (VERR_VMX_NO_VMX)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component ConsoleWrap, interface IConsole
If I turn/comment off the whole Vagrantfile respective section, I'm still getting the following error.
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> 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: Running 'pre-boot' VM customizations...
==> 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", "ae74ebaa-8f01-48cf-bdad-956c59ef1208", "--type", "headless"]
Stderr: VBoxManage.exe: error: VT-x is not available (VERR_VMX_NO_VMX)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component ConsoleWrap, interface IConsole
Any ideas! I looked into other posts but couldn't find how to resolve in my case.
As I got some hints, I tried one of the solution.
TURN off the Hyper-V which is turned of by default I guess in Windows10.
To do this, I Went to Control panel in Windows10 and looked here and found this.
Then, I turned Hyper-V off by unchecking (the tick mark, or black box).
Windows10 told me to RESTART, I said "No" (later).
Tried running "vagrant up" again (without or without any changes or the above mentioned config.vm... changes to the Vagrantfile). It didn't work and gave me the same --headless error message.
OK, time to restart. Restarted Windows10. After the restart, I saw bunch of Virtual Box error messages popups (few of them are shown below).
Once I clicked on OK button on all of those Virtual Box popup windows, I tried to run Virtual Box on my machine, it came up fine(successfully).
Now, I opened Git-BASH and again went to the directory where Vagrantfile was present. Tried tweaking the settings on / off or commenting/uncommenting the Vagrantfile respective section (as I described above).
STILL getting the the same error messages for running "vagrant up" (even after turning the Hyper-V off as well).

Stop hyper-v service running by default in Windows 8/10, since it blocks all other calls to VT hardware.
Additional explanation here:
https://social.technet.microsoft.com/Forums/windows/en-US/118561b9-7155-46e3-a874-6a38b35c67fd/hyperv-disables-vtx-for-other-hypervisors?forum=w8itprogeneral
Also as you have mentioned, if not already enabled, turn on Intel VT virtualization in BIOS settings and restart the machine.
To turn Hypervisor off, run this from Command Prompt (Admin) (Windows+X):
bcdedit /set hypervisorlaunchtype off
and reboot your computer. To turn it back on again, run:
bcdedit /set hypervisorlaunchtype on
If you receive "The integer data is not valid as specified", try:
bcdedit /set hypervisorlaunchtype auto
-- credit Tj Kellie

I just solved this problem by disabling(uncheck) Hyper-V. Seems Hyper-V was enabled when I installed Docker
Control Panel -> Program And Features -> Turn Windows Features on or off.
You may need to reboot afterwords.
Warning: Vagrant with VirtualBox cannot work with Docker at the same time.

Although this is an old question, but I've still encounter it recently.
This is what worked for me on my i7-3770 3.40GHz, Z77 extreme motherboard running Windows 10.
In Windows, disable Hyper-V:
Open up a PowerShell or CMD session as Administrator.
Type the following command:
dism.exe /Online /Disable-Feature:Microsoft-Hyper-V-All
Windows will ask you to restart.
In the bios:
Disable >>> Intel Virtualization Technology, vt-d
Save the bios settings and allow it to restart and boot into Windows.
Shutdown the computer (I've tried just restarting and it didn't work)
Power up the computer, go into the bios and re-enable the above disabled settings.
Save, restart.
Download the Intel Utility to check.
You should now see it been supported:
If it still doesn't work, try re-enabling Hyper-V first then following the steps above.

Docker can be the culprit. I had same issue after installing docker. Docker uses Windows hyper-v driver to create containers. Hence Docker and Virtual Box may not work together!

Along with Hyper-V option, I had to uncheck "Containers" Windows feature to have my Vagrant work.

If you are getting the above error on Windows 10 Pro then you can disable the Hyper-V. Hyper-V is default enable in the Windows 10. You can either use Hyper-V or Virtual Box. So, to use the Virtual box you have to disable hyper-v in windows, you can follow following steps to do -
Search Control Panel
Click on Uninstall a program
Turn Windows features on or off
Unselect the Hyper-V option.
Click on OK
Restart the system to apply the changes.

Search for Windows Features. Turn off Hyper V.Most likely, Virtual Box is clashing with Hyper V on Windows. Also check for Hyper V running in your Services. Stop and disable that as well.

Besides turning on virtualization features of the processor and turning off Hyper-V, here's another thing, related to Windows' Virtualization-Based Security features:
https://learn.microsoft.com/en-us/windows-hardware/design/device-experiences/oem-vbs
VBS (and the associated security features) must be disabled to avoid conflicting hypervisors. Here is a solution from VMware, which also seems valid for the VirtualBox issue":
https://kb.vmware.com/s/article/2146361

If the Docker is installed and up and running at the same time, if you are trying to run Virtual Box it will not work. The underlying kernel on host machine which is present on your laptop will not allow to work both things at the same time.
Hence Docker and Virtual box can't run at the same time. for that,
To use Docker you have to enable the hyper-v which is present on this location
Control Panel -> Program And Features -> Turn Windows Features on or off.
To run Virtual box you have to disable the hyper-v from above location.

Turn Off the Hyper-V option from the windows feature list. You can find this on control panel.

The only thing that worked for me was running the installers and doing a repair for VM VirtualBox and Vagrant.

Tried all above steps but nothing was working till I enabled Virtualization Technology in BIOS. Even though Intel CPU Utility was showing Virtualization as Ticked, it really wasn't.
Had boot-up system, entered BIOS, Enabled Virtualization, Restarted and Voila! It worked after more than 4 hours of efforts.

This is what helped me:
Remove Hyper-V and install Hypervisor platform.
In the elevated Powershell prompt do:
Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All
Enable-WindowsOptionalFeature -Online -FeatureName HypervisorPlatform
Restart
Disable Windows Defender Credential Guard
"Local Group Policy Editor" → "Computer Configuration" → "Administrative Templates" → "System" → "Device Guard" → "Turn on Virtualization Based Security" → Set to "Disabled"
Delete the following registry settings:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\LSA\LsaCfgFlags
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\DeviceGuard\LsaCfgFlags
Restart
Delete the Windows Defender Credential Guard EFI variables
In the elevated command prompt do:
mountvol X: /s
copy %WINDIR%\System32\SecConfig.efi X:\EFI\Microsoft\Boot\SecConfig.efi /Y
bcdedit /create {0cb3b571-2f2e-4343-a879-d86a476d7215} /d "DebugTool" /application osloader
bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} path "\EFI\Microsoft\Boot\SecConfig.efi"
bcdedit /set {bootmgr} bootsequence {0cb3b571-2f2e-4343-a879-d86a476d7215}
bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} loadoptions DISABLE-LSA-ISO
bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} device partition=X:
mountvol X: /d
Restart
Disable virtualization-based security
Delete all registry keys under HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\DeviceGuard\* (but keep DeviceGuard itself).
Restart
See also: Disable Windows Defender Credential Guard

Related

Error system services exception vagrant up virtual box windows 10

I have virtual box Versión 5.1.30 r118389 (Qt5.6.2); vagrant 2.0.1 and laravel/homestead 5.01, when i do vagrant up show message error:
Do you have hardware virtualization (VT-x) enabled in your BIOS? You need to ensure you do NOT have Hyper-V enabled.
Outside of that you'd have to investigate that stop code to see what Windows was doing when the crash happened.

Vagrant up not startedcode E_FAIL (0x80004005)

I'm using W10 and I had a problem with Vagrant-suddenly I cannot do vagrant up. I received error:
There was an error while executing VBoxManage, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["startvm", "e11dfd77-f4e8-4125-8169-d81f7dc44e55", "--type", "headless"]
Stderr: VBoxManage.exe: error: Interface ('VirtualBox Host-Only Ethernet Adapter #3') is not a Host-Only Adapter interface (VERR_INTERNAL_ERROR)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component ConsoleWrap, interface IConsole"
used to work fine until yesterday. I had a Windows update as well yesterday, but after that update vagrant works well.
What i tried:
checked Hyper-V platform - is disabled.
reinstalled VM Box, Vagrant but nothing helped.
Any ideas?
For anyone getting this more recently where the stderr does not mention VT-x, but instead is something like this:
Stderr: VBoxManage.exe: error: Call to NEMR0InitVMPart2 failed: VERR_NEM_INIT_FAILED (VERR_NEM_VM_CREATE_FAILED)
I finally found that it was a virtualbox update that broke it for me; trying to fix NEM in Windows 11 I guess, but breaking it in Windows 10? See discussion here on virtualbox's forum.
Basically if you have W10 and upgraded VirtualBox to 6.1.28, you'll want to downgrade to 6.1.26.
I know it's an old post but this link worked for me.
Open CMD as administrator and run:
bcdedit /copy "{current}" /d "Hyper-V"
bcdedit /set "{current}" hypervisorlaunchtype off
bcdedit /set "{current}" description "non Hyper-V"
Just go to network setting in VMware and uncheck Enable Network Adapter in the adapter 3 setting.
I solved it without downdrading VirtualBox.
Instead, I used the advice here. In short, here it is:
Open the "Turn Windows features on or off" settings (type optionalfeatures in the start menu)
Untick all the followings:
Application Guard
Credential Guard
Device Guard
* Guard
Containers
Hyper-V
Virtual Machine Platform
Windows Hypervisor Platform
Windows Sandbox
Windows Subsystem for Linux (WSL)
Restart twice.
As windows updates were installed few days ago and i realize that i have an outdated version of VirtualBox, upgrading was enough for me.
VirtualBox 6.1.34 fixed the issue in my Windows 10 Enterprise

Windows 10 Vagrant is stopping at "SSH auth method: private key"

When I run vagrant up from the command line, it is a crap shoot at best as to whether vagrant will boot up or not. It stops at this line:
SSH auth method: private key
And then may or may not include this line:
Warning: Remote connection disconnect. Retrying...
As I said, sometimes it works and sometimes it does not. Why is this problem happening? For the record it would happen (less often) on my production MacBook at work.
Can I maybe change the auth method if there is no good answer for this? Trust me I have been looking and not found any answer on this yet.
whats happening is the following :
vagrant up will spin a new VM, basically it contacts virtualbox (or the specific provider) and run command to start a VM
the VM will start on the virtualbox side
note: if you run form a command line terminal in macos, you can see the title switching from 'Ruby' to 'VBoxManage'
the VM takes some time to start
because the VM does not send a specific signal when its done, vagrant will check at regular interval if the VM is fully booted and available to ssh-in
once the VM is available, vagrant can run the ssh command and complete the config (network, shared folder, etc...)
so in your case, the VM takes a bit longer to boot (this can be due to high activity on your mac, specific setup of the VM that runs on boot ...)
Basically this is harmless and is not necessarily a bad sign.
Please look at my accepted answer on this. It turns out that this was a memory allocation issue, and I only discovered it when watching the terminal for the VM provider (VirtualBox). Once I closed some programs I was (generally) able to boot up just fine.
There seems to be an incompatibility problem with Vagrant/VirtualBox & the Windows Hypervisor Platform feature in Windows 10
I had this problem and this is how I got get Vagrant & WSL2 working side by side
I have the following environment:
Hardware Virtualization enabled in BIOS
Windows 10 (Insider Program with Release Preview Channel)
-- Windows 10 with WSL 2 Version 10.0.19041 Build 19041
VirtualBox 6.1.12
-- Extension Pack Installed
Vagrant 2.2.9
These are the settings that worked for me:
Windows Hypervisor Platform: Off
Virtual Machine Platform: On
Windows Subsystem for Linux: On

Cannot start docker after installation on Windows

I am a new to Docker. After the installation of Docker Toolbox (OS: Windows 10) I run Docker Quickstart Terminal and in the console I see this:
Running pre-create checks...
Error wirh pre-create check: "Hyper-V is installed. VirtualBox won't boot a 64bits VM when Hyper-V is activated. It it's installed but deactivated, you can use --virtualbox-no-vtx-check to try anyways"
Look like something went wrong in step 'Checking if machine default exists'...
Press any key to continue...
What did I do wrong? All checking of system and install steps are taken from here.
Thank you very much for your help!
Hyper-V and VirtualBox are conflicting each other.
You can either uninstall Hyper-V or run
docker-machine create -d virtualbox --virtualbox-no-vtx-check test
Source
Docker supports Hyper-V as the driver
You need to perform the following steps:
Create a virtual switch, refer to this article on how to do that
Create a docker machine using that network switch and hyper-V driver.
docker-machine create -d hyperv --hyperv-virtual-switch "name of the virtual switch created above" default
I got the same error when I installed Docker Toolbox on my Windows 10 machine.
Solution:
Install Docker Community Edition (not Docker Toolbox)
Enable Hyper-V
Open Control Panel -> System and Security -> Programs (left panel) -> Turn Windows features on or off -> Check the Hyper-V box
As of 2017's Win 10, if you don't have Hyper-V option, then your Windows OS is not Enterprise Edition. Also, Docker seems to work a lot better on Intel processors (not AMD).
Add C:\Program Files\Docker\Docker\resources\bin to Path in Environmental Variables.
Open Git Bash and type docker-compose up and now that command should work.
If you don't have GitBash, please download it.
I was having the same issue, and this blog post solved it. The author runs you through the steps of adding the --virtualbox-no-vtx-check flag to the docker shell script.
Virtualbox and Hyper-V don't play well together. I am NOT the author.
I set the Hyper-V off using windows feature on off and it worked for me.
See if when you run:
docker-machine create -d hyperv --hyperv-virtual-switch "Virtual Switch" default
you get Error with: pre-create check: "Hyper-V PowerShell Module is not available"
If so just enable in Docker(icon on your desktop)->settings->expose daemon on TCP ...
You need to disable Hypervisor to check new application that use VT-x before the virtual machine launch:
Open the command prompt as Administrator
Run bcdedit to check hypervisor status:
Check hypervisor launch type.
If is set to auto then disable it:
bcdedit /set hypervisorlaunchtype off
Reboot host machine and launch VirtualBox again
After performing above steps I opened again Docker Quickstart terminal and it is working fine.
I pressed the Windows Button on keyboard. Typed 'Hyper-V Manager'. It opened the 'Hyper-V Manager'. Then I right clicked on my machine name. There was an option to 'stop'. I selected this option. It stopped the 'Hyper-V' on my machine and then Kitematic worked fine, i.e., it download the hello-world-nginx and displayed the web page.
NOTE: This is strange and I am not sure why. Once I have done above steps, now when I restarted the Hyper-V using Hyper-V Manager, Kitematic is still working and downloading images. Can anybody comment why it is now still working when Hyper-V is also running ? Thank you.
Good
Ali Ahsan
The solution as suggested by #Gene is correct and works perfectly if:
One has windows pro edition
Both Hyper-V Management Tools and Hyper-V Platform are enabled
Sometime this isn't always the case; here is what to do:
Check Windows Edition:
To check which version right click on Windows key and select System.
Scroll down to Windows specifications and look at [Edition]
Check Hyper-V Platform (virtualisation)
For Hyper-V Platform to be enabled one must turn on virtualisation; normally this is done via the BIOS.
On HP laptop one this is done from the BIOS.
On start-up click Ctrl+F10
Press the right arrow key to System Configuration tab.
Select Virtualization Technology and then press the Enter key.
Select Enabled and press the Enter key.
Once these steps are done then:
Search for Turn Windows features on or off.
Scroll down to Hyper-V
Tick this box (Ensure you see a tick NOT a black box which indicates some features not enabled)
Upon restart docker should be running... good luck !!

Virtualbox throwing errors on Windows 10 TP on vagrant up

The VM I was trying to run was running perfectly on a Windows 7 machine.
I had upgraded to Windows 10 and tried out the same machine (with all the same configs and vagrant boxes), uninstalled and reinstalled virtualbox several times, but it still doesn't work.
Tried making a brand new VM - that didn't work too.
Here's the error
Some people who had similar 'hostonly' errors have suggested to restart the VirtualBox service from terminal, but I don't know the Windows equivalent of that command.
Anybody had this error before? How do I solve this?
A test build is available at https://www.virtualbox.org/download/testcase/VirtualBox-5.0.1-101902-Win.exe . This should fix the host-only interface creation problem by introducing a 5-second timeout when querying the registry key. We would appreciate feedback (i.e. does it fix the host-only interface creation errors or not, is the timeout long enough).
https://www.virtualbox.org/download/testcase/VirtualBox-5.0.1-101902-Win.exe
See https://www.virtualbox.org/ticket/14040#trac-change-55
Uninstalling the current VirtualBox and installing the testbuild worked for me
I have the same error and it seems to be a problem with changed network security in Windows and still no updated for it in Virtualbox.
Not pretty but a working solution (tested under Win10 build10130). This is what I did to get homestead up and working
Uninstall Vagrant and VirtualBox (restart if necessary)
Install notepad+ or other notepad replacement that handles linux line-endings
Download Vagrant v1.7.2, VirtualBox 5.0RC1, VirtualBox v4.3.6
Enable built-in administrator account.
net user administrator /active:yes
switch to Administrator account
Install Vagrant v1.7.2 (restart if necessary, log back into Administrator)
Install VirtualBox v5.0RC1
Install VirtualBox v4.3.6
Update VBox Host-Only adaptor driver (device manager,Search Automatically)
Edit VagrantFile file (where ever you vagrant up from) and change all ~/ to C:/Users/username/
Edit Homestead.yaml (Where ever you had it, likely C:\Users\username\.homestead) and change all ~/ to C:/Users/username/
Open VirtualBox
Run vagrant up
switch back to your usual user (do not sign out of Adminstrator)
hey presto, you have a working homestead
Each time after to manage vagrant (start, halt, whatever) switch to Administrator, manage, and switch back to your usual user. Do not sign out of the Administrator account when switching if you have a box up

Resources