Show pageOld revisionsBacklinksODT exportBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====Multiple Boxes ==== Vagrant is often used to manage MANY virtual machines. Therefore we need to be able to provide many customized configurations. In the following example, you can see 2 virtual box configurations <Code:none | MultiBox Configuration> Vagrant.configure("2") do |config| config.ssh.insert_key = true config.vm.provider "virtualbox" do |vb| vb.gui = true vb.memory = "1534" end config.vm.define "ainsible" do |app| app.vm.box = "centos/7" app.ssh.username = 'root' app.ssh.password = 'vagrant' app.vm.network "private_network", ip: "192.168.10.2" app.vm.network "public_network" # app.ssh.forward_agent = true app.ssh.insert_key = true end config.vm.define "app1" do |app| app.vm.hostname = "orc-app1.dev" app.vm.box = "centos/7" app.ssh.username = 'root' app.ssh.password = 'vagrant' app.vm.network "private_network", ip: "192.168.10.3" end </Code> The first part of the configuration is the general configuration for all boxes. As you can see, we have enabled GUI for all machines and we have enabled 1534 MBs of Virtual memory (RAM). The next part is configuration for a box called: ainsible and the other for a box called: app1 ====Rsync Back==== By default, vagrant rsync shared folders from the host (where vagrant runs) -> the target machine. So if we want to download any files generated on the target servers, to be used by the others, using the host as proxy. We have to install a specific plugin. <Code:none| Install rsync back> andonovj@DESKTOP-N65RKDP /cygdrive/d/Virtuals/Docker Swarm $ vagrant plugin install vagrant-rsync-back Installing the 'vagrant-rsync-back' plugin. This can take a few minutes... Fetching: vagrant-rsync-back-0.0.1.gem (100%) Installed the plugin 'vagrant-rsync-back (0.0.1)'! andonovj@DESKTOP-N65RKDP /cygdrive/d/Virtuals/Docker Swarm $ vagrant rsync-back mgr1 ==> mgr1: Rsyncing folder: /vagrant/ => /cygdrive/d/Virtuals/Docker Swarm </Code> ==== Possible Errors ==== In case you receive the following error: <Code: none | Authentication-Error> ==> default: Forwarding ports... default: 22 (guest) => 2222 (host) (adapter 1) ==> default: Booting VM... ==> default: Waiting for machine to boot. This may take a few minutes... default: SSH address: 127.0.0.1:2222 default: SSH username: root default: SSH auth method: private key default: Warning: Authentication failure. Retrying... default: Warning: Authentication failure. Retrying... default: Warning: Authentication failure. Retrying... default: Warning: Authentication failure. Retrying... default: Warning: Authentication failure. Retrying... default: Warning: Authentication failure. Retrying... default: Warning: Authentication failure. Retrying... default: Warning: Authentication failure. Retrying... </Code> Assure that the password for the user (in our case root) is the same as the vagrant file AND ensure that the rootlogin is enable and the password authentication is also enabled. ====Install VirtualBox Guest Addition==== When you will want to create a shared folders between the virtual box and the host machine. You need a VirtulBox Guest addition, which can be installed as follows: <Code:bash|Install VirtualBox Guest Addition Plugin> C:\Users\julie\VirtualBox VMs\OUD>vagrant plugin install vagrant-vbguest Installing the 'vagrant-vbguest' plugin. This can take a few minutes... Fetching vagrant-vbguest-0.30.0.gem Successfully uninstalled vagrant-vbguest-0.21.0 Installed the plugin 'vagrant-vbguest (0.30.0)'! C:\Users\julie\VirtualBox VMs\OUD> </Code>< vagrant_advanced_management.txt Last modified: 2021/11/02 05:03by andonovj