質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Laravel

LaravelとはTaylor Otwellによって開発された、オープンソースなPHPフレームワークです。Laravelはシンプルで表現的なシンタックスを持ち合わせており、ウェブアプリケーション開発の手助けをしてくれます。

SSH

SSH(Secure Shell)は、セキュアチャネルを通してデータを交換するためのネットワークプロトコルです。リモートサーバーへのコマンド実行やファイル転送を行う時に一般的に使用されます。

VirtualBox

VirtualBoxは、現在米オラクル社が開発している、 x86仮想化ソフトウェア・パッケージの一つです。

Vagrant

Vagrantは、VirtualBox上の仮想マシンを コマンドラインから作成してくれるソフトウェアです。 ビルド環境など容易に構築が可能です。

Q&A

解決済

1回答

2424閲覧

Laravelの開発環境の構築 SSH private keyが通らないので教えていただきたいです。

takyas

総合スコア54

Laravel

LaravelとはTaylor Otwellによって開発された、オープンソースなPHPフレームワークです。Laravelはシンプルで表現的なシンタックスを持ち合わせており、ウェブアプリケーション開発の手助けをしてくれます。

SSH

SSH(Secure Shell)は、セキュアチャネルを通してデータを交換するためのネットワークプロトコルです。リモートサーバーへのコマンド実行やファイル転送を行う時に一般的に使用されます。

VirtualBox

VirtualBoxは、現在米オラクル社が開発している、 x86仮想化ソフトウェア・パッケージの一つです。

Vagrant

Vagrantは、VirtualBox上の仮想マシンを コマンドラインから作成してくれるソフトウェアです。 ビルド環境など容易に構築が可能です。

0グッド

1クリップ

投稿2017/05/16 03:25

ご覧いただきありがとうございます。

###実現したいこと
Laravelの開発環境をMacのローカル(Vagrant上)に構築したいです。

###前提

ソフトウェアバージョン
Vagrant1.9.1
Virtual Box5.0.30
MacOSEl Capitan 10.11.6

###発生している問題・エラーメッセージ

Vagrantは、1年前くらいにインストールしており、たまに使用していました。
今回Laravelでの開発をしようと思いまして、諸々のサイトをググり、laravel homesteadというBOXが存在することを知り、そちらをインストールしました。

  • 以前インストールしたVagrantのパス

/Users/myname/Vagrant/
Vagrantの下にディレクトリを作成して、vagrant initを実行して使用していました。

  • 今回インストールしたHomesteadのパス

/Users/myname/projects/laravelApp/Homestead

今回インストールしたHomesteadでvagrant upしたところ下記のエラーが発生しております。

myname-no-MacBook-Pro:Homestead myname$ vagrant up Bringing machine 'homestead-7' up with 'virtualbox' provider... ==> homestead-7: Checking if box 'laravel/homestead' is up to date... ==> homestead-7: Clearing any previously set forwarded ports... ==> homestead-7: Clearing any previously set network interfaces... ==> homestead-7: Preparing network interfaces based on configuration... homestead-7: Adapter 1: nat homestead-7: Adapter 2: hostonly ==> homestead-7: Forwarding ports... homestead-7: 80 (guest) => 8000 (host) (adapter 1) homestead-7: 443 (guest) => 44300 (host) (adapter 1) homestead-7: 3306 (guest) => 33060 (host) (adapter 1) homestead-7: 5432 (guest) => 54320 (host) (adapter 1) homestead-7: 8025 (guest) => 8025 (host) (adapter 1) homestead-7: 27017 (guest) => 27017 (host) (adapter 1) homestead-7: 22 (guest) => 2222 (host) (adapter 1) ==> homestead-7: Running 'pre-boot' VM customizations... ==> homestead-7: Booting VM... ==> homestead-7: Waiting for machine to boot. This may take a few minutes... homestead-7: SSH address: 127.0.0.1:2222 homestead-7: SSH username: vagrant homestead-7: 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.

Homestead.yamlの設定

ip: "192.168.10.10" memory: 2048 cpus: 1 provider: virtualbox authorize: ~/.ssh/id_rsa.pub keys: - ~/.ssh/id_rsa folders: - map: ~/projects/laravelApp to: /home/vagrant/Code sites: - map: homestead.app to: /home/vagrant/Code/Laravel/public databases: - homestead

###試したこと

vagrant ssh-configを叩くと下記の結果が返ってきます。

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

IdentityFileがid_rsaを見ていないことが SSHが通らない原因だと思うのですが...どう設定すれば解決するのか見えておりません。

以前から使用しているVagrantのディレクトリからのvagrant sshの時は、insecure_private_keyを参照して、今回インストールしたHomesteadからのvagrant sshの時は、id_rsaを参照するようにためにはどのように設定すべきでしょうか?

それともそもそもの設定がおかしいのでしょうか?

宜しくお願い致します。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

ここを参考にさせていただき、解決しました。
http://kz-engineer-scrap.hatenablog.com/entry/2017/02/10/034740

teratail上では見受けられなかった点なので、どなたかの参考になれば幸いです。

【解決方法】
VirtualBoxをGUI操作
[ネットワーク]→[アダプター1]→[高度]→[ケーブル接続]にチェックを入れてホストを再起動
ローカルでvagrant upして、もし駄目だったら、vagrant destroyで一度消してから再度 vagrant upをかける

投稿2017/05/16 08:16

編集2017/07/12 03:38
takyas

総合スコア54

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問