Vagrant Error on Windows 10 with Hyper-V

Vagrant Error on Windows 10 with Hyper-V

vagrant hyper-v example
vagrant hyper-v boxes
vagrant documentation
vagrant virtualbox
vagrant tutorial
install vagrant on mac
vagrant hyper-v shared folder
vagrant up not working windows 10

After upgrading to windows 10 then running:

$ vagrant up

We get the following error message

An error occurred while executing a PowerShell script. This error
is shown below. Please read the error message and see if this is
a configuration error with your system. If it is not, then please
report a bug.

Script: get_vm_status.ps1
Error:

C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.7.4\plugins\providers\hyperv\scripts\get_vm_status.ps1 : Unable to
find type [Microsoft.HyperV.PowerShell.VirtualizationOperationFailedException].
At line:1 char:1
+ &('C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.7.4\plugins\prov ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Microsoft.Hyper...FailedException:TypeName) [get_vm_status.ps1], Ru
   ntimeException
    + FullyQualifiedErrorId : TypeNotFound,get_vm_status.ps1

With Vagrant 1.7.4.

Any ideas?


I had the same problem on a fresh install of Vagrant 1.7.4 on Windows 10 Enteprise (first time using Vagrant).

It looks like the type VirtualizationOperationFailedException has been replaced with VirtualizationException in the latest version of PowerShell.

I changed line 15 of C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.7.4\plugins\providers\hyperv\scripts\get_vm_status.ps1 from:

} catch [Microsoft.HyperV.PowerShell.VirtualizationOperationFailedException] {

to

} catch [Microsoft.HyperV.PowerShell.VirtualizationException] {

Now I'm able to use vagrant up and vagrant status without errors. This is obviously not a long term solution but got things working again. There may be other scripts that are broken as well but I haven't run in to them yet.

Can't `vagrant up` a Hyper-v windows 10 box built with packer due , Vagrant version 2.1.4 Host operating system Windows 10 Enterprise 14393 Guest operating system Windows 10 Pro N Build 17134 (occurs  I haven't installed any updates for vagrant, hyper-v, Windows, WMF/PowerShell, etc. I haven't even rebooted since the last time I successfully used vagrant; I was even using the same command prompt. So weird. – briantist Nov 7 '15 at 23:31


I had the same error after destroying then recreating a VM.

I removed the .vagrant/machines/hyperv folder and all went ok.

Enable Hyper-V and Install Vagrant on Windows 10 , Launch it when it comes up. Click on Programs. Click on “Turn Windows features on or off”  Introduction Step 1: Enable Hyper-V and SMB. Follow the steps below to enable Hyper-V and SMB on your Windows machine. Hit Windows Step 2: Install Executable File. Navigate to the folder you downloaded your Vagrant executable file and double-click on Step 3: Follow the Installation Steps. That


If a solution by @jeff-r doesn't work for you, you can try changing:

} catch [Microsoft.HyperV.PowerShell.VirtualizationOperationFailedException] {

to:

} catch [Exception] {

Be careful, it may also cause some side-effects.

Hyper-V Provider, Vagrant comes with support out of the box for Hyper-V, a native hypervisor written by Microsoft. Hyper-V is available by default for almost all Windows 8.1 and  Vagrant up on Windows 10 with Hyper-V. Posted on Jul 27, 2016 Updated on Mar 31, 2017. Warning: This is essentially a brain dump, so it is more like a set of notes than a tutorial as such.


on win 10 you must disable "Hyper-V" to run vagrant/virtualbox

Vagrant up on Windows 10 with Hyper-V « FollowKMan, A few examples of these are Windows Server 2016, Windows 10 and also the Hyper-V virtualisation platform. In particular there are a few recent  My pain is your gain -- here are my tips and tricks for getting started with Vagrant on Windows 10 and Hyper-V. NOTE: This is a supplement for Vagrant's " Getting Started " guide, not a replacement. Tip 0: Install Hyper-V For those new to Hyper-V, make sure you've got Hyper-V running on your machine.


Vagrant Error on Windows 10 with Hyper-V, I had the same problem on a fresh install of Vagrant 1.7.4 on Windows 10 Enteprise (first time using Vagrant). It looks like the type  Even though Vagrant improved the error reporting in this scenario with v2.2.1, the message is still too generic for most people to realize the actual problem, which is that the box's Hyper-V configuration version is too new for their Windows build, which is what determines the Hyper-V supported configuration version.


Vagrant and Hyper-V -- Tips and Tricks, Learning to Use Vagrant on Windows 10 Vagrant doesn't know how to set up networking on Hyper-V right now (unlike other providers), so it's  Ultimately, the problem was that Homestead >= 6.4.0 is made on Windows 10 Build 1809, and thus requires Hyper-V configuration >= 9.0. While I wish the error message was more explicit about that, it's probably not within Vagrant's purview to be that specific as to the underlying reason. I'm just happy that the error is no longer an empty string.


Vagrant and Hyper-V -- Tips and Tricks, Vagrant doesn't know how to set up networking on Hyper-V right now (unlike There are a few NAT networks already created on Windows 10  » Hyper-V. Vagrant comes with support out of the box for Hyper-V, a native hypervisor written by Microsoft. Hyper-V is available by default for almost all Windows 8.1 and later installs. The Hyper-V provider is compatible with Windows 8.1 and later only. Prior versions of Hyper-V do not include the necessary APIs for Vagrant to work.