» Vagrant Connect
Vagrant can share any or every port to your Vagrant environment, notjust SSH and HTTP. The vagrant connect
command gives the connecting persona static IP they can use to communicate to the shared Vagrant environment.Any TCP traffic sent to this IP is sent to the shared Vagrant environment.
» Usage
Just call vagrant share —full
. This will automatically share as many ports aspossible for remote connections. Please seethe Vagrant share security page for moreinformation.
Note the share name at the end of calling vagrant share —full
, and give this tothe person who wants to connect to your machine. They simply have to callvagrant connect NAME
. This will give them a static IP they can use to accessyour Vagrant environment.
» How does it work?
vagrant connect
works by doing what Vagrant does best: managing virtualmachines. vagrant connect
creates a tiny virtual machine that takes uponly around 20 MB in RAM, using VirtualBox or VMware (more provider supportis coming soon).
Any traffic sent to this tiny virtual machine is then proxied through tothe shared Vagrant environment as if it were directed at it.
» Beware: Vagrant Insecure Key
If the Vagrant environment or box you are using is protected with theVagrant insecure keypair (most public boxes are), then SSH will be easilyavailable to anyone who connects.
While hopefully you are sharing with someone you trust, in certain environmentsyou might be sharing with a class, or a conference, and you do not want themto be able to SSH in.
In this case, we recommend changing or removing the insecure key fromthe Vagrant machine.
Finally, we want to note that we are working on making it so that whenVagrant share is used, the Vagrant private key is actively rejected unlessexplicitly allowed. This feature is not yet done, however.