rgl / windows-vagrant

Windows 11/2022/2025 Base Vagrant Box (https://app.vagrantup.com/rgl)
MIT License
362 stars 95 forks source link

winrm and sshd services delayed-auto start #26

Open arg0d opened 2 years ago

arg0d commented 2 years ago

delayed-auto takes 3 minutes to boot the VM. This is not acceptable when booting a fresh VM for CICD integration tests. When I set auto start for both of these services, the VM boots within 30 seconds and seems to work fine.

Provision scripts for winrm and sshd mention that using auto start is "unreliable". Could you elaborate whats unreliable about it? Do you think its possible to fix the underlying issue of this unreliability?

https://github.com/rgl/windows-vagrant/blob/master/provision-winrm.ps1#L48 https://github.com/rgl/windows-vagrant/blob/master/provision-openssh.ps1#L116

rgl commented 2 years ago

For my use-case of executing ad-hoc scripts using vagrant, when using auto, the scripts were immediately executed after windows boot, but they would fail due to something in Windows not being ready. The most pragmatic way to workaround this was to use delayed-start.

arg0d commented 2 years ago

I've ran overnight pipelines using a VM with start changed from delayed-auto to auto. I've observed around 1 minute 40 seconds faster startup time for the VM. Also, for the last year, I've been observing that around 5-10% of jobs fail, because Windows VM can't be reached via SSH. Sometimes first few tests are failing, and then start passing. Other times, first few tests are passing, and after a certain point SSH stops working. While it could be an issue with my tests breaking the system and making SSH unavailable, I haven't observed this issue last night.

I'm gonna have some more data after the weekend (3 days of nightly pipelines).