Help us understand the problem. What is going on with this article?

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

More than 1 year has passed since last update.

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作っておくと快適。

suin
Qiita 4位/TypeScript入門書執筆中/TypeScripterのための座談会「YYTypeScript」主催/『実践ドメイン駆動設計』書籍邦訳レビュア/分報Slack考案/YYPHP主催/CodeIQマガジン執筆/株式会社クラフトマンソフトウェア創設/Web自動テスト「ShouldBee」の開発/TypeScript/DDD/OOP
https://yyts.connpass.com/
shouldbee
開発者向けテスト支援サービスShouldBeeを開発・運営するスタートアップ(onlab第8期)
http://shouldbee.at
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした