SSHing between 2 guests on the same host machine

25 views
Skip to first unread message

Anthony Green

unread,
Jul 16, 2015, 8:12:07 AM7/16/15
to vagra...@googlegroups.com
I'm using Vagrant to build VMs to test some Ansible scripts.

I'd like to be able to SSH between one guest (an Ubuntu VM) and another (an OS X VM)
Is it possible for Vagrant to configure both VMS correctly to do this ? 

dragon788

unread,
Aug 3, 2015, 1:56:40 PM8/3/15
to Vagrant
You can either create both VMs as part of a single Vagrantfile and I think this allows them to access each other via hostname on the same "network", or you can assign static IP addresses in the vagrantfile and simply use that address to access each VM. The one thing you'll want to do is make sure if you need passwordless access for provisioning, you can add the vagrant key to each VM (they should already trust it, but they'll need an actual copy to use it to access another machine) and then make your connections using that key. You could also try the ssh-agent-forwarding, but I haven't messed with multi-VM setups very much.
Reply all
Reply to author
Forward
0 new messages