LoginSignup
53
46

More than 5 years have passed since last update.

vagrant sshは、素のsshで接続するより179倍待たされる

Posted at

VagrantでゲストOSにログインするとき、vagrant sshを使うが、普通にsshするより体感的に遅い。頻繁にゲストOSに出入りするとちょっとストレスフル。

vagrant ssh

$ time vagrant ssh -c exit
Connection to 127.0.0.1 closed.
vagrant ssh -c exit  1.79s user 0.23s system 75% cpu 2.683 total

vagrant ssh → 1.79秒かかる。

素のssh

素のSSHでゲストOSに入るために、SSH設定をキャッシュを作っておく:

vagrant ssh-config > ssh_config.cache
$ time ssh -F ssh_config.cache マシン名 exit
ssh -F ssh_config.cache linuxenv exit  0.01s user 0.01s system 12% cpu 0.161 total

素のSSH → 0.01秒。一瞬で入れる。

結論

よくログインするゲストOSはssh_config作っておくと快適。

53
46
3

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
53
46