3

I should note up front that I am largely Linux-illiterate - I'm a Windows user, I'd like to try out the Hack language, and this seemed like the quickest way to get up and running.

I followed this tutorial series and got as far as trying to launch the configured image.

When I run homestead up or homestead provision, it fails with the same error message:

Rasmus Schultz@SIDEWINDER-7240 ~
$ homestead provision
==> default: Running provisioner: file...
==> default: Running provisioner: shell...
    default: Running: inline script
==> default: grep: unrecognized option '---- BEGIN SSH2 PUBLIC KEY ----
==> default: Comment: "RasmusHomestead"
==> default: AAAAB3NzaC1yc2EAAAABJQAAAQEAhJ4eUnXFP7dCX98KtqNoZI9WwkE0+EBfuggt
...snip...
==> default: bVlGxJAHJd6u0vW9fssohiaUuo+8i48zHn8Ciqs5XVAn79m/PQ==
==> default: ---- END SSH2 PUBLIC KEY ----
==> default: '
==> default: Usage: grep [OPTION]... PATTERN [FILE]...
==> default: Try 'grep --help' for more information.
==> default: ---- BEGIN SSH2 PUBLIC KEY ---- Comment: "RasmusHomestead" AAAAB3NzaC1yc2EAAAABJQAAAQEAhJ4eUnXFP7dCX98KtqNoZI9WwkE0+EBfuggt 
...snip...
bVlGxJAHJd6u0vW9fssohiaUuo+8i48zHn8Ciqs5XVAn79m/PQ== ---- END SSH2 PUBLIC KEY ----
==> default: Running provisioner: shell...
    default: Running: inline script
==> default: /tmp/vagrant-shell: line 1: /home/vagrant/.ssh/$2: ambiguous redirect
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

I have tried updating Composer, Homestead, Vagrant, VirtualBox, the Homestead box image, everything I could think of - I'm pretty sure it's all up to date.

Rasmus Schultz@SIDEWINDER-7240 ~
$ homestead
Laravel Homestead version 2.0.17

Rasmus Schultz@SIDEWINDER-7240 ~
$ homestead update
==> default: Checking for updates to 'laravel/homestead'
    default: Latest installed version: 0.2.6
    default: Version constraints:
    default: Provider: virtualbox
==> default: Box 'laravel/homestead' (v0.2.6) is running the latest version.

Rasmus Schultz@SIDEWINDER-7240 ~
$ composer global update laravel/homestead
Changed current directory to C:/Users/Rasmus Schultz/AppData/Roaming/Composer
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files

Here's my Homestead.yaml file:

---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: C:\Users\Rasmus Schultz\.ssh\RasmusHomestead.pub

keys:
    - C:\Users\Rasmus Schultz\.ssh\RasmusHomestead

folders:
    - map: C:\workspace
      to: /home/vagrant/Code

sites:
    - map: test.dev
      to: /home/vagrant/Code/test
      hhvm: true

databases:
    - homestead

variables:
    - key: APP_ENV
      value: local

This grep error looks like an internal problem occurring inside the box while it's being provisioned - as though the grep command being issued isn't valid?

What gives?

UPDATE:

Okay, the first problem is solved - it was expecting a different key format, but this hasn't fixed the "ambiguous redirect" error message... assuming I have to re-provision? I shut down vagrant and started it again, no luck.

$ homestead provision
==> default: Running provisioner: file...
==> default: Running provisioner: shell...
    default: Running: inline script
==> default: Running provisioner: shell...
    default: Running: inline script
==> default: /tmp/vagrant-shell: line 1: /home/vagrant/.ssh/$2: ambiguous redirect
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
mindplay.dk
  • 7,085
  • 3
  • 44
  • 54
  • When you generated your SSH key, did you use the ssh-keygen like the video or did you use Putty's Keygen (or another application)? – temporalslide May 06 '15 at 09:56
  • I already had my key pair, previously generated using Putty. Is that wrong? (it works everywhere else.) – mindplay.dk May 06 '15 at 10:10
  • It doesn't like that particular format of the key, instead it wants the OpenSSH format. – temporalslide May 06 '15 at 10:11
  • I've had that issue before, and I did use the "Export OpenSSH Key" option in puttygen. It doesn't look anything like the key I just generated using ssh-keygen however - and I did manage to boot the box this time, and it responds to a ping now, but no response on port 80, and it didn't fix the "ambiguous redirect" error. Will updated and post above... – mindplay.dk May 06 '15 at 10:27

1 Answers1

2

The grep error comes because it doesn't like the default putty format used for public keys. You need to resave it as a OpenSSH key instead.

This can be achieved by reopening the private key file in Putty Key Generator and then copying/pasting the public key (found at the top marked "Public key for pasting into OpenSSH authorized_keys file") into a key file (either a new one or your existing one).

If you choose a to save it as a new file then you'll need to adjust the path in your homestead config file.

temporalslide
  • 957
  • 6
  • 9
  • Yeah, I've had to do that before (see my comment above) but the key format still isn't what Homestead was expecting - it doesn't seem to like the line-breaks. I generated new keys and it works, but I still get the same error message, see updated post above. – mindplay.dk May 06 '15 at 10:41