-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vagrant 2.0.1: Vagrant Up Hyper-V Error #9256
Comments
The Vagrantfile you specified is invalid. Not sure if this is the actual Vagrantfile you are using or not. If it is exactly this then maybe you are just finding a bug in the error reporting because Vagrant can't create a box when it doesn't know what box to use. (everything in the file is commented out except the wrapper.) Here is what I see when I use that Vagrantfile on Windows 10 running as Admin with git bash: tonya@TONY-PC MINGW64 ~
$ cd Documents/Vagrant/github#9256/
tonya@TONY-PC MINGW64 ~/Documents/Vagrant/github#9256
$ vagrant up --provider=hyperv
Bringing machine 'default' up with 'hyperv' provider...
==> default: Verifying Hyper-V is enabled...
There are errors in the configuration of this machine. Please fix
the following errors and try again:
vm:
* A box must be specified.
|
I apologize. The Vagrantfile I posted had been altered for troubleshooting. I should have double-checked that it was a proper one before posting. I get the "The Hyper-V provider requires that Vagrant be run with administrative privileges." error no matter which Vagrantfile I use (I have tried several different ones). I wanted to verify that I was still having issues, even with a fresh Vagrantfile, so I performed a "vagrant init" and then a "vagrant up --provider=hyperv" and I still receive the administrative privileges error. Here is the Vagrantfile I am using:
|
Aside, I haven't found an official Ubuntu image that has a hyper-v provider. |
I tried performing a
|
I am kind of reaching here but I am wondering if somehow your vagrant process is not getting launched with elevated permissions even though you are running an Admin shell. Using your admin PowerShell, change directory into your vagrant working directory and run the following command: PS> Start-Process -Verb RunAs -FilePath vagrant.exe -ArgumentList up This should open a new window running vagrant, once vagrant completes the 'up' command the new window will close. This is just a test to see if your vagrant process is running elevated. If you get a UAC prompt then your vagrant wasn't running elevated before and this should fix it. If you don't get a UAC prompt, then vagrant is running as admin but can't figure it out for some reason. If the previous command works and Vagrant is launched, you should then be able to connect to the running VM with: PS> Start-Process -Verb RunAs -FilePath vagrant.exe -ArgumentList ssh If that works, then you can try PS> Start-Process -Verb RunAs -FilePath powershell.exe To run the console in the future. |
(Also I'm just some random dude on the Internet, I have no intimate knowledge of Vagrant or connection to Hashicorp, but am trying to help.) I haven't been able to reproduce this on my Windows 10 1709 with Hyper-V. You could also try some of the standard stuff like uninstall / reinstall Vagrant, reboot, disable-re-enable Hyper-V, etc, etc. |
Thank you for the help. Unfortunately, none of these suggestions have worked. |
I'm sorry I'm out of ideas. Hopefully someone else will chime in with suggestions. |
@ranshac2 - have you also confirmed that hyper-v is enabled on your windows host? |
Yes, Hyper-V and its components are enabled. I confirmed this issue on 2 separate machines with Hyper-V enabled and running Windows 10. I am able to create and manage VM's through Hyper-V Manager without issue. |
Maybe this has nothing to do with Vagrant. If you use the Get-VM cmdlet in PowerShell it will work in an admin shell and fail in a user shell. If this doesn't work on your machine then something must be restricting your account in a lower-level way than vagrant could deal with. Vagrant uses similar calls to create and manage the VM. Elevated: PS> Get-VM
Name State CPUUsage(%) MemoryAssigned(M) Uptime Status Vers
ion
---- ----- ----------- ----------------- ------ ------ ----
generic-ubuntu1604-hyperv Running 0 2048 1.01:20:10.0130000 Operating normally 8.0
Insight Dev Hyper-V Paused 0 12800 06:49:48.5370000 Operating normally 8.2
User: PS> get-vm
get-vm : You do not have the required permission to complete this task. Contact the administrator of the authorization
policy for the computer 'BOU-5520DEMO'.
At line:1 char:1
+ get-vm
+ ~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-VM], VirtualizationException
+ FullyQualifiedErrorId : Unspecified,Microsoft.HyperV.PowerShell.Commands.GetVM |
Hi there, It looks like this has been resolved within a previously shipped version of Vagrant so I am now closing this issue. If the original issue was not fully resolved, please reopen this issue or create a new one. Cheers! |
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. |
Vagrant version
Vagrant 2.0.1
Host operating system
Windows 10
Guest operating system
Base
Vagrantfile
Debug output
https://gist.github.com/ranshac2/eb06b72ffd564727e484dfd44ed06dbd
Expected behavior
A virtual machine should be created using Hyper-V
Actual behavior
Error stating the following:
"The provider 'hyperv' that was requested to back the machine
'default' is reporting that it isn't usable on this system.
The Hyper-V provider requires that Vagrant be run with
administrative privileges. This is a limitation of Hyper-V itself.
Hyper-V requires administrative privileges for management
commands. Please restart your console with administrative
privileges and try again."
Steps to reproduce
References
The text was updated successfully, but these errors were encountered: