-
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
Updating check for Hyper-V #9471
Conversation
Oops sorry about that. Need to read up on Ruby unit testing. I think the commit I added should fix it. My manual test on a win10 laptop with Hyper-V enabled works as expected
|
@PatrickLang - Thanks for the update! A couple of questions... Is there a better check for seeing if Hyper-V is "installed" but disabled? Also do you have an example of how to get to that state in windows 10? Every bit of documentation I see says that it's either enabled or disabled, but I see no language around it being installed but "off". I ask because this command:
Won't work for this because it returns true if you're running vagrant on Windows inside of a virtual machine. :( We will however need some sort of check to ensure that this is only checked against windows 10 (maybe windows 8 works?), because these commands fail and do not exist on older systems like windows 7. |
Edit on this: I just tried this on windows 7. We will be fine without a OS check, as the |
Here's the corner cases I can think of: Windows 7 - check should always fail. Hyper-V not present, and check for it isn't there One false positive would be: |
So yesterday I did some tests. We should be good without a "check" for which OS we're on, because if the powershell command fails, its helper function in Vagrant will just return nil so we won't have to worry about an uncaught exception for a command that doesn't exist on Windows 7. The original check will just be false, and we should be good to continue on using the virtualbox provider. Finally that being said, I'm still pretty confident that the check in place is enough to determine if Hyper-V is running...but I might be missing something. $(Get-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V-All -Online).State This returns either Thanks! |
Conflicts found, can you please fix them? Is still crashing with version |
Hi there, this check was improved via a997a27 which includes the ability to check on Windows Sever. I'm going to close this pull request now. Thanks! |
Nice work. |
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. |
This is an updated check to tell if a hypervisor (including Hyper-V) is running on Windows. Virtualbox uses this check to avoid crashing (See #9258).
This fix covers a few more corner cases than the previous one in #9456:
Get-WindowsFeature
to check for install, whileGet-WindowsOptionalFeature
is used on Windows 10 ¯\(ツ)/¯