hello
you can do multi machine on same vagrant file and use private_network to
allow intra vm networking
example
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# global
config.vm.box = "alvaro/xenial64"
config.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
end
# server
config.vm.define "server" do |server|
server.vm.hostname = "server"
server.vm.network "private_network", ip: "192.168.56.20"
end
# client
(1..2).each do |i|
config.vm.define "client#{i}" do |vm|
vm.vm.hostname = "client#{i}"
vm.vm.network "private_network", ip: "192.168.56.#{30+i}"
end
end
end
On Mon, May 20, 2019 at 7:42 PM Jason Chu <[email protected]> wrote:
> Hi , I need to launch multiple ubuntu virtual machines with virtual box,
> so I created two different folders for two different vagrantfile files,
> they did create separate virtual box vm in separate folders, however I
> noticed when I try to have those machines ping each other, all their ip
> address (from ifconfig output) shows up as 10.0.2.15, so looks like they
> are NAT network within Virtual box network, how can I change the vagrant
> VMs using static ip and still able to use "Vagrant ssh" command, would it
> break it ?
>
>
> thanks
>
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in
> violation of those guidelines may result in your removal from this mailing
> list.
>
> GitHub Issues: https://github.com/mitchellh/vagrant/issues
> IRC: #vagrant on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vagrant-up/aba58197-6b8a-4777-bc04-6e8983a0ce3f%40googlegroups.com
> <https://groups.google.com/d/msgid/vagrant-up/aba58197-6b8a-4777-bc04-6e8983a0ce3f%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
Alvaro
--
This mailing list is governed under the HashiCorp Community Guidelines -
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of
those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vagrant-up/CAHqq0ew5bvM1ZLe7jVfzwcf%3D4QCOfFW6RrWzGws29DMzXxqn1g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.