5
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Vagrant:vagrant sshで反応が無い場合の対処法備忘録

Posted at

問題

vagrant sshコマンドでいつものように開発マシンに入ろうとしたところ、全く反応が無くなった

$ vagrant ssh

# 反応無し

version

Host側

  • windows 7
  • cygwin 2.9.0-3
  • virtualbox 5.2.2
  • Vagrant 2.0.1
    • vagrant-vbguest 0.15.0
  • guestadditions 5.2.2

恐らく全て最新です(2017年12月21日時点)

Guest側

不明!

とりあえずguestadditionsは5.2.2で同じです。

原因

直前にvagrantやらvirtualboxやらGuestAdditionsやらを入れなおしていたので、その影響かと思います。

ggると下記のようなページがヒットします。結構同じ症状に悩んでいる人は多い様子。

version upで治るよみたいなコメントが多い気がします。

また、vagrant up時に下記のような出力がありちょっと気になります。

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'lamudi/centos-7.0' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 3000 (guest) => 3000 (host) (adapter 1)
    default: 4000 (guest) => 4000 (host) (adapter 1)
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection reset. Retrying...
    default: Warning: Connection aborted. Retrying...
    default: Warning: Connection reset. Retrying...
    default: Warning: Connection aborted. Retrying...
    default: Warning: Connection reset. Retrying...
    default: Warning: Connection aborted. Retrying...
    default: Warning: Connection reset. Retrying...
    default: Warning: Connection aborted. Retrying...
==> default: Machine booted and ready!
[default] GuestAdditions 5.2.2 running --- OK.
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Mounting shared folders...
    default: /vagrant => C:/projects/hoge
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.

この部分が怪しいです。

default: Warning: Connection aborted. Retrying...
default: Warning: Connection reset. Retrying...

対処法

vagrant sshを使わずにsshすることで無事入れました。

コマンド例

$ ssh -i /cygdrive/c/projects/hoge/.vagrant/machines/my_app/virtualbox/private_key -p 2222 vagrant@127.0.0.1

書式

ssh -i 鍵のパス -p ホスト側のポート ゲスト側のユーザー名@ゲスト側のipアドレス

まとめ

根本的な解決には至っていません。。

5
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?