title: Running Chef recipes using Vagrant on Windows host: issue with SSH
body: <p>I use Vagrant to create a CentOS VM on Windows host and connect to it, so far so good.</p>
  
  <p>Next I want to use Chef to provision stacks on VM that was created. I tried with local directory cookbooks as well as providing urls to recipes, but that probably fails because it can't ssh to guest box, as seen from error:</p>
  
  <p><code>
  SSH authentication failed! This is typically caused by the public/private
  keypair for the SSH user not being properly set on the guest VM. Please
  verify that the guest VM is setup with the proper public key, and that
  the private key path for Vagrant is setup properly as well.
  </code></p>
  
  <p>So my first question is:</p>
  
  <p>1) How do I make sure SSH works within same window that brought up guest OS in Windows Host so that all scripts execute well?</p>
  
  <p>Now when I comment below line in vagrantfile </p>
  
  <pre><code>config.ssh.username = "root"
  </code></pre>
  
  <p>Above error goes away, but I get another error:</p>
  
  <p><code>
  The following SSH command responded with a non-zero exit status.
  Vagrant assumes that this means the command failed!</p>
  
  <p>mount -t vboxsf -o uid=<code>id -u vagrant</code>,gid=<code>id -g vagrant</code> v-csr-2 /tmp/vagrant-chef-1/chef-solo-2/roles
  </code></p>
  
  <p>Which is because the user vagrant does not have enough access on box, which is my second question:</p>
  
  <p>2) How do instruct Vagrant to run all commands with sudo or su access?</p>