Provisioners in Vagrant allow you to automatically install software, alter configurations, and more on the machine as part of the vagrant up process. Vagrant gives you multiple options for provisioning the machine, from simple shell scripts to more complex, industry-standard configuration management systems.
Questions tagged [vagrant-provision]
210 questions
4
votes
1 answer
Vagrantfile PHP v5.6 specified but v5.5 installed
I have a Vaprobash VagrantFile building a Ubuntu Nginx stack.
In it I specify PHP v5.6:
php_version = "5.6" //Options: 5.5 | 5.6
However, I run
$ vagrant up
when I ssh into the box and do
$ php -v
it shows PHP 5.5.9-1ubuntu4.20 (cli) (built:…

Nik K
- 141
- 1
- 8
4
votes
2 answers
Vagrant custom box metadata.json file
I have a custom box named package.box. I get this error when trying to vagrant up, vagrant box add. I created a metadata.json file with different configurations but with no luck. I don't understand this message. I use virtualbox for provisioning.
I…

etudor
- 1,183
- 1
- 11
- 19
4
votes
2 answers
How execute commands as another user during provisioning on Vagrant?
Vagrant executes my scripts as root during provision. But I would like to execute, during the provisioning time, some commands as another user.
This is how I'm doing at the moment:
su - devops -c "git clone git://github.com/sstephenson/rbenv.git…

Valter Silva
- 16,446
- 52
- 137
- 218
3
votes
2 answers
Vagrant box not getting set up running under WSL2
Vagrant version
Vagrant 2.2.10
Host OS
Windows 10 (20045, May 2020)
Guest OS
Ubuntu 18.04 (tried with 16.04, 20.04)
Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.synced_folder ".", "/vagrant",…

Keith
- 51
- 2
- 9
3
votes
1 answer
Laravel/Homestead Invalid IP Address
I am using Laravel 6.2, Vagrant 2.2.6 and VirtualBox 5.2. Followed the tutorial for Homestead setup. But when I visited myapp.local (out of the box without modifying any code), I got the following error message:
NotFoundHttpException in…

KalC
- 1,530
- 3
- 22
- 33
3
votes
0 answers
vagrant unsync folder not working for custom directory
Our vagrant setup includes a Vagrant file that installs some softwares at the time of vm provisioning.
For this we have the archive of softwares that we want to install and some installation scipts.
These software archives and installation scripts…

mogli
- 1,549
- 4
- 29
- 57
3
votes
2 answers
Can I force provisioning to happen before mounting shared folders in Vagrant?
I have the following Vagrantfile:
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "centos/6"
config.vm.provision :shell, :path => "bootstrap.sh"
config.vm.network :forwarded_port, host: 8080, guest:…

ReynierPM
- 17,594
- 53
- 193
- 363
3
votes
1 answer
Vagrant -v Ignoring ffi -nokogiri and unf_ext because its extensions are not built
After trying to setup vagrant I get this output on flag -v
vagrant -v
Ignoring ffi-1.9.14 because its extensions are not built. Try: gem pristine ffi --version 1.9.14
Ignoring nokogiri-1.6.7.1 because its extensions are not built. Try: gem…

Dimitris
- 91
- 6
3
votes
0 answers
how to take the input from user in Vagrant bash provisioning?
I want to take the userid and password as parameters for vagrant and then add them as environmental variable for deploying build. Earlier I was using a file to store credentials and using sync folder for passing them to the vagrant. Since its not…

Rohan Kankapurkar
- 115
- 1
- 8
3
votes
1 answer
How do I provision a personal database during first vagrant up?
We've got a multi-machine Vagrantfile in our project repo which sets up a LAMP stack and creates some common MySQL databases. Now, each of us also have a personal database that we'd like Vagrant to create as part of the initial "vagrant up"…

Johan Fredrik Varen
- 3,796
- 7
- 32
- 42
3
votes
1 answer
Specify custom location for Rubygems to install via package type
I've installed Ruby in a custom location (on an Ubuntu box, into /opt/rubies using ruby-install) and when it comes to declarations like this:
package { 'bundler':
ensure => 'installed',
provider => 'gem',
require => Exec["Install…

ian
- 12,003
- 9
- 51
- 107
3
votes
2 answers
Add max_allowed_packet to my.cnf in vagrant environment
So I have a box that includes a mysqldump file executed at provision. The problem now is that I need to increase the max_allowed_packet variable before execute this script.
How can I do something like:
max_allowed_packet = 128M >> /etc/my.cnf
but…

Alwin Kesler
- 1,450
- 1
- 20
- 41
3
votes
2 answers
Vagrant java 1.6 to 1.8
I Installed vagrant on my machine with hashicorp-precise32 virtual machine. It installed java 1.6 whereas i want java 1.8. Do i have to install another virtual machine? How to get java 1.8?

P.K
- 87
- 1
- 9
2
votes
1 answer
Vagrant: how to have shell scripts run prior to ansible provisioning?
We are currently running into an issue, with Vagrant, where certain CLI commands need to be run before Ansible provisionning:
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
curl…

Andre M
- 6,649
- 7
- 52
- 93
2
votes
0 answers
when i am doing vagrant up i am facing this error regarding could not resolve host
when i am doing vagrant up i am facing this error.
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
Could not resolve host: vagrant-boxes.cargomedia.ch

Dhaval Shah
- 144
- 1
- 8