Open darkn3rd opened 4 years ago
Looking into this a bit more, it looks like the issue here is with the Vagrant::Util::Platform.windows_hyperv_enabled?
check. From the logs, it appears that an error is returned, resulting in return value of that function being false. So, I was able to get around this issue by removing that if statement.
From what I can tell from the Get-WindowsOptionalFeature
:
-Online
option (ref. https://techibee.com/powershell/powershell-get-windowsoptionafeature-and-enable-windowsoptionalfeature-are-failing-solved/1795)I ran two tests below and sure enough the -Online
is required:
## FAILS
$(Get-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V-Hypervisor).State
## SUCCEEDS
$(Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Hypervisor).State
Was this indeed blocking? Because from what I can tell from the logs and from my tests, and is that the SMB was working fine (logs), but either I was unnecessarily prompted, or what I passed was ignored. I'll double-check to make sure, put puts()
debug statements.
I tested the theory as well, with a simpler Vagrantfile
and that routine is definitely not working. Is there a way to detect the current provider?
Vagrant.configure("2") do |config|
config.vm.box = "generic/centos8"
if Vagrant::Util::Platform.windows_hyperv_enabled? then
puts "hyperv detected"
else
puts "hyperv not-detected"
end
end
vagrant up --provider hyperv
vagrant status
hyperv not-detected
Current machine states:
Yes, it requires Online or Path option (For offline download location) but is it is also failing because hyperv function is looking of Get-WindowsFeature command it is only available if Server Manger is installed on that system which is always pre-installed in Windows Server but not home edition of Windows,
So check this PR for new update change 11933
Please note that the Vagrant issue tracker is in priority reserved for bug reports and enhancements. For general usage questions, please use HashiCorp Discuss: https://discuss.hashicorp.com/c/vagrant/24 Thank you!
When submitting a bug report, please provide the minimal configuration and required information necessary to reliably reproduce the issue. It should include a basic Vagrantfile that only contains settings to reproduce the described behavior.
Tip: Before submitting your issue, don't hesitate to remove the above introductory text, possible empty sections (e.g. References), and this tip.
Vagrant version
Installed Version: 2.2.9
Host operating system
Microsoft Windows [Version 10.0.18362.1082]
This is the operating system that you run locally.
Guest operating system
Ubuntu 18.04.5 LTS
Vagrantfile
hosts (used for multi-machine)
Debug output
Expected behavior
When supplying
smb_username
andsmb_password
, I expected that I would not be prompted. For 6 systems, I am prompted 6 times, so I wanted to lower the manual data entry using those keys in the 3rd param forconfig.vm.sync
.Actual behavior
The supplied
smb_username
andsmb_password
are ignored (described in https://www.vagrantup.com/docs/synced-folders/smb#options)Steps to reproduce
References