Install Windows Update KB2999226 on platforms which require it, and refactored vmtool.bat to use the executable for installing the VMware tools#243
Conversation
…tion about what it's doing.
…om, it should be KB2999226...
…ally referencing the correct Windows Update name.
…ccess after the installation of the vmware tools if the return code is 3010 (ERROR_SUCCESS_REBOOT_REQUIRED).
|
Okay. So originally I blindly copied the KB article and used the first referenced update in the article to install which was KB2919355. This particular update is HUGE and after finally getting it downloaded and installing it, I discovered that it actually didn't remedy the issue. After noticing this failure, I checked my notes at the saltstack/salt#57594, which caused me to re-review the KB article and immediately recognized that I was installing the wrong update as KB2999226 is actually the correct one to install. As a result I had to update everything to reference the correct KB2999226. This update is available for pretty much all of the platforms, so I updated the Other than fixing Microsoft's crt issue, another issue that needed fixing was that when the VMware Tools are installed via It was discovered, however, that error 3010 is for "ERROR_SUCCESS_REBOOT_REQUIRED" which means that the install has in all actuality succeeded, but is incomplete until the next reboot. So in Some of the log messages in vmtools were also updated to display the detected virtualization platform, and list the paths that were being used so that distinguishing how far a particular case had gotten is now a little bit easier. Spacing was also added to all the vmtool cases in order to group related code and improve readability. |
… the program files directory based on the architecture that resulted in the x86 and x64 paths being swapped.
arizvisa
left a comment
There was a problem hiding this comment.
Okay. Reviewed it. After fixing one issue where the wrong ProgramFiles environment variable was being used for the x86 architecture. This is ready to be tested.
|
Testing with the following templates. Both the Windows 8 ones were used for development, so I'm mostly going to test the w7 ones and the w2k12 one.
|
… assigning the platform's flavor to a variable, and checking for negative error codes.
…g scripts to properly quote all set assignments.
|
So apparently errorlevels are signed and not unsigned 8-bit like I had thought all my life (maybe because this isn't command.com), but due to the integer type that's being used. This results in our errorlevel1 tests not being effective to detect all errors if something like To handle this errorlevel1 issue, we now explicitly check the errorlevel for this particular error code. We could be more robust by comparing the errorlevel variable against not "0", but we shouldn't be getting this error anyways. To clean up the incorrect urls being used for the detected platform, we instead call It also turns out that we (and me too) really need to ensure that we quote _all_ assignments with set. Not just the value of the variable, but the name _and_ the value. Both provisioning scripts ( |
… the platform flavor from using a double-find with an errorlevel check to actual token parsing using "for /f".
…rror code more robustly, and honor what the installer returns for its error code.
…t to only download isos, and to use a downgraded version for the w7 family.
|
Lol. Okay...the Win7 templates have required me to completely refactor the vmware tools installer in the This actually involved removing the whole vmware tar file that we download (which is super old anyways). Now the logic is much simpler where there's 2 iso urls. The first iso url is for the most recent version of the vmware tools (yes, we're now up-to-date with 11.1.0), and the second iso url is for the most recent version that doesn't require KB2999226 (which is 10.2.5). The original tar logic was essentially extracting files from a tarball to get an iso, then the iso was extracted to get to setup.exe. Afterwards the tools are silently installed. Now we just download the iso, extract it, and then run setup.exe so there's much less trickery. |
…ownloading from Microsoft.
…onfig.cmd to disable certificate validation.
…install, it doesn't just exit silently.
|
Omfg. Okay, finally got eval-win7x86-enterprise.json to install vmware tools properly. Let's try this again, shall we?
(edited to add the win2012r2-datacenter template) |
arizvisa
left a comment
There was a problem hiding this comment.
Re-reviewed things.
… will _never_ time out retries.
…ools via script/vmtool.bat.
…s disabled and re-enabled using the "Windows Remote Management" firewall group instead of explicitly tampering with custom rules.
|
Okay. So the previous new commits change from downloading an iso directly (it was too large because my internet sucks) to downloading the executables from packages.vmware.com directly. This is significantly faster for the install, and there's no more need to pre-install 7-zip which greatly reduces the complexity of The other thing that's being done is we spin in a loop trying to download the files so that we guarantee the file is downloaded. I got tired of my connection dropping and then having to restart the build, but so far I've been able to build the 2 youngest evaluation templates for both architectures. I also simplified the floppy/install-winrm.cmd script as on a number of templates winrm wouldn't start up reliably. The original logic of |
…emove the file prior to retrying the download.
|
Okay. One last review to double-check things...and I think I'm gonna merge. |
Install Windows Update KB2999226 on platforms which require it, and refactored vmtool.bat to use the executable directly for installing the VMware tools. Closes issue #185.
This PR adds a new provisioning script (
script/KB2999226.cmd) which installs an update which s required for Microsoft's Visual C Runtime 2015. This runtime is necessary for installing VMware Tools and also for SaltStack when their installer tries to install Python3 (as per issues saltstack/salt#56296 and saltstack/salt#57594). This modifies all of the templates by executing the script afterscript/vagrant.batand beforescript/vmtool.bat.The KB itself actually has an issue in that it can't be installed if Windows Updates are disabled or the platform is unlicensed (all of our
eval-*.jsontemplates). This is because the KB is intended to be installed withwusa.exewhich actually uses newer functionality of Windows Update to install said update. As some of our templates do not require the user to fully update them nor do they guarantee that wuauserv will be running by default, this would have conflicted with prior decisions made by the original maintainers of this project. As such, I prefer to retain this functionality as I use a fork of this project for deploying fuzzing campaigns and so being able to target specific patches on a platform are within scope. Because of this requirement on Windows Updates I had originally thought that we were fuxed when trying to figure out how to close issue #185 (which was a pretty critical issue).Nonetheless I was able to figure out a way to install KB2999226 without requiring any other updates via extracting the .cab file and installing that directly with
dism.exe. This results in byassing the requirement of usingwusa.exeand its non-existent windows update functionality when install the patch. This means that Microsoft's Visual C Runtime can be used without needing to fiddle with any update settings. This also means that we don't have to restrict the user on needing a fully updated template (nonetheless it is definitely recommended to update).This implements a workaround for issues saltstack/salt#56296, saltstack/salt#57594.
This should also hopefully close issue #185.
(edited to reference the correct KB update)