Commit Graph

169 Commits

Author SHA1 Message Date
Seng Lin Shee 774940521e Ignore Powershell progress updates on stderr
Starting with PowerShell 5, the progress bar can be observed via the
Write-Progress cmdlet. From WinRM, this appears as a stderr output.
Vagrant assumes that there is error if output appears on stderr.

This terminates various scripts which previously executed successfully
in Vagrant (prior to Windows 10).

This fix injects a variable assignment at various points of the script
execution process to disable display of the progress bar.
2015-11-18 13:52:25 -08:00
Mitchell Hashimoto d3bcc4e5f9 Merge pull request #6213 from jrob/winrm-execution-timeout
Winrm execution timeout
2015-11-18 13:00:59 -08:00
Mitchell Hashimoto 10c53dfb4b update CHANGELOG 2015-11-18 12:54:42 -08:00
Mitchell Hashimoto 34dc9e237e Merge pull request #6195 from ArloL/fix-windows-xp-shell-provisioning
Check if Schedule.Service com object is available
2015-11-18 12:52:24 -08:00
Mitchell Hashimoto dde21bc95a fix file permissions 2015-11-18 12:48:41 -08:00
Mitchell Hashimoto 37940e7350 Merge pull request #6185 from marc-ta/elevated_interactive
Elevated interactive
2015-11-18 12:46:39 -08:00
Mitchell Hashimoto 8bbf6f56f4 Merge pull request #4400 from mwrock/ps-cmd
Add a ps command to vagrant that drops the user into a remote powershell shell
2015-11-18 10:41:36 -08:00
Dan Dunckel aec65b5d66 Fix user to username that was lost in merge conflict resolution 2015-10-15 12:41:08 -07:00
Dan Dunckel d859a3b752 Somehow I missed this param while resolving conflicts 2015-10-15 12:36:19 -07:00
Marc Siegfriedt 8e87990599 add the option to make elevated interactive scripts 2015-10-15 12:25:50 -07:00
Paul Hinze 1e84cc4d6a communicators/winrm: respect boot_timeout when fetching winrm_info
We gained a ton of improvemnts to WinRM error handling in
https://github.com/mitchellh/vagrant/pull/4943, but we also got one bug.

The new code raises an exception when `winrm_info` does not return right
away. This was preventing us from catching the retry/timout logic that's
meant to wait until boot_timeout for the WinRM communicator to be ready.

This restores the proper behavior by rescuing the WinRMNotReady
exception and continuing to retry until the surrounding timeout fires.
2015-09-02 16:36:23 -05:00
Jeremy Roberts c844a9c4fd Adding WinRM execution_time_limit to log. 2015-08-31 11:42:35 -04:00
Jeremy Roberts 18d229ca82 Added execution_time_limit for WinRM.
Adds a configurable value for WinRm and the elevated permission shell ExecutionTimeLimit.

Please see mitchellh/vagrant#5506

Ex: config.winrm.execution_time_limit = "P1D"
2015-08-31 11:42:25 -04:00
Arlo Louis O'Keeffe af0f267b50 Check if Schedule.Service com object is available 2015-08-26 00:15:03 +02:00
Bob f12f50c552 Raise Errno::ETIMEDOUT as "acceptable" Errors::ConnectionTimeout 2015-07-15 19:41:10 +02:00
Mitchell Hashimoto c1508cd893 kernel/v2: customizable sudo_command [GH-5573] 2015-07-09 09:30:47 -06:00
Mitchell Hashimoto dd69de1073 communicators/ssh: only try auth methods that are valid 2015-07-07 16:06:03 -06:00
Shawn Neal 1152b4e1df Fix issue 5790
Leaving around plaintext username and passwords in a script on a box isn't the best from a security standpoint. This change ensures the scheduled task wrapper script for WinRM doesn't leave these around on the box, and instead passes them to the script as arguments.
2015-06-10 16:04:46 -07:00
Matt Wrock 1cd1033093 fixes from @sethvargo comments. 2015-06-05 05:07:12 -07:00
Aaron Quint 2f81669394 Move shell_cmd to a method in SSH::Communicator
This allows shell_cmd to be overridable by plugins/patches without
having to override the entire (large) shell_execute method
2015-04-13 13:45:17 -04:00
Paul Hinze 291db96510 communicators/winrm: don't stop task on idle end
StopOnIdleEnd was set in the task definition for elevated/privileged
windows guest scripts. This setting:

> specifies that the task stops when the idle condition ceases to be true [1]

The "idle condition" is something that Windows periodically checks for,
and it's defined by a bunch of criteria like user presence/absence, CPU
/ IO idle time, etc. [2]

Telling our provisioner to stop the task if the "idle condition" ceases
to be true is a recipe for some sporadically stopped tasks, which seems
like precisely the behavior being reported in #5362.

I'm pretty sure this fixes #5362

[1] https://msdn.microsoft.com/en-us/library/cc248332.aspx
[2] https://msdn.microsoft.com/en-us/library/windows/desktop/aa383561%28v=vs.85%29.aspx
2015-03-12 15:25:40 -05:00
Max Lincoln 39882957ee Add retry_delay setting to speed up test 2015-01-28 13:41:07 -05:00
Max Lincoln 5d5e13bc0f Change authorization error tests to match WinRM 1.3 2015-01-28 13:41:07 -05:00
Max Lincoln c37c12526a Merge branch 'master' of github.com:mitchellh/vagrant into winrm_error_handling
Conflicts:
	vagrant.gemspec
2015-01-28 10:44:47 -05:00
Max Lincoln 29845e926c Merge branch 'master' into winrm_error_handling 2015-01-20 16:16:48 -05:00
Max Lincoln edc867986b Merge branch 'master' into winrm_error_handling 2015-01-20 16:07:00 -05:00
Shawn Neal 31163da0d5 Use winrm-fs for file uploads
Replace the Vagrant native winrm file upload functionality with the winrm-fs gem.
2015-01-20 11:45:57 -08:00
Vít Ondruch 7d3b5352da Remove unneeded executable permissions. 2015-01-20 11:53:30 +01:00
Mitchell Hashimoto 79873cdb44 communicators/winrm: detect parse errors in powershell and error
/cc @sneal - Any better way to do this?
2015-01-05 16:53:17 -08:00
Seth Vargo d2874064f4 Use .key? instead of .has_key? 2015-01-05 18:29:01 -05:00
Shawn Neal c4422d7c70 Fix guest autodetection when running windows guests so Vagrant doesn't think the guest is Ubuntu 2014-12-16 08:20:01 -08:00
Max Lincoln e7e50d39d9 Fix tests - all pass but auth retry test is extremely slow 2014-12-11 13:23:40 -05:00
Max Lincoln 24de8a1fb7 Just use ready? 2014-12-11 13:22:39 -05:00
Max Lincoln ba7b964b1e Better error handling for WinRM (using winrm v1.3.0.dev.2) 2014-12-11 13:22:39 -05:00
Max Lincoln 24f919c4d3 Fix accessors used by in communicator.rb 2014-12-11 13:22:39 -05:00
Max Lincoln 2caaf82ae0 Change default transport back to :plaintext, for backwards compatibility 2014-12-11 13:21:58 -05:00
Max Lincoln 02f4adc895 Fix broken variable references 2014-12-11 13:21:58 -05:00
Max Lincoln 072bb26a30 Change @ssl to @transport 2014-12-11 13:21:58 -05:00
Max Lincoln b3480049ad DRY the Shell: Don't duplicate the Config, especially since there were differing default values 2014-12-11 13:21:58 -05:00
Max Lincoln 1beb221bf3 Rename no_ssl_peer_verification to ssl_peer_verification, and make it configurable 2014-12-11 13:21:58 -05:00
Peter Ericson 243cc5dc37 config.rb: set default port based on @ssl 2014-12-11 13:20:22 -05:00
Peter Ericson 52d8fddf38 shell.rb: fix precedence 2014-12-11 13:20:22 -05:00
Peter Ericson 4455d2401b Add ssl option to winrm config.rb 2014-12-11 13:19:09 -05:00
Peter Ericson a99d32f60a Add WinRM over SSL support 2014-12-11 13:19:09 -05:00
Mitchell Hashimoto 94b2a8a56b communicators/ssh: insert random key, remove insecure key 2014-10-24 09:58:18 -07:00
Mitchell Hashimoto 381f1332c8 Merge pull request #4670 from gildegoma/dry-check-ssh-perms
Check SSH key permissions in machine.ssh_info
2014-10-23 09:14:31 -07:00
Mitchell Hashimoto 15f16181f5 communicators/ssh: clear out some comments 2014-10-23 09:06:28 -07:00
Konstantin Tretyakov c332287665 Addresses issue #2163
In the situation where the SSH key has invalid permissions/owner, the reconnect-loop keeps failing repeatedly yet stays silent about the reasons. A message must be reported from the default exception handler (added). In addition, the situations where the SSH key owner or permissions are wrong must lead to a proper failure (added). Ideally, though, the owner/permissions check must happen before launching the VM, hence this is not a perfect fix.
2014-10-23 15:11:10 +03:00
Mitchell Hashimoto 5ebd10c19c communicators/ssh: timeout on connection check 2014-10-21 17:00:05 -07:00
Gilles Cornu 4e81be879c Check SSH key permissions in machine.ssh_info
With this change, any caller of machine.ssh_info is assured that best
efforts will be done to fix possible wrong permissions on the private
key files.

Fix #4652
2014-10-20 17:33:06 +02:00