HyperV runs do not work without Virtualbox Installed
When running vagrant on Windows 11, there seems to be a dependency on the Virtualbox software, even if there is no intention to use VB, but instead hyper-v. If deliberate, this dependency isn't clear in the Install Instructions, or hyper-v section:
Vagrant version
Vagrant 2.2.19
Host operating system
This is the operating system that you run locally.
Windows 11 Pro - Build 22000
Guest operating system
hashicorp/bionic64
Vagrantfile
Default vagrant file from: vagrant init hashicorp/bionic64, then vagrant up --provider hyperv
Debug output
https://gist.github.com/rorychatterton/88b72883c18085d5c06271763272653d
Expected behavior
What should have happened?
Virtual Machine should come up with HyperV Provider
Actual behavior
What actually happened?
Virtual Machine fails to start, claiming VirtualBox is missing. See steps below
Steps to reproduce
Pre-Requisites
- Install Vagrant with Choco
choco install vagrant - Follow HyperV document to install windows optional feature
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All. - If exists, remove local VirtualBox instance
- Restart
Produce Error
- Start Powershell Admin Console
- Navigate to empty directory
vagrant init hashicorp/bionic64- `vagrant up --provider hyperv
PS C:\test_vagrant> vagrant up --provider hyperv
Bringing machine 'default' up with 'hyperv' provider...
Vagrant could not detect VirtualBox! Make sure VirtualBox is properly installed.
Vagrant uses the `VBoxManage` binary that ships with VirtualBox, and requires
this to be available on the PATH. If VirtualBox is installed, please find the
`VBoxManage` binary and add it to the PATH environmental variable.
Workaround:
choco install virtualboxvagrant up --provider=hyperv
Debug of working vagrant up:
==> default: Verifying Hyper-V is enabled...
==> default: Verifying Hyper-V is accessible...
==> default: Importing a Hyper-V instance
default: Creating and registering the VM...
default: Successfully imported VM
Then continues on with the regular process to configure a virtual box
References
The closes I could find is this, but the plugin in question isn't installed on my machine:
Are you sure that VirtualBox and HyperV can working well simultaneously on the host?
Are you sure that VirtualBox and HyperV can working well simultaneously on the host?
No. I do not want Virtualbox on the machine at all. I cannot get Vagrant to register a HyperV machine without it installed.
I don't believe you can run two hypervisors concurrently
Sure, they don't work on the one host.
@rorychatterton same for me on windows 11 - requires choco install virtualbox which is what i was trying to avoid
Had the same issue, but I'm on Mac OSX trying to provision a vsphere VM. A workaround for me was to just create a fake VBoxManage shell script that outputs the Vagrant Version. Something like:
#!/bin/sh
echo "6.1"
Looks like Vagrant is just trying to call the VBoxManage to verify the VirtualBox version. You might be able to create some Batch file on windows to do the same.
Hey there, looks like this is an issues with the vagrant-disksize plugin. From the provided debug log it looks like it is in fact getting loaded by Vagrant. If you uninstall the plugin Vagrant should work as expected with Hyper-V.
ref: https://github.com/sprotheroe/vagrant-disksize/issues/50