How to have multiple boxes of the same operating system?

17 views
Skip to first unread message

Vaxobot

unread,
Jul 13, 2017, 10:45:59 AM7/13/17
to Vagrant
Hello everyone.

I have a box with the ubuntu/trusty64 system, but i have a question.

When i put the vagrant up command it starts downloading the box with the operating system, i natively have the ubuntu distribution on my pc and in the path of my files, more specifically, in .vagrant/box the path is created with the box of the operating system that downloads (ubuntu/trusty64), then the path remains as .vagrant/box/name-of-box.

And what I want to do is have multiple boxes with ubuntu/trusty64 to have different development environments in each. For example in one having LAMP and another having LEMP, both with ubuntu/trusty64.

How can I have this structure of several boxes with the same operating system, but with different environments?

Note: In a folder I put a Vagrant file and in another folder I put another Vagrant file, specifying the type of boxes, having the following structure in each Vagrant file:

AGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config
.vm.box = "ubuntu/xenial64"
  config
.vm.define "nginx_ubuntu" do |nginx_ubuntu|
 
end
  config
.vm.provider :virtualbox do |vb|
       vb
.name = "nginx_ubuntu"
 
end
  config
.vm.network "forwarded_port", guest: 80, host: 8080
  config
.vm.network "private_network", ip: "192.168.33.10"
  config
.vm.synced_folder "htdocs", "/var/www/html"
end


In a Vagrant file I have nginx and in another I want to have apache.

I thank you in advance.

Regards!

Alvaro Miranda Aguilera

unread,
Jul 17, 2017, 4:16:36 AM7/17/17
to vagra...@googlegroups.com

--
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 vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/c8f2cb9a-ff19-46a3-8329-ce9c2cd080b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Reply all
Reply to author
Forward
0 new messages