Skip to content
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

Installing choco on Windows 10 Vagrant box stops Vagrant from being able to manage the box #834

Closed
TheFrogDaddy opened this issue Jun 26, 2016 · 24 comments
Assignees
Milestone

Comments

@TheFrogDaddy
Copy link

TheFrogDaddy commented Jun 26, 2016

What You Are Seeing?

After running the choco install script on a windows 10 Vagrant box, something on the box is affected which prevents Vagrant from managing/provisioning the box (by way of pushing PowerShell scripts onto the box and running them), the box must be destroyed.

Any subsequent provisioning calls to the box (straight after or on a reboot) fail with winrm-fs errors (see below).

What is Expected?

To install choco on a vagrant box without affecting Vagrant ability to manage the box.

How Did You Get This To Happen? (Steps to Reproduce)

OS X El Capitan
Install Vagrant and VirtualBox
Download last ModernIE windows Vagrant Box from Microsoft
Bring the box up with default options
Enable WinRM
Install choco via iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')) on Vagrant box
Try and complete provisioning or just simply reload the box

Output Log

$ vagrant reload --provision
==> default: Attempting graceful shutdown of VM...
==> default: Setting the name of the VM: windows
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 80 (guest) => 8888 (host) (adapter 1)
    default: 5985 (guest) => 55985 (host) (adapter 1)
    default: 5986 (guest) => 55986 (host) (adapter 1)
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: WinRM address: 127.0.0.1:55985
    default: WinRM username: IEUser
    default: WinRM execution_time_limit: PT2H
    default: WinRM transport: negotiate
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
    default: /vagrant => /Volumes/Macintosh HD 2/VMs/Vagrant/Base/Machine
==> default: Running provisioner: chocolatey (shell)...
/opt/vagrant/embedded/gems/gems/winrm-fs-0.3.2/lib/winrm-fs/core/file_transporter.rb:378:in `parse_response': [WinRM::FS::Core::FileTransporter] Upload failed (exitcode: 0), but stderr present (WinRM::FS::Core::FileTransporterFailed)
    from /opt/vagrant/embedded/gems/gems/winrm-fs-0.3.2/lib/winrm-fs/core/file_transporter.rb:192:in `check_files'
    from /opt/vagrant/embedded/gems/gems/winrm-fs-0.3.2/lib/winrm-fs/core/file_transporter.rb:80:in `block in upload'
    from /opt/vagrant/embedded/lib/ruby/2.2.0/benchmark.rb:288:in `measure'
    from /opt/vagrant/embedded/gems/gems/winrm-fs-0.3.2/lib/winrm-fs/core/file_transporter.rb:78:in `upload'
    from /opt/vagrant/embedded/gems/gems/winrm-fs-0.3.2/lib/winrm-fs/file_manager.rb:112:in `block in upload'
    from /opt/vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/winrm_service.rb:363:in `create_executor'
    from /opt/vagrant/embedded/gems/gems/winrm-fs-0.3.2/lib/winrm-fs/file_manager.rb:110:in `upload'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/communicators/winrm/shell.rb:76:in `upload'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/communicators/winrm/communicator.rb:173:in `upload'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/provisioners/shell/provisioner.rb:114:in `block (2 levels) in provision_winrm'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/provisioners/shell/provisioner.rb:105:in `tap'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/provisioners/shell/provisioner.rb:105:in `block in provision_winrm'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/provisioners/shell/provisioner.rb:220:in `with_script_file'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/provisioners/shell/provisioner.rb:104:in `provision_winrm'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/provisioners/shell/provisioner.rb:22:in `provision'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/provision.rb:133:in `run_provisioner'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:95:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/environment.rb:473:in `hook'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/provision.rb:121:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/provision.rb:121:in `block in call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/provision.rb:103:in `each'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/provision.rb:103:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/providers/virtualbox/action/clear_forwarded_ports.rb:15:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/providers/virtualbox/action/set_name.rb:50:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/providers/virtualbox/action/clean_machine_folder.rb:17:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/providers/virtualbox/action/check_accessible.rb:18:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/box_check_outdated.rb:23:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/providers/virtualbox/action/discard_state.rb:15:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/providers/virtualbox/action/check_accessible.rb:18:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/machine.rb:225:in `action_raw'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/machine.rb:200:in `block in action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/environment.rb:561:in `lock'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/machine.rb:186:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/machine.rb:186:in `action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/commands/reload/command.rb:39:in `block in execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/plugin/v2/command.rb:235:in `block in with_target_vms'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/plugin/v2/command.rb:229:in `each'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/plugin/v2/command.rb:229:in `with_target_vms'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/commands/reload/command.rb:37:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/cli.rb:42:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/environment.rb:302:in `cli'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/bin/vagrant:174:in `<main>'
$ vagrant reload
==> default: Attempting graceful shutdown of VM...
The guest operating system of the machine could not be detected!
Vagrant requires this knowledge to perform specific tasks such
as mounting shared folders and configuring networks. Please add
the ability to detect this guest operating system to Vagrant
by creating a plugin or reporting a bug.
@ferventcoder
Copy link
Member

ModernIE boxes are available in Windows 10 flavor?

@ferventcoder
Copy link
Member

What version of Vagrant? What version of VirtualBox?

@ferventcoder
Copy link
Member

Since I've never seen this before (I use vagrant all the time in OS X), please share your Vagrantfile and provisioning scripts so I can attempt to reproduce the issue.

@TheFrogDaddy
Copy link
Author

@ferventcoder Yup, windows 10 is available. The guys over at win WinRb/winrm-fs#18 (comment) have just told me that the latest version of their plugin 0.4.3 fixes this issue so it's something on their end. Vagrant 1.8.4 ships with 0.3.2 so I'll need to look into updating it manually for now.
I'll close this issue. Thanks.

@StefanScherer
Copy link

I have the same problem, worked fine with Vagrant 1.8.1, but it seems that while provisioning chocolatey vagrant aborts. I'm using Windows Server 2016 TP5 and Windows 10 as guest VM's.

I also try to update winrm-fs...

@rgl
Copy link

rgl commented Jul 17, 2016

I'm also seeing this problem with Vagrant 1.8.4 and choco 0.9.10.3. Works fine with choco 0.9.9.12.

@ferventcoder
Copy link
Member

@StefanScherer were you still seeing this after upgrade?

@rgl what specifics can you provide?

@StefanScherer
Copy link

@ferventcoder Updating winrm-fs worked only with a hack in vageant 1.8.4 described in hashicorp/vagrant#7526 and it worked for Chocolatey installation. But then I had other issues provisioning a domain controller. So I switched back to Vagrant 1.8.1 without updating winrm-fs.
I still had an issue AFTER installing chocolatey with a provision script which I could solve by removibg the chocolatey module from $PROFILE (I just did rm $PROFILE in my install-chocolatey.ps1 script as it is the first provision script).
In a Win2012R2 Vagrant box I do not have to do this, only in newer Win10 and TP5 Vagrant boxes.
Not an optimal setup, but I am able to spin up Vagrant boxes right now.
Seems that the newer OSes want to initialize something for first use after chocolatey was installed and this progress bar is not expected by vagrant.

@ferventcoder
Copy link
Member

So one thing we'll be looking at is #833. We could also explore not installing the profile in the case of SYSTEM performing the installation and other reasons.

As far as a progress bar, I'm not sure what may be causing that.

@rgl
Copy link

rgl commented Jul 18, 2016

@ferventcoder I've placed the environment at https://github.com/rgl/choco-0.9.10.3-not-working-with-vagrant. The error that is gives is the same as the one reported on this issue. Please note that you have to install Windows 10 and all the updates (it will takes ages to install thou).

@dragon788
Copy link
Contributor

dragon788 commented Jul 18, 2016

One thing mentioned that sticks out to me is that some install may be affecting the WinRM settings and resetting them on an upgrade, WinRb/winrm-fs#18. One of the things that was done by Boxcutter in the example repository was to disable the Windows Update service until it was required in the unattend.xml because its installs can mess with other software by setting the reboot required flag and changing/resetting settings. The last step on an install/provision may need to be to "reinforce" the WinRM settings that existed prior to the choco/package upgrade.

@dragon788
Copy link
Contributor

@StefanScherer On the Win2012R2 box where you didn't have the errors, had you upgraded to PowerShell 5 at that point, or was it still on the default PowerShell 4? I'm noticing that this issue only occurs on PowerShell 5 + the newer Chocolatey, but it's happening to me on Win2012R2 as well since I upgraded to PowerShell 5.

@StefanScherer
Copy link

@dragon788 You're right. The windows_2012_r2 (from packer-windows repo) has PowerShell 4 installed.

PS C:\Users\vagrant> $PSVersionTable.PSVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
4      0      -1     -1

A provision script chocolatey.ps1 with just

iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))

works fine, the next shell provision script still works fine. Spinning up a 2016 TP5 VM crashes before the second provision script is started.

PS C:\Users\vagrant> $PSVersionTable.PSVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      14300  1000

For TP5/Win10 - PowerShell 5 VM's - I use this provision script as a workaround:

iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
rm $PROFILE

@ferventcoder ferventcoder added this to the 0.9.10.4 milestone Jul 28, 2016
@ferventcoder
Copy link
Member

So adding the profile bits is the issue, this is related to #833

@ferventcoder
Copy link
Member

Or more specifically where when SYSTEM is running, we don't automatically add the profile.

@TheFrogDaddy
Copy link
Author

TheFrogDaddy commented Jul 28, 2016

Adding rm $PROFILE worked for me @StefanScherer, thanks! Do you know will this cause more issues further along?

@StefanScherer
Copy link

AFAIK the profile only adds tab completion for the choco commands. But haven't looked into it deeper.

@ferventcoder
Copy link
Member

And refreshenv

@ferventcoder ferventcoder self-assigned this Aug 6, 2016
@ferventcoder
Copy link
Member

Alright, so this should be resolved with #833 changes.

  • Do not create profile if it doesn't already exist.
  • Do not set profile if user is SYSTEM.
  • Do not create set profile if $env:ChocolateyNoProfile exists.
  • Don't edit the profile if it is authenticode signed.

@ferventcoder ferventcoder changed the title Installing choco on a Vagrant box stops Vagrant from being able to manage the box. Installing choco on Windows 10 Vagrant box stops Vagrant from being able to manage the box. Aug 6, 2016
@ferventcoder ferventcoder changed the title Installing choco on Windows 10 Vagrant box stops Vagrant from being able to manage the box. Installing choco on Windows 10 Vagrant box stops Vagrant from being able to manage the box Aug 6, 2016
@dragon788
Copy link
Contributor

Just a note, this also affected Win2012R2 boxes, but I think basically any box with PowerShell 5 + Chocolatey was affected.

@ferventcoder
Copy link
Member

This is fixed in 0.10.0. Would someone provide a 👍 or 👎 on whether they are still running into this or a similar issue? Thanks!

@rgl
Copy link

rgl commented Aug 18, 2016

working fine at https://github.com/rgl/choco-0.9.10.3-not-working-with-vagrant :-)

also works with Windows 2012 R2.

@StefanScherer
Copy link

Works fine with a TP5 VM. Just removed my workaround StefanScherer/docker-windows-box@1bad1fc 👍

@ferventcoder
Copy link
Member

Thanks folks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants