Fail to vagrant up laravel homestead - laravel-5

enter image description here
By following the instruction at https://laravel.com/docs/4.2/homestead,I had installed laravel homestead using vagrant 1.8.0 and Virtual box 5.1.10 on WIN7 yesterday.
However the computer was power off accidently. When I restart the computer, I got these errors:
Administrator#L3L44LWAP6XZHHR MINGW64 ~/Homestead (master)
$ vagrant up
Bringing machine 'homestead-7' up with 'virtualbox' provider...
==> homestead-7: Checking if box 'laravel/homestead' is up to date...
==> homestead-7: Clearing any previously set forwarded ports...
==> homestead-7: Clearing any previously set network interfaces...
==> homestead-7: Preparing network interfaces based on configuration...
homestead-7: Adapter 1: nat
homestead-7: Adapter 2: hostonly
==> homestead-7: Forwarding ports...
homestead-7: 80 (guest) => 8000 (host) (adapter 1)
homestead-7: 443 (guest) => 44300 (host) (adapter 1)
homestead-7: 3306 (guest) => 33060 (host) (adapter 1)
homestead-7: 5432 (guest) => 54320 (host) (adapter 1)
homestead-7: 22 (guest) => 2222 (host) (adapter 1)
==> homestead-7: Running 'pre-boot' VM customizations...
==> homestead-7: Booting VM...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["startvm", "75bdb497-9044-4c49-ab2d-5244eb234d6e", "--type", "headless "]
Stderr: VBoxManage.exe: error: The virtual machine 'homestead-7' has terminated
unexpectedly during startup with exit code 1 (0x1). More details may be available
in 'C:\Users\Administrator\VirtualBox VMs\homestead-7\Logs\VBoxHardening.log'
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component MachineWrap, interface IMachine.
I tried to reinstall the virtual box and the vagrant, but it doesn't work to me.
Any help is much appreciated.

I had faced a same type of problem and have solved the problem.
Oracle VM 5.1.12 is okay for me.
Sometimes antivirus/firewall applications are troubling to this kind of activities. So try to disable or remove antivirus app to check whether the problem will continue.

The command "vagrant reload" solved for me

I've removed VirtualBox and installed the version 5.2.2
This has been fixed my problem.
But before the problem occurred, I'd upgraded the vagrant. I thought that your vagrant version is not suitable for your VirtualBox version. Please double check your versions.

Related

Error on vagrant up for laravel homestead

Hi there I have encountered below error after running vagrant up:
$ vagrant up
Bringing machine 'homestead-7' up with 'virtualbox' provider...
==> homestead-7: Clearing any previously set forwarded ports...
==> homestead-7: Clearing any previously set network interfaces...
==> homestead-7: Preparing network interfaces based on configuration...
homestead-7: Adapter 1: nat
homestead-7: Adapter 2: hostonly
==> homestead-7: Forwarding ports...
homestead-7: 80 (guest) => 8000 (host) (adapter 1)
homestead-7: 443 (guest) => 44300 (host) (adapter 1)
homestead-7: 3306 (guest) => 33060 (host) (adapter 1)
homestead-7: 5432 (guest) => 54320 (host) (adapter 1)
homestead-7: 22 (guest) => 2222 (host) (adapter 1)
==> homestead-7: Running 'pre-boot' VM customizations...
==> homestead-7: Booting VM...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["startvm", "83b1dbca-4d9f-4828-a544-d8a88124eafe", "--type", "headless"]
Stderr: VBoxManage.exe: error: The virtual machine 'homestead-7' has terminated unexpectedly during startup with exit code -1073741819 (0xc0000005)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component MachineWrap, interface IMachine
The vagrant used to work just fine and this error happens right after Windows 10 update.
I have tried below commands non resolve the issue:
vagrant reloead
vagrant reload --provision
vagrant and homestead version:
$ vagrant -v
Vagrant 1.9.1
$ homestead -v Laravel
Homestead version 3.1.0
I couldn't run virtual box application even through run as administrator option (no error/warning). I check the version through cmd:
C:\Program Files\Oracle\VirtualBox>vboxmanage
--version 5.1.8r111374
Event Viewer error upon virtual box run:
Faulting application name: VirtualBox.exe, version: 5.1.8.11374, time stamp: 0x58062715
Faulting module name: VirtualBox.exe, version: 5.1.8.11374, time stamp: 0x58062715
Exception code: 0xc0000005
Fault offset: 0x00000000000139bd
Faulting process id: 0x15fc
Faulting application start time: 0x01d2df9836f7498f
Faulting application path: C:\Program Files\Oracle\VirtualBox\VirtualBox.exe
Faulting module path: C:\Program Files\Oracle\VirtualBox\VirtualBox.exe
Report Id: e94ebe5e-a1f3-4157-92a5-3452486712ef
Faulting package full name:
Faulting package-relative application ID:
Thanks in advance.
I had this issue today after the latest Windows update. Installing the latest version of Virtual Box (5.1.22) solved this for me. I was at 5.1.6.
You may need to also update the VirtualBox Guest Additions.

Failed to mount folders in Linux guest - mesg: ttyname failed: Inappropriate ioctl for device

Vagrant won't mount folders. Tried so many solutions, nothing worked.
Versions: Vagrant 1.8.1 / Ubuntu 15.10 / Virtualbox 5.0.16
vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ubuntu/wily64' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> 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: vagrant
default: SSH auth method: private key
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
==> default: Machine booted and ready!
GuestAdditions 5.0.16 running --- OK.
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
default: /vagrant => C:/Users/User/www/magento-box
default: /vagrant-magento-box-folder => C:/Users/User/www/magento-box-folder
Failed to mount folders in Linux guest. This is usually because
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:
mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group www-data | cut -d: -f3`,dmode=775, fmode=664 vagrant-magento-box-folder /vagrant-magento-box-folder
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g www-data`,dmode=775, fmode=664 vagrant-magento-box-folder /vagrant-magento-box-folder
The error output from the last command was:
mesg: ttyname failed: Inappropriate ioctl for device
In Vagrantfile.config.yml synced folders:
synced_folder:
host_path: "/Users/User/www/magento-box-folder"
guest_path: "/vagrant-magento-box-folder/"
Vagrantfile
require 'yaml'
vagrantConfig = YAML.load_file 'Vagrantfile.config.yml'
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "private_network",
ip: vagrantConfig['ip']
config.vm.synced_folder "#{vagrantConfig['synced_folder']['host_path']}",
"#{vagrantConfig['synced_folder']['guest_path']}",
owner: "vagrant",
group: "www-data",
mount_options:["dmode=775, fmode=664"]
# VirtualBox specific settings
config.vm.provider "virtualbox" do |vb|
vb.gui = false
vb.memory = "2048"
vb.cpus = 2
end
In vagrant ssh I did
sudo ln -s /opt/VBoxGuestAdditions-5.0.16/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions
I replaced VBoxGuestAdditions.iso in tmp
Copy iso fileC:\Program Files/Oracle/VirtualBox/VBoxGuestAdditions.iso into the box /tmp/VBoxGuestAdditions.iso
Installed vbguest. Have no idea how to solve it..
Here is one important reason why error occurred vagrant up
If you use Virtual Box to Vagrant's provider, you have to reinstall 'Guest Additions' that everytime you create virtual machine's kernel.
vbguest plugin is a good solution for solving this issue.
( about vbguest plugin - https://github.com/dotless-de/vagrant-vbguest )
first, you have to install vbguest plugin.
$ vagrant plugin install vagrant-vbguest
and run Vagrant
$ vagrant halt
$ vagrant up
or use too
vagrant reload
This seems to be a problem with vagrant <= 1.8.4. I did an update to the latest vagrant version (in my case 1.9.3) and everything seems fine again.
Get the latest vagrant version here:
https://www.vagrantup.com/docs/installation/upgrading.html
2.
vagrant halt
3. Install upgrade.
4.
vagrant up

Error: Could not parse application options: invalid option: --manifestdir

I was trying to install piwik-dev-environment. According to instructions I cloned the repo, installed Vagrant and executed vagrant up. The process ended with the following error:
Error: Could not parse application options: invalid option: --manifestdir
Full logs are here:
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'trusty64' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Box file was not detected as metadata. Adding it directly...
==> default: Adding box 'trusty64' (v0) for provider: virtualbox
default: Downloading: https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box
default: Progress: 100% (Rate: 1170k/s, Estimated time remaining: --:--:--)
==> default: Successfully added box 'trusty64' (v0) for 'virtualbox'!
==> default: Importing base box 'trusty64'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: piwik-dev-environment_default_1438688840836_21904
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 => 2222 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> 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: vagrant
default: SSH auth method: private key
default: Warning: Connection timeout. Retrying...
default:
default: Vagrant insecure key detected. Vagrant will automatically replace
default: this with a newly generated keypair for better security.
default:
default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
default: /vagrant => D:/Git/piwik-dev-environment
default: /etc/puppet/files => D:/Git/piwik-dev-environment/puppet/files
default: /home/vagrant/www => D:/Git/piwik-dev-environment/www
default: /tmp/vagrant-puppet/modules-48bf73244a40076992a5cef90c07f471 => D:/Git/piwik-dev-environment/puppet/modules
default: /tmp/vagrant-puppet/manifests-768747907b90c39ab6f16fcb3320897a => D:/Git/piwik-dev-environment/puppet
==> default: Running provisioner: shell...
default: Running: inline script
==> default: stdin: is not a tty
==> default: Reading package lists...
==> default: Building dependency tree...
==> default: Reading state information...
==> default: ruby is already the newest version.
==> default: 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
==> default: Successfully installed facter-2.4.4
==> default: Successfully installed json_pure-1.8.2
==> default: Successfully installed hiera-3.0.1
==> default: Successfully installed puppet-4.2.1
==> default: 4 gems installed
==> default: Installing ri documentation for facter-2.4.4...
==> default: Installing ri documentation for json_pure-1.8.2...
==> default: Installing ri documentation for hiera-3.0.1...
==> default: Installing ri documentation for puppet-4.2.1...
==> default: Installing RDoc documentation for facter-2.4.4...
==> default: Installing RDoc documentation for json_pure-1.8.2...
==> default: Installing RDoc documentation for hiera-3.0.1...
==> default: Installing RDoc documentation for puppet-4.2.1...
==> default: Successfully installed hiera-3.0.1
==> default: 1 gem installed
==> default: Installing ri documentation for hiera-3.0.1...
==> default: Installing RDoc documentation for hiera-3.0.1...
==> default: Successfully installed hiera-1.3.4
==> default: Successfully installed hiera-puppet-1.0.0
==> default: 2 gems installed
==> default: Installing ri documentation for hiera-1.3.4...
==> default: Installing ri documentation for hiera-puppet-1.0.0...
==> default: Installing RDoc documentation for hiera-1.3.4...
==> default: Installing RDoc documentation for hiera-puppet-1.0.0...
==> default: Running provisioner: puppet...
==> default: Running Puppet with site.pp...
==> default: stdin: is not a tty
==> default: Error: Could not parse application options: invalid option: --manifestdir
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
I tried to find a file that contains the --manifestdir option but I didn't find any. I also tried to apply the same patch as in https://github.com/joebew42/diaspora-replica/issues/10 but it didn't help.
I'd appreciate any help.
I think that this was caused by a gem behavior.
I changed the SHELL provisioner to fetch and install the deb repo and installed the Puppet package for Ubuntu and I got past this issue.
config.vm.provision "shell", inline: <<-SHELL
if [ ! -f /deb-get ]; then wget https://apt.puppetlabs.com/puppetlabs-release-trusty.deb && sudo touch /deb-get; fi
if [ ! -f /deb-run ]; then sudo dpkg -i puppetlabs-release-trusty.deb && sudo touch /deb-run; fi
if [ ! -f /apt-get-run ]; then sudo apt-get update && sudo touch /apt-get-run; fi
if [ ! -f /apt-get-puppet ]; then sudo apt-get install --yes --force-yes puppet && sudo touch /apt-get-puppet; fi
SHELL
config.vm.provision :puppet do |puppet|
puppet.manifests_path = "puppet"
puppet.manifest_file = "site.pp"
puppet.module_path = "puppet/modules"
puppet.hiera_config_path = "hiera.yaml"
puppet.options = "--verbose --debug"
puppet.working_directory = "/tmp/vagrant-puppet"
puppet.facter = [
['fdqn', config.vm.hostname],
['db_username', CONF['db_username']],
['db_password', CONF['db_password']],
['ssh_username', CONF['ssh_username']],
]
end
This left the following issues:
==> default: Warning: Could not retrieve fact fqdn
==> default: Error: Could not find class apt for piwik-trusty64 on node piwik-trusty64
==> default: Error: Could not find class apt for piwik-trusty64 on node piwik-trusty64
But those are issues that can be fairly easily fixed.
It seems that you're trying to run the puppet provisioner with puppet4 installed on the guest machine. The --manifestsdir option is now deprecated and will cause an error. You have to add several parameters to your Vagrantfile to tell Vagrant that you're using the 4th version of Puppet.
The solution to your problem is described here: https://github.com/mitchellh/vagrant/pull/5601
Unfortunately the Piwik dev-environment project isn't maintained and doesn't work (a lot of issues are open in the tracker).
I have opened a pull request to embedded the Vagrant configuration straigth into Piwik's repository (which hopefully would be simpler to use too). Please comment in the pull request if you find it useful: https://github.com/piwik/piwik/pull/8542

Provisioning vagrant box with chef_ solo

I'm having a problem with the chef-solo provisioner failing with the error
Chef::Exceptions::CookbookNotFound: Cookbook apt not found.
Any ideas on what could be going wrong here and how should I try to troubleshoot this?
Host: Windows 7 64bit, Guest: Ubuntu 12.04
Virtualbox 4.3.20
ChefDK 0.4.0
Vagrant 1.7.2
Vagrant plugins:
vagrant-berkshelf (4.0.2)
vagrant-omnibus (1.4.1)
vagrant-share (1.1.3, system)
Vagrant output:
PS C:\VagrantBoxes\mybox> vagrant reload --provision
default: The Berkshelf shelf is at "C:/Users/dmit77/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150208-6588-1a3oox5-default"
==> default: Sharing cookbooks with VM
==> default: Attempting graceful shutdown of VM...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 => 2222 (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: vagrant
default: SSH auth method: private key
default: Warning: Connection timeout. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
default: The guest additions on this VM do not match the installed version of
default: VirtualBox! In most cases this is fine, but in rare cases it can
default: prevent things such as shared folders from working properly. If you see
default: shared folder errors, please make sure the guest additions within the
default: virtual machine match the version of VirtualBox you have installed on
default: your host and reload your VM.
default:
default: Guest Additions Version: 4.2.12
default: VirtualBox Version: 4.3
==> default: Mounting shared folders...
default: /vagrant => C:/VagrantBoxes/mybox
default: /tmp/vagrant-chef/7159cf65a6eea91634c03008165d96a8/cookbooks => C:/Users/dkrantsber/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150208-6588-1a3oox5-default
==> default: Running provisioner: chef_solo...
==> default: Detected Chef (latest) is already installed
Generating chef JSON and uploading...
==> default: Running chef-solo...
==> default: stdin: is not a tty
==> default: [2015-02-08T05:09:07+00:00] INFO: *** Chef 11.4.0 ***
==> default: [2015-02-08T05:09:08+00:00] INFO: Setting the run_list to ["recipe[apt]", "recipe[apache2]"] from JSON
==> default: [2015-02-08T05:09:08+00:00] INFO: Run List is [recipe[apt], recipe[apache2]]
==> default: [2015-02-08T05:09:08+00:00] INFO: Run List expands to [apt, apache2]
==> default: [2015-02-08T05:09:08+00:00] INFO: Starting Chef Run for vagrant.vm
==> default: [2015-02-08T05:09:08+00:00] INFO: Running start handlers
==> default: [2015-02-08T05:09:08+00:00] INFO: Start handlers complete.
==> default: [2015-02-08T05:09:08+00:00] ERROR: Running exception handlers
==> default: [2015-02-08T05:09:08+00:00] ERROR: Exception handlers complete
==> default: [2015-02-08T05:09:08+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
==> default: [2015-02-08T05:09:08+00:00] FATAL: Chef::Exceptions::CookbookNotFound: Cookbook apt not found. If you're loading apache2 from another cookbook, make sure you confi
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.
Vagrant file:
Vagrant.configure("2") do |config|
config.vm.box = "opscode-ubuntu-12.04_chef-11.4.0"
config.vm.box_url = "https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_ubuntu-12.04_chef-11.4.0.box"
config.ssh.forward_agent = true
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = ["cookbooks"]
chef.add_recipe :'apt'
chef.add_recipe 'apache2'
chef.json = {
:apache => {
:default_site_enabled => "true",
:dir => "/etc/apache2",
:log_dir => "/var/log/apache2",
:error_log => "error.log"
}
}
end
end
Folder structure:
[my_box]
[cookbooks]
[apt]
[apache2]
Vagrantfile
I finally came across the solution. It turns out that vagrant-berkshelf plugin is the problem. Uninstalling it resolves the issue.
Vagrant & Chef - Cookbook *** not found

Vagrant multiple vm with separate provisioning scripts

Currently trying to set up multiple VMs, with separate provisioning scripts.
Vagrantfile is as follows;
dir = Dir.pwd
vagrant_dir = File.expand_path(File.dirname(__FILE__))
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
box_name = "puppetlabs/centos-6.5-64-puppet"
# our web/app servers and their IPs - format 192.168.1.8##
app_servers = {
'web11' => {
:name => 'web11',
:ip => '192.168.1.811',
:box => box_name,
:forwarded_port_guest => 811,
:forwarded_port_host => 8811
},
'web21' => {
:name => 'web21',
:ip => '192.168.1.821',
:box => box_name,
:forwarded_port_guest => 821,
:forwarded_port_host => 8821
},
'learninglocker' => {
:name => 'learninglocker',
:ip => '192.168.1.899',
:box => box_name,
:forwarded_port_guest => 899,
:forwarded_port_host => 8899
}
}
app_servers.each do |key,value|
boxname = value[:name]
config.vm.define boxname do |app_config|
app_config.vm.provision "shell", inline: "echo !!!thisname!!!! #{key}"
app_config.vm.provision "shell", inline: "echo !!!thisip!!!! #{value[:ip]}"
app_config.vm.box = value[:box]
app_config.vm.host_name = "%s.vagrant" % value[:name]
app_config.vm.network "private_network", ip: value[:ip]
app_config.vm.network "forwarded_port", guest: value[:forwarded_port_guest], host: value[:forwarded_port_host]
app_config.ssh.forward_agent = true
provision_filename = key.to_s + "-provision.sh"
config.vm.provision "shell", inline: "echo #{provision_filename}"
# provisioning
if File.exists?(File.join(vagrant_dir,'provision',boxname + "-provision.sh")) then
config.vm.provision "shell", inline: "echo +++exists+++"
config.vm.provision :shell, :path => File.join( "provision", boxname + "-provision.sh" )
else
config.vm.provision "shell", inline: "echo PROVISION FILE DOES NOT EXIST!"
end
# Shared NFS folder
# config.vm.synced_folder "shared/nfs/", "/vagrant/", type: "nfs"
config.vm.synced_folder "shared/nfs/", "/vagrant/"
end # config.vm.define opts[:name] do |config|
end # app_servers.each
I also have a provision/web11-provision.sh file (but no web21 or learninglocker equivalents) which basically just prints out a message for now.
The problem: When running a vagrant up when it brings up web11 it prints the message that the file exists (expected). When it brings up web21, boxname is still web11 on first go around and so runs the provisioning script, then it goes again and changes to web21 so doesn't find the file. The same thing happens for learninglocker - runs web11, then web21, then learninglocker.
I'm clearly being dumb in terms of my .each statement, but can't figure out what it is... help?
Here's the full output of the vagrant up...
vagrant up
Bringing machine 'web11' up with 'virtualbox' provider...
Bringing machine 'web21' up with 'virtualbox' provider...
Bringing machine 'learninglocker' up with 'virtualbox' provider...
Bringing machine 'db22' up with 'virtualbox' provider...
Bringing machine 'db23' up with 'virtualbox' provider...
Bringing machine 'loadbalancer' up with 'virtualbox' provider...
==> web11: Importing base box 'puppetlabs/centos-6.5-64-puppet'...
==> web11: Matching MAC address for NAT networking...
==> web11: Checking if box 'puppetlabs/centos-6.5-64-puppet' is up to date...
==> web11: Setting the name of the VM: verf_web11_1413999007267_1427
==> web11: Clearing any previously set network interfaces...
==> web11: Preparing network interfaces based on configuration...
web11: Adapter 1: nat
web11: Adapter 2: hostonly
==> web11: Forwarding ports...
web11: 22 => 2222 (adapter 1)
web11: 811 => 8811 (adapter 1)
==> web11: Booting VM...
==> web11: Waiting for machine to boot. This may take a few minutes...
web11: SSH address: 127.0.0.1:2222
web11: SSH username: vagrant
web11: SSH auth method: private key
web11: Warning: Connection timeout. Retrying...
==> web11: Machine booted and ready!
==> web11: Checking for guest additions in VM...
==> web11: Setting hostname...
==> web11: Configuring and enabling network interfaces...
==> web11: Mounting shared folders...
web11: /vagrant => /Users/mbcx9rvt/Sites/UBC/CTLT/installs/spaces/vagrant/verf/shared/nfs
==> web11: Running provisioner: shell...
web11: Running: inline script
web11-provision.sh
==> web11: Running provisioner: shell...
web11: Running: inline script
+++exists+++
==> web11: Running provisioner: shell...
web11: Running: /var/folders/c6/1yd6r3px03j_l3f4g0kfkjfm0000gn/T/vagrant-shell20141022-35420-ulkjfx
Check for apt packages to install...
httpd,
php,
php-gd,
php-pear,
php-xml,
php-xmlrpc,
php-mbstring,
php-mcrypt,
php-tidy,
curl,
curl-devel,
php-pecl-apc
No yum packages to install.
==> web11: Running provisioner: shell...
web11: Running: inline script
!!!thisname!!!! web11
==> web11: Running provisioner: shell...
web11: Running: inline script
!!!thisip!!!! 192.168.1.811
==> web11: Checking for host entries
==> web11: adding to (/etc/hosts) : 192.168.1.811 web11.vagrant # VAGRANT: 71c96f7d0c293c081643fe8aeec588e3 (web11) / 1e8cff2f-4e26-4b70-99eb-e62e9b976413
==> web21: Importing base box 'puppetlabs/centos-6.5-64-puppet'...
==> web21: Matching MAC address for NAT networking...
==> web21: Checking if box 'puppetlabs/centos-6.5-64-puppet' is up to date...
==> web21: Setting the name of the VM: verf_web21_1413999051481_37940
==> web21: Fixed port collision for 22 => 2222. Now on port 2200.
==> web21: Clearing any previously set network interfaces...
==> web21: Preparing network interfaces based on configuration...
web21: Adapter 1: nat
web21: Adapter 2: hostonly
==> web21: Forwarding ports...
web21: 22 => 2200 (adapter 1)
web21: 821 => 8821 (adapter 1)
==> web21: Booting VM...
==> web21: Waiting for machine to boot. This may take a few minutes...
web21: SSH address: 127.0.0.1:2200
web21: SSH username: vagrant
web21: SSH auth method: private key
web21: Warning: Connection timeout. Retrying...
==> web21: Machine booted and ready!
==> web21: Checking for guest additions in VM...
==> web21: Setting hostname...
==> web21: Configuring and enabling network interfaces...
==> web21: Mounting shared folders...
web21: /vagrant => /Users/mbcx9rvt/Sites/UBC/CTLT/installs/spaces/vagrant/verf/shared/nfs
==> web21: Running provisioner: shell...
web21: Running: inline script
web11-provision.sh
==> web21: Running provisioner: shell...
web21: Running: inline script
+++exists+++
==> web21: Running provisioner: shell...
web21: Running: /var/folders/c6/1yd6r3px03j_l3f4g0kfkjfm0000gn/T/vagrant-shell20141022-35420-1bv1h0u
Check for apt packages to install...
httpd,
php,
php-gd,
php-pear,
php-xml,
php-xmlrpc,
php-mbstring,
php-mcrypt,
php-tidy,
curl,
curl-devel,
php-pecl-apc
No yum packages to install.
==> web21: Running provisioner: shell...
web21: Running: inline script
web21-provision.sh
==> web21: Running provisioner: shell...
web21: Running: inline script
PROVISION FILE DOES NOT EXIST!
==> web21: Running provisioner: shell...
web21: Running: inline script
!!!thisname!!!! web21
==> web21: Running provisioner: shell...
web21: Running: inline script
!!!thisip!!!! 192.168.1.821
==> web21: Checking for host entries
==> web21: adding to (/etc/hosts) : 192.168.1.821 web21.vagrant # VAGRANT: ed18947cb0a37a2d7811d08949b44331 (web21) / b33cde0c-da4f-4739-9f0e-332f0bfd1b67
==> learninglocker: Importing base box 'puppetlabs/centos-6.5-64-puppet'...
==> learninglocker: Matching MAC address for NAT networking...
==> learninglocker: Checking if box 'puppetlabs/centos-6.5-64-puppet' is up to date...
==> learninglocker: Setting the name of the VM: verf_learninglocker_1413999103267_74239
==> learninglocker: Fixed port collision for 22 => 2200. Now on port 2201.
==> learninglocker: Clearing any previously set network interfaces...
==> learninglocker: Preparing network interfaces based on configuration...
learninglocker: Adapter 1: nat
learninglocker: Adapter 2: hostonly
==> learninglocker: Forwarding ports...
learninglocker: 22 => 2201 (adapter 1)
learninglocker: 899 => 8899 (adapter 1)
==> learninglocker: Booting VM...
==> learninglocker: Waiting for machine to boot. This may take a few minutes...
learninglocker: SSH address: 127.0.0.1:2201
learninglocker: SSH username: vagrant
learninglocker: SSH auth method: private key
learninglocker: Warning: Connection timeout. Retrying...
==> learninglocker: Machine booted and ready!
==> learninglocker: Checking for guest additions in VM...
==> learninglocker: Setting hostname...
==> learninglocker: Configuring and enabling network interfaces...
==> learninglocker: Mounting shared folders...
learninglocker: /vagrant => /Users/mbcx9rvt/Sites/UBC/CTLT/installs/spaces/vagrant/verf/shared/nfs
==> learninglocker: Running provisioner: shell...
learninglocker: Running: inline script
web11-provision.sh
==> learninglocker: Running provisioner: shell...
learninglocker: Running: inline script
+++exists+++
==> learninglocker: Running provisioner: shell...
learninglocker: Running: /var/folders/c6/1yd6r3px03j_l3f4g0kfkjfm0000gn/T/vagrant-shell20141022-35420-17ptv1r
Check for apt packages to install...
httpd,
php,
php-gd,
php-pear,
php-xml,
php-xmlrpc,
php-mbstring,
php-mcrypt,
php-tidy,
curl,
curl-devel,
php-pecl-apc
No yum packages to install.
==> learninglocker: Running provisioner: shell...
learninglocker: Running: inline script
web21-provision.sh
==> learninglocker: Running provisioner: shell...
learninglocker: Running: inline script
PROVISION FILE DOES NOT EXIST!
==> learninglocker: Running provisioner: shell...
learninglocker: Running: inline script
learninglocker-provision.sh
==> learninglocker: Running provisioner: shell...
learninglocker: Running: inline script
PROVISION FILE DOES NOT EXIST!
==> learninglocker: Running provisioner: shell...
learninglocker: Running: inline script
!!!thisname!!!! learninglocker
==> learninglocker: Running provisioner: shell...
learninglocker: Running: inline script
!!!thisip!!!! 192.168.1.899
==> learninglocker: Checking for host entries
==> learninglocker: adding to (/etc/hosts) : 192.168.1.899 learninglocker.vagrant # VAGRANT: 36d4e82ec2f09084a7e5cd6ebb66c900 (learninglocker) / c338507a-aa8e-41fa-af79-04deb0e124d2
Damn it.
Always the way. Ask a question and then find the answer.
I have config.vm.provision a few times in each rather than app_config.vm.provision
i.e. it should be
app_servers.each do |key,value|
boxname = value[:name]
config.vm.provision :shell, inline: 'echo boxname: ' + boxname
config.vm.define boxname do |app_config|
app_config.vm.provision "shell", inline: "echo !!!thisname!!!! #{key}"
app_config.vm.provision "shell", inline: "echo !!!thisip!!!! #{value[:ip]}"
app_config.vm.box = value[:box]
app_config.vm.host_name = "%s.vagrant" % value[:name]
app_config.vm.network "private_network", ip: value[:ip]
app_config.vm.network "forwarded_port", guest: value[:forwarded_port_guest], host: value[:forwarded_port_host]
app_config.ssh.forward_agent = true
provision_filename = key.to_s + "-provision.sh"
app_config.vm.provision "shell", inline: "echo #{provision_filename}"
# provisioning
if File.exists?(File.join(vagrant_dir,'provision',boxname + "-provision.sh")) then
app_config.vm.provision "shell", inline: "echo +++exists+++"
app_config.vm.provision :shell, :path => File.join( "provision", boxname + "-provision.sh" )
else
app_config.vm.provision "shell", inline: "echo PROVISION FILE DOES NOT EXIST!"
end
# Shared NFS folder
# app_config.vm.synced_folder "shared/nfs/", "/vagrant/", type: "nfs"
app_config.vm.synced_folder "shared/nfs/", "/vagrant/"
end # config.vm.define opts[:name] do |config|
end # app_servers.each

Resources