---
page_title: "Shell Scripts - Provisioning"
sidebar_current: "provisioning-shell"
---
# Shell Provisioner
**Provisioner name: `"shell"`**
The shell provisioner allows you to upload and execute a script within
the guest machine.
Shell provisioning is ideal for users new to Vagrant who want to get up
and running quickly and provides a strong alternative for users who aren't
comfortable with a full configuration management system such as Chef or
Puppet.
For POSIX-like machines, the shell provisioner executes scripts with
SSH. For Windows guest machines that are configured to use WinRM, the
shell provisioner executes PowerShell and Batch scripts over WinRM.
## Options
The shell provisioner takes various options. One of `inline` or `path`
is required:
* `inline` (string) - Specifies a shell command inline to execute on the
remote machine. See the [inline scripts](#inline-scripts) section below
for more information.
* `path` (string) - Path to a shell script to upload and execute. It can be a
script relative to the project Vagrantfile or a remote script (like a [gist](http://gist.github.com)).
The remainder of the available options are optional:
* `args` (string or array) - Arguments to pass to the shell script when executing it
as a single string. These arguments must be written as if they were typed
directly on the command line, so be sure to escape characters, quote,
etc. as needed. You may also pass the arguments in using an array. In this
case, Vagrant will handle quoting for you.
* `binary` (boolean) - Vagrant automatically replaces Windows line endings with
Unix line endings. If this is true, then Vagrant will not do this. By default
this is "false". If the shell provisioner is communicating over WinRM, this
defaults to "true".
* `privileged` (boolean) - Specifies whether to execute the shell script
as a privileged user or not (`sudo`). By default this is "true". This has
no effect for Windows guests.
* `upload_path` (string) - Is the remote path where the shell script will
be uploaded to. The script is uploaded as the SSH user over SCP, so this
location must be writable to that user. By default this is
"/tmp/vagrant-shell". On Windows, this will default to
"C:\tmp\vagrant-shell".
* `keep_color` (boolean) - Vagrant automatically colors output in green and
red depending on whether the output is from stdout or stderr. If this is
true, Vagrant will not do this, allowing the native colors from the script
to be outputted.
* `powershell_args` (string) - Extra arguments to pass to `PowerShell`
if you're provisioning with PowerShell on Windows.
## Inline Scripts
Perhaps the easiest way to get started is with an inline script. An
inline script is a script that is given to Vagrant directly within
the Vagrantfile. An example is best:
```ruby
Vagrant.configure("2") do |config|
config.vm.provision "shell",
inline: "echo Hello, World"
end
```
This causes `echo Hello, World` to be run within the guest machine when
provisioners are run.
Combined with a little bit more Ruby, this makes it very easy to embed
your shell scripts directly within your Vagrantfile. Another example below:
```ruby
$script = <