O'Reilly logo

Creating Development Environments with Vagrant by Michael Peacock

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Connecting to multiple virtual machines over SSH

When our multiple machines boot up in our multi-machine project, Vagrant automatically maps different ports from our host machine to the SSH ports on the various guest machines.

Let's look at the console output when booting a Vagrant project with two virtual machines within it:

Connecting to multiple virtual machines over SSH

As shown in the preceding screenshot, Vagrant maps the SSH port on the virtual machine designated 'webserver' to port 2222 on the host machine, and the SSH port of the machine designated 'database' to the port 2200.

This gives us the opportunity of simply using the standard SSH command from a terminal (or the likes of Putty on ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required