-
Notifications
You must be signed in to change notification settings - Fork 83
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
Install .NET framework via powershell through shell provider not working #181
Comments
You need to use a scheduled task to elevate to true admin privileges. The Chef provisioners in vagrant-windows do this automatically for you, the others do not. |
@sneal I've gone over this with @ferventcoder and it actually appears to work on some baseboxes but not others... (same exact powershell script and Vagrantfile) so it appears to possibly be more of locking down the exact steps for configuring a winrm basebox properly. @ferventcoder's basebox includes ssh so the thought is maybe the script is working on his because its using ssh vs winrm? Trying to properly diagnose this for consistent basebox builds. |
Using SSH is going to behave completely differently than WinRM - security, environment, and limitations. For non-trivial software installs SSH is even more problematic than WinRM. If you want installers to behave like they do when running locally on the box the most reliable and consistent way is to use a scheduled task - regardless of transport. |
ok but since it works on some base boxes and doesn't on others there has to |
I use Packer to build my base boxes. The Autounattend.xml here does something very similar to what your base_setup.ps1 script does. I haven't seen a consistent way to install all Windows software over SSH or WinRM without the scheduled task trickery. If you figure out a better way that would be awesome. |
I also shut off UAC. Perhaps that's the difference? |
It appears you are installing .net framework 4.0. The next version of choco will install it automatically. It should be out soon. Be aware that it will assert privileges if UAC is turned on. So it's likely to fail in an automated fashion unless you have UAC turned off. _sigh_ - UAC was built to be secure but there is no sudo, so it's somewhat useless for those who would script installation. |
@ferventcoder the base_setup.ps1 disables UAC along with complex passwords and a bunch of other things https://github.com/cdenneen/vagrant-windows-build/blob/master/base_setup.ps1 |
Dumb question from me, is there a reboot after UAC is disabled? |
bottom of the ps1 it restarts the computer... then i create basebox... |
@cdenneen I just starred that. I need some of those items to packerize my boxes :) |
@ferventcoder well maybe looking at that you can see something I missed to make my basebox like yours (that works with .NET ps1 install?)... I do a base install of windows, run that script (actually going to modify that to do the administrator -> vagrant user rename and password) and create box. |
I don't yet see what could cause it unfortunately. |
Vagrant 1.5.2
Vagrant-Windows 1.6.0
Virtualbox 4.3.10
I've published my configuration and steps used to build basebox:
https://github.com/cdenneen/vagrant-windows-build/
Does anyone know if there is a debug for shell provision or for winrm that would help debug?
setup_requirements.cmd runs but .NET doesn't install properly but if I run the same cmd via GUI it works just fine.
I believe I've followed all the WinRb/vagrant-windows setup requirements for Vagrantfile and Basebox steps but still no luck.
Please let me know what other detail I can provide.
The text was updated successfully, but these errors were encountered: