Vagrant: Hyper-V Prevents Vagrant from Running and Causes BSOD

Created on 11 Dec 2017  ยท  9Comments  ยท  Source: hashicorp/vagrant

Using Vagrant with Hyper-V enabled causes a blue screen of death (BSOD).

The only updates on the computer were to Vagrant 2.0.1, VirtualBox 5.2 from 5.1.30, and Windows 10 Pro from Windows 10 for Hyper-V in order to use Docker for Windows since we use both Vagrant and Docker in development

The only way I was able to get it to work with Vagrant was to drop down to VirtualBox 5.1.30 from 5.2.x and turning off Hyper-V which requires shutting down and restarting, but since we use Docker as well that creates a conflict since in order to use Docker for Windows it requires Hyper-V which includes shutting down and restarting.

Vagrant version

Vagrant 2.0.1

Host operating system

Windows 10 Pro

Guest operating system

ubuntu/trusty64

Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/trusty64"
end

Debug output

Provide a link to a GitHub Gist containing the complete debug output:
There is no debug statement that gets displayed it just shows the blue screen of death (BSOD) with a stop code of SYSTEM SERVICE EXCEPTION and then it restarts.

Expected behavior

Running vagrant up starts up the box ready for development when Hyper-V is enabled.

Actual behavior

What actually happened?
Using vagrant up begins starting up the box, but after running through a couple lines of setup you get the Windows BSOD.

Steps to reproduce

  1. vagrant up
core enhancement has-pr hoswindows providevirtualbox

Most helpful comment

Agreed. I'll mark this as an enhancement. We can and probably should be checking this and bailing out before running any virtualbox commands just to avoid BSOD's. This is not the first time I've seen this issue before :)

All 9 comments

So after more reading it seems that if Hyper-V is enabled the Windows host OS is already running in a VM, so Vagrant would need to support nested virtualization which Virtualbox is not designed to handle. Is using the hyperv provider the solution? https://www.vagrantup.com/docs/hyperv/. The warning at the bottom is a bit confusing. Seems to suggest by its name that it is how you can use Hyper-V with Vagrant, but at the same time that it won't work.

Hi @mtpultz - you are correct about virtualbox not supporting nested virtualization. Virtualbox and hyper-v aren't compatible together, and thus you see the BSOD :( That being said you should be able to use the hyper-v provider just fine. I think you should be ok to use docker and hyper-v at the same time. That warning was mostly around other hypervisors like vmware and virtualbox.

Thanks @briancain. Is it worth posting another issue regarding graceful failure due to Hyper-V being enabled? Docker for Windows indicates that Hyper-V is disabled and will ask if you want to turn it on, and if you cancel it shuts down gracefully. Seems like this is something that could be checked prior to running vagrant commands (or as a hook somewhere) to prevent BSOD since that's not a very friendly way to say there's an issue. I would expect this will only become more of an issue as time goes on and it would reduce the number of StackOverflow questions, forum posts, and issues being raised if the error was handled like Docker for Windows preventing BSOD, as well as providing a short description indicating no support for nested virtualization since Hyper-V means that the Windows host OS is already running in a VM, use of hyperv provider, and a URL to the provider.

Agreed. I'll mark this as an enhancement. We can and probably should be checking this and bailing out before running any virtualbox commands just to avoid BSOD's. This is not the first time I've seen this issue before :)

Can you search for "It would be awesome if Hyper-V could coexist with other hypervisor technologies like VMWare or VirtualBox" in the Windows Feedback app and upvote it?

Switching to the Hyper-V provider would work around the issue if you have the boxes you need build for Hyper-V. I worked with John Slack on a few blog posts around it https://blogs.technet.microsoft.com/virtualization/tag/vagrant/ since I've been bad at getting the word out about this.

As far as boxes go:

@briancain should this be marked provider/virtualbox?

@PatrickLang - Oops, you're right. Fixing that label now.

@PatrickLang can't find that issue to upvote in Feedback Hub on Windows, but maybe that's now what you meant by Windows Feedback app. Can you provide a bit more of a description of where the Windows Feedback is located since I also couldn't find a reference to it in the Microsoft Store. It will likely get quite a few upvotes if it was clear where it was located.

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings