TheWalkingPanda
TheWalkingPanda

Reputation: 183

Vagrant on Windows can't vagrant-up and ssh connect

So I've watch many videos on Vagrant and it seems so simple: with VirtualBox and Vargant installed, simply specify the VM box's name in the Vagrantfile, run $ vagrant up and you should be able to $ vagrant ssh to it directly.

However, a week-end later and many headaches/broken keyboards later, this still doesn't work.

PS C:\dev\web> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/trusty32'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/trusty32' is up to date...
==> default: Setting the name of the VM: web_default_1468168716511_77856
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.

If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.

In the meanwhile, if I open VirtualBox Manager and open the newly installed Box, I can completely connect to it using 'vargant' as a username and password and I can see that nothing is installed on it. I can not ssh to it through PuTTY or Cygwin.

Doing a $vagrant ssh-config outputs the following:

PS C:\dev\web> vagrant ssh-config
Host default
  HostName 127.0.0.1
  User vagrant
  Port 2222
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile C:/Users/User/.vagrant.d/insecure_private_key
  IdentitiesOnly yes
  LogLevel FATAL

My Vagrantfile:

Vagrant.configure("2") do |config|

  config.vm.box = "ubuntu/trusty32"

   config.vm.provider "virtualbox" do |vb|

     vb.gui = true

   end

   config.vm.provision "shell", inline: <<-SHELL
     apt-get update
     apt-get install -y apache2
   SHELL
end

I have tried everything listed on serverfault and stackoverflow, I don't see any video where people have that issue, all they do is just run vagrant and it just work...

Edit: I've tried this on a Windows Server and it worked perfectly out of the box. So this is most likely an issue related to Windows 10 or something.

Upvotes: 3

Views: 4141

Answers (2)

dmitrdem
dmitrdem

Reputation: 21

Just had the same issue on Windows 10 and installing VirtualBox Oracle VM VirtualBox Extension Pack helped

Upvotes: 0

Richard Bale
Richard Bale

Reputation: 368

I have been having a very similar issue today, I am starting a slightly different environment to yours (Cent OS 7) but installing the VirtualBox Guest Additions might help out. The command vagrant plugin install vagrant-vbguest should do the trick.

The page where I found this did have other information on there as well which might help.

Upvotes: 0

Related Questions