smeeb
smeeb

Reputation: 29557

Vagrant box running in awkward state

On Windows 7 (sadly, not my choice), Vagrant 1.7.2 here.

Installed Vagrant, created a C:\vagrant dir and dropped into it. Ran vagrant init and then modified my Vagrantfile to look like:

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure(2) do |config|
    config.vm.box = "hashicorp/precise32"
end

Then ran vagrant up and got a ton of "Authentication failure" messages. But then when I open my Oracle VM VirtualBox manager, I see that there is a new VM created an running:

enter image description here

So according to the command line output, the box failed to be spawned for some auth-related issues, but then according to VirtualBox, it is alive and well.

My questions (all too similarly related to bog SO with lots of teeny, tiny separate questions):

  1. Amidoinitrite? Are these auth failure messages typical of a vagrant up? If not, what is going on here?
  2. How can I tell if my box is actually up/alive/healthy?
  3. When I try to SSH into it with ssh -p 2222 [email protected] I am still prompted for an SSH password. This is in contradiction to what the Vagrant console output says, which indicates Vagrant should have already added my SSH private key to my local SSH config. What is going on here and what's the fix?
  4. If my machine is running properly, how do I shut it down when I'm done? Via Vagrant command, or do I have to go into VirtualBox and manually click the button to power off the VM?

Upvotes: 1

Views: 217

Answers (1)

smeeb
smeeb

Reputation: 29557

Can't believe the Vagrant community didn't hop on this one:

  1. Yes I did it right, but Windows/Cygwin makes things weird and takes some hacking (see below).
  2. Yes if it is showing as 'Running' in VirtualBox, its running.
  3. vagrant ssh. I am then queried to enter a passphrase for a key called C:/Users/myuser/.vagrant.d/insecure_private_key, to which I just hit the Enter button (so that it is blank). I am then specified for the [email protected]'s SSH password, and I enter vagrant. Now I'm in. Wow that was painful to figure out.
  4. Once SSHed in, exit will allow you to exit the Vagrant box and return to your command line/shell. Then vagrant halt to stop the machine. You may be prompted for the vagrant password for permission to shut the machine down gracefully.

Recommendation to Vagrant: Drop Windows support altogether and force your users to use Linux or Mac (which is Linux with hipster nonsense thrown in). If my boss knew I couldn't use Vagrant from a Windows machine he'd happily approve a Mac purchase order for me ;-).

Upvotes: 0

Related Questions