I have a Vagrant environment that requires me to forward port 80 so I bring it up under
sudo on an OS X machine. This has always been fine until I recently upgraded to Vagrant 1.2.2. Now it fails to boot.
[default] Waiting for VM to boot. This can take a few minutes. [default] Failed to connect to VM! Failed to connect to VM via SSH. Please verify the VM successfully booted by looking at the VirtualBox GUI.
Because I'm running under
sudo, the machine never gets added to the Virtualbox GUI, but that's always been the case for this environment.
I don't get any indication that there was a problem with the additions -- a potential source of this error, from what I've read. I can bring things up just fine if I change to using port 8080 on the host machine. I can't use the app, but the VM itself loads up and provisions nicely.
As far as I can tell, the only thing that's changed is:
- I upgraded my Vagrant version
- I updated the project's
Vagrantfileto use v2 syntax.
Anyone have any idea what I might be missing? I thought I'd be able to find this pretty easily, but it's quickly becoming a very real problem.
UPDATE 27 JUN
It appears that it's an SSH key issue if
VAGRANT_LOG=DEBUG is to be believed:
DEBUG ssh: Checking key permissions: /Users/robwilkerson/.vagrant.d/insecure_private_key INFO ssh: SSH not up: #<Vagrant::Errors::SSHKeyBadOwner: The private key to connect to the machine via SSH must be owned by the user running Vagrant. This is a strict requirement from SSH itself. Please fix the following key to be owned by the user running Vagrant: /Users/robwilkerson/.vagrant.d/insecure_private_key> INFO subprocess: Starting process: ["VBoxManage", "showvminfo", "3422bba7-8f35-42ad-ba1a-c127c6cb3cf6", "--machinereadable"]
I assume it wants a key owned by
root since I'm under
sudo, but if that's the case, why isn't it looking at
~/.vagrant.d/? Did v2 get more strict about this? I was able to
sudo vagrant up just fine until the upgrade. Since this is my only dev environment that requires
sudo to up, I'd rather not change key ownership. Is there another way?
Lots of questions, I know, but I could really use a hand understanding/fixing this one.