A new platform for documentation and tutorials is launching soon.
We are migrating Vagrant documentation into HashiCorp Developer, our new developer experience.
The WinSSH communicator is built specifically for the Windows native port of OpenSSH. It does not rely on a POSIX-like environment which removes the requirement of extra software installation (like cygwin) for proper functionality.
For more information, see the Win32-OpenSSH project page.
The WinSSH communicator uses the same connection configuration options as the SSH communicator. These settings provide the information for the communicator to establish a connection to the VM.
The configuration options below are specific to the WinSSH communicator.
config.winssh.forward_agent(boolean) - If
true, agent forwarding over SSH connections is enabled. Defaults to false.
config.winssh.forward_env(array of strings) - An array of host environment variables to forward to the guest. If you are familiar with OpenSSH, this corresponds to the
config.winssh.forward_env = ["CUSTOM_VAR"]
config.winssh.proxy_command(string) - A command-line command to execute that receives the data to send to SSH on stdin. This can be used to proxy the SSH connection.
%hin the command is replaced with the host and
%pis replaced with the port.
config.winssh.keep_alive(boolean) - If
true, this setting SSH will send keep-alive packets every 5 seconds by default to keep connections alive.
config.winssh.shell(string) - The shell to use when executing SSH commands from Vagrant. By default this is
powershell. Valid values are
"powershell". When the WinSSH provider is enabled, this shell will only be used internally. When running
vagrant sshyou will be provided the shell configured by the guest.
config.winssh.export_command_template(string) - The template used to generate exported environment variables in the active session. This can be useful when using a Bourne incompatible shell like C shell. The template supports two variables which are replaced with the desired environment variable key and environment variable value:
%ENV_VALUE%. The default template for a
cmdconfigured shell is:
config.winssh.export_command_template = 'set %ENV_KEY%="%ENV_VALUE%"'
The default template for a
powershellconfigured shell is:
config.winssh.export_command_template = '$env:%ENV_KEY%="%ENV_VALUE%"'
config.winssh.sudo_command(string) - The command to use when executing a command with
sudo. This defaults to
%c(assumes vagrant user is an administrator and needs no escalation). The
%cwill be replaced by the command that is being executed.
config.winssh.upload_directory(string) - The upload directory used on the guest to store scripts for execute. This is set to