Forked from jedi4ever/dns tuning ssh login speedup vagrant
Created
September 19, 2016 14:02
-
-
Save bartek/9be413139fe3558414f0a55f3846d116 to your computer and use it in GitHub Desktop.
speeding up DNS/SSH connections in vagrant
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Tune /etc/ssh/sshd_config | |
UseDNS no # Disable DNS lookups | |
GSSAPIAuthentication no # Disable negotation of slow GSSAPI | |
don't forget to restart it, use a script provider to set it , or create it with veewee or snapshot it | |
- Tune Vagrantfile | |
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] | |
See <http://serverfault.com/questions/453185/vagrant-virtualbox-dns-10-0-2-3-not-working?rq=1> | |
- Logging into the vm with a regular ssh command | |
See <http://blog.codeboutique.com/post/creating-debian-squeeze-box-for-vagrant> | |
vagrant ssh-config vmname | ssh -t -t -F/dev/stdin vmname | |
Use the -t -t to overcome the pseudoterminal warning | |
- Now use a control connnection for ssh | |
(as it seems that the cli invocation of vagrant takes a couple of seconds ....) | |
Setup the control session: | |
vagrant ssh-config vmname | ssh -t -t -F/dev/stdin -o 'ControlMaster auto' -o 'ControlPath ~/.ssh/vagrant' vmname | |
Use it for fast login | |
ssh -o 'ControlMaster auto' -o 'ControlPath ~/.ssh/vagrant' vmname | |
Now it logins in a matter of milliseconds! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment