1
votes

After a 5 hours trying to install Laravel Homestead I need a help.. I've got CX server on hetzner Install Ubuntu 16.04 The install virtualbox and vagrant

After trying to inctall laravel homestead by documentation step by step, but I have an error when vagrant trying to connect via ssh to virtual machine..

I dont have any ideas what the problem.

vagrant ssh-config

Host homestead-7
  HostName 127.0.0.1
  User vagrant
  Port 2222
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile /root/.vagrant.d/insecure_private_key
  IdentitiesOnly yes
  LogLevel FATAL
  ForwardAgent yes

Vargantfile

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

require 'json'
require 'yaml'

VAGRANTFILE_API_VERSION ||= "2"
confDir = $confDir ||= File.expand_path(File.join(Dir.home, ".homestead"))

homesteadYamlPath = confDir + "/Homestead.yaml"
homesteadJsonPath = confDir + "/Homestead.json"
afterScriptPath = confDir + "/after.sh"
aliasesPath = confDir + "/aliases"

require File.expand_path(File.dirname(__FILE__) + '/scripts/homestead.rb')

Vagrant.require_version '>= 1.8.4'

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
    if File.exist? aliasesPath then
        config.vm.provision "file", source: aliasesPath, destination: "/tmp/bash_aliases"
        config.vm.provision "shell" do |s|
          s.inline = "awk '{ sub(\"\r$\", \"\"); print }' /tmp/bash_aliases > /home/vagrant/.bash_aliases"
        end
    end

    if File.exist? homesteadYamlPath then
        settings = YAML::load(File.read(homesteadYamlPath))
    elsif File.exist? homesteadJsonPath then
        settings = JSON.parse(File.read(homesteadJsonPath))
    end

    Homestead.configure(config, settings)

    if File.exist? afterScriptPath then
        config.vm.provision "shell", path: afterScriptPath, privileged: false
    end

    if defined? VagrantPlugins::HostsUpdater
        config.hostsupdater.aliases = settings['sites'].map { |site| site['map'] }
    end
end

vagrant ssh

ssh_exchange_identification: read: Connection reset by peer

Debug info:

DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
DEBUG subprocess: Exit status: 0
DEBUG virtualbox_5_1:   - [1, "ssh", 2222, 22, "127.0.0.1"]
DEBUG virtualbox_5_1:   - [1, "tcp27017", 27017, 27017, ""]
DEBUG virtualbox_5_1:   - [1, "tcp33060", 33060, 3306, ""]
DEBUG virtualbox_5_1:   - [1, "tcp44300", 44300, 443, ""]
DEBUG virtualbox_5_1:   - [1, "tcp54320", 54320, 5432, ""]
DEBUG virtualbox_5_1:   - [1, "tcp8000", 8000, 80, ""]
DEBUG ssh: Checking key permissions: /root/.vagrant.d/insecure_private_key
 INFO ssh: Invoking SSH: ssh ["[email protected]", "-p", "2222", "-o", "Compression=yes", "-o", "DSAAuthentication=yes", "-o", "LogLevel=FATAL", "-o", "IdentitiesOnly=yes", "-o", "StrictHostKeyChecking=no", "-o", "UserKnownHostsFile=/dev/null", "-i", "/root/.vagrant.d/insecure_private_key", "-o", "ForwardAgent=yes"]

Need any advices!

1
You must check that you have the latest version of the vagrant box, I used to have the same problem but it correct by upgrading to v2.0Victor H. Avelar

1 Answers

0
votes

If you have generated your homestead.yaml file the you might need to generate your ssh files for laravel in your home directory using ssh-keygen -t rsa -C “[email protected] the point you need to configure your homestead.yaml file to point to the directory where your ssh files are downloaded you can use this code as a reference homestead.yamel default configuration

ip: “192.168.10.10”
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
 — ~/.ssh/id_rsa
folders:
 — map: ~/Code
 to: /home/vagrant/Code
sites:
 — map: homestead.app
 to: /home/vagrant/Code/Laravel/public
databases:
 — homestead
# blackfire:
# — id: foo
# token: bar
# client-id: foo
# client-token: bar
# ports:
# — send: 50000
# to: 5000
# — send: 7777
# to: 777
# protocol: udp`

updated information according to your system information

`ip: “192.168.10.10”
memory: 1024
cpus: 1
provider: virtualbox
authorize: c:/Users/User/.ssh/id_rsa.pub
keys:
 — c:/Users/User/.ssh/id_rsa
folders:
 — map: e:/Homestead_Projects
 to: /home/vagrant/Code
sites:
 — map: homestead.app
 to: /home/vagrant/Code/Laravel/public
databases:
 — homestead
# blackfire:
# — id: foo
# token: bar
# client-id: foo
# client-token: bar
# ports:
# — send: 50000
# to: 5000
# — send: 7777
# to: 777
# protocol: udp 

hope this helps

Do remeber that any changes you made here you need to run the vagrant reload --provision command.

Hope this works for you good luck.