Open pauby opened 2 years ago
Hi,
I'm sorry we weren't able to respond sooner. Were you able to resolve your hostname error?
Thanks, Kait
@kaitlincart This is a bug that remains in Vagrant.
im running into this as well with latest version of vagrant, macos, and virtualbox. I'm testing with test-kitchen and boxes I created like stomweld/windows-11 in the vagrant app store. If I add vm.hostname to the test-0kitchen generated Vagrant file then winrm works.
Vagrant version
2.2.19
Host operating system
Windows 10 Pro 2004 build 19041.1415
Guest operating system
Windows Server 2019 (but occurs with Windows Server 2016)
Vagrantfile
Debug output
https://gist.github.com/pauby/3c77bb7c9e40f014e44d72d403ed3782
Expected behavior
The PowerShell code
write-host "hello world!"'
runs as it should withprivileged: true
regardless of thevm.hostname
being present or not.Actual behavior
When the
vm.hostname
is specified in the Vagrantfile, andprivileged: true
orprivileged: false
is specified when running the PowerShell codewrite-host "hello world!"'
, it runs normally with no errors.When the
vm.hostname
is NOT specified in the Vagrantfile, andprivileged: false
is specified when running the PowerShell codewrite-host "hello world!"'
, it runs normally with no errors.When the
vm.hostname
is NOT specified in the Vagrantfile, andprivileged: true
is specified when running the PowerShell codewrite-host "hello world!"'
does not run and instead this error:This can also been seen starting on line 3558 of the debug output
Steps to reproduce
vagrant up
Notes
vm.box_version
as if you are going to use Virtualbox to reproduce it (as I believe this isn't a Hyper-V issue) I want to make sure we are both using the same box version. The version provided is the latest box version available for Hyper-V.cfg.vm.hostname
line in the Vagrantfile.