-
Notifications
You must be signed in to change notification settings - Fork 264
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
Windows 10 -- Performance issues when uploading VMWare tools due to Windows Defender's Realtime Protection #161
Comments
I hit this problem with win2016 as well as w10x64-enterprise on MacOS (Catalina) and Fusion 11.5. With w2016 increasing the ram/cpu did not help. Inspecting during the ISO upload was happening showed Defender consuming a large amount of memory and CPU. I tried limiting defender by adding exclusion paths for the vagrant user and the entire C drive. This did not resolve the issue. I finally bit the bullet for my lab purposes and disabled the real time inspection early on, then re-enabled in the provisioning steps. Not my preferred approach as AV shouldn't cause this sort of headache. This may be a packer issue rather than boxcutter but wanted to share my fix here: `
@@ -32,6 +33,7 @@
@@ -172,6 +174,7 @@
diff --git a/eval-win2016-standard.json b/eval-win2016-standard.json
@@ -164,6 +165,7 @@
` |
100% CPU definitely smells like AV. I'm from the infosec industry and I apologize that my peers have imposed this crap on you. Is this only happening whilst installing the VMware tools? Or does it happen during the whole provisioning process? @stootles, that's very strange that adding it to the exclusion paths didn't result in this preventing windefend from hijacking the cpu. What're you doing to disable the AV? Are you explicitly stopping the service? Would you be interested in submitting a PR? |
@GeoffWilliams, I'm going to re-title this issue so that it mentions the performance problem symptom and that its likely related to Windows Defender. If you're not cool with that, let me know and I'll simply revert it (or you can re-title it). |
The file This really bothered me (I am in infosec as well) and did some digging on this as I wondered if the problem was not so much the AV but that winrm from python for file transfer appears to be an overall issue. I don't know the winrm subsystem as far as file transfers go but did hypothesize that perhaps the way the file transfers occur that each chunk is getting added to a logical file somewhere within the subsystem and the AV begins scanning the file from the start again, this could cause the AV to think it is dealing with thousands of files being uploaded. Its a theory and probably wrong. I didnt keep my work as I started tinkering with the windows-ps stream and then bumping into the packer-windoze project that is using ansible, which just happens to align to wanting to spend more time with ansible myself (and isnt a terrible solution for solving the DRY challenges of various different windows versions). |
Yeah, typically the way that people are doing file transfers are literally encoding it over the command-line, and not even keeping the file handle open.. So assuming that the AV is hooking these APIs, I'm pretty sure your theory is 100% correct. Both Python and Packer used to be doing something similar by appending to the file using '>>' or Still though, I believe during provisioning we should be properly excluding our installer directories. I think this might be happening because our provisioning scripts are using the Anyways, I just finished merging a number of older PRs that use up-to-date methodologies for provisioning the config management tools, so I'll look at optimizing/fixing the performance of these newer templates next because I think some of them are currently having problems w/ bitsadmin, forcing you to choose your wim at the beginning, or even downloading the wrong image entirely. I'll update this issue with some more facts about reproducing this particular issue and how I plan to fix them when I get there. Thanks for your guys' insights! |
Using VMWare Workstation 15, packer 1.3.1, host ubuntu 18.04 I get
Error uploading VMware Tools
. The VM can be seen grinding away at 100% CPU and the upload eventually times out:The fix for this seems to be to just add more memory and CPU. I increased to 4 CPUs and 4096MB ram and the problem went away instantly.
The text was updated successfully, but these errors were encountered: