title: SSH auth method: private key calling login in VirtualBox
body: <p>I'm having issues with vagrant on Windows. Running <code>vagrant up</code>, it halts on SSH auth and seems to be requesting SSH login credentials in the VirtualBox console. </p>
  
  <p>Windows 8.1 console output</p>
  
  <pre><code>C:\Users\leke\dev\Learning PHP 7&gt;vagrant up
  Bringing machine 'default' up with 'virtualbox' provider...
  ==&gt; default: Checking if box 'ubuntu/trusty32' is up to date...
  ==&gt; default: Clearing any previously set network interfaces...
  ==&gt; default: Preparing network interfaces based on configuration...
      default: Adapter 1: nat
  ==&gt; default: Forwarding ports...
      default: 80 (guest) =&gt; 8080 (host) (adapter 1)
  ==&gt; default: Booting VM...
  ==&gt; default: Waiting for machine to boot. This may take a few minutes...
      default: SSH address: 127.0.0.1:22
      default: SSH username: vagrant
      default: SSH auth method: private key
  </code></pre>
  
  <p>Oracle VM VirtualBox output</p>
  
  <pre><code>Ubuntu 14.04.5 LTS vagrant-ubuntu-trusty-32 tty1 
  vagrant-ubuntu-trusty-32 login: 
  </code></pre>
  
  <p>If I'm using private key authentication, I shouldn't need to enter credentials though (which I don't know). </p>
  
  <p>Here is my set-up which is taken from the book Learning PHP 7</p>
  
  <p>vagrant file</p>
  
  <pre><code>VAGRANTFILE_API_VERSION = "2"
  
  Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
    config.vm.box = "ubuntu/trusty32"
    config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1", id: 'ssh'
    config.vm.provision "shell", path: "provisioner.sh"
  end
  </code></pre>
  
  <p>provisioner.sh</p>
  
  <pre><code>#!/bin/bash
  
  sudo apt-get install python-software-properties -y
  sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php -y
  sudo apt-get update
  sudo apt-get install php7.0 php7.0-fpm php7.0-mysql -y
  sudo apt-get --purge autoremove -y
  sudo service php7.0-fpm restart
  
  sudo debconf-set-selections &lt;&lt;&lt; 'mysql-server mysql-server/root_password password root'
  sudo debconf-set-selections &lt;&lt;&lt; 'mysql-server mysql-server/root_password_again password root'
  sudo apt-get -y install mysql-server mysql-client
  sudo service mysql start
  
  sudo apt-get install nginx -y
  sudo cat &gt; /etc/nginx/sites-available/default &lt;&lt;- EOM
  server {
      listen 80 default_server;
      listen [::]:80 default_server ipv6only=on;
  
      root /vagrant;
      index index.php index.html index.htm;
  
      server_name server_domain_or_IP;
  
      location / {
          try_files \$uri \$uri/ /index.php?\$query_string;
      }
  
      location ~ \.php\$ {
          try_files \$uri /index.php =404;
          fastcgi_split_path_info ^(.+\.php)(/.+)\$;
          fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
          fastcgi_index index.php;
          fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
          include fastcgi_params;
      }
  }
  EOM
  sudo service nginx restart
  </code></pre>
  
  <p>After which I get a timeout error message. What do I need to do to get the <code>vagrant up</code> command to pass authentication with private keys and hopefully execute correctly? Note, git has been installed and ssh.exe exists in the Windows path variable. Thanks. </p>
  
  <p><strong>Edit:</strong> I managed to find the credentials were <code>vagrant</code> and <code>vagrant</code>, but after logging into the VM box terminal, the windows console is still stuck in the same place. </p>
  
  <p><strong>Update</strong></p>
  
  <p>Adding </p>
  
  <pre><code>config.vm.provider 'virtualbox' do |vb|
      vb.customize ['modifyvm', :id, '--cableconnected1', 'on']
  end
  </code></pre>
  
  <p>gives me another problem. When I change the port it either gives me this message again, or gives me the original problem. </p>
  
  <pre><code>C:\Users\leke\dev\Learning PHP 7&gt;vagrant up
  Bringing machine 'default' up with 'virtualbox' provider...
  ==&gt; default: Importing base box 'ubuntu/trusty32'...
  ==&gt; default: Matching MAC address for NAT networking...
  ==&gt; default: Checking if box 'ubuntu/trusty32' is up to date...
  ==&gt; default: A newer version of the box 'ubuntu/trusty32' is available! You currently
  ==&gt; default: have version '20170502.0.0'. The latest is version '20170504.0.0'. Run
  ==&gt; default: `vagrant box update` to update.
  ==&gt; default: Setting the name of the VM: LearningPHP7_default_1494189218317_29456
  ==&gt; default: Clearing any previously set forwarded ports...
  Vagrant cannot forward the specified ports on this VM, since they
  would collide with some other application that is already listening
  on these ports. The forwarded port to 3344 is already in use
  on the host machine.
  
  To fix this, modify your current project's Vagrantfile to use another
  port. Example, where '1234' would be replaced by a unique host port:
  
    config.vm.network :forwarded_port, guest: 80, host: 1234
  
  Sometimes, Vagrant will attempt to auto-correct this for you. In this
  case, Vagrant was unable to. This is usually because the guest machine
  is in a state which doesn't allow modifying port forwarding. You could
  try 'vagrant reload' (equivalent of running a halt followed by an up)
  so vagrant can attempt to auto-correct this upon booting. Be warned
  that any unsaved work might be lost.
  </code></pre>