Questions tagged [vagrantfile]

Vagrantfiles are configuration files for vagrant. The Vagrantfile describes the type of virtual machine, and how to configure and provision the vm.

The primary function of the Vagrantfile is to describe the type of machine required for a project, and how to configure and provision these machines. Vagrantfile are called Vagrantfiles because the actual literal filename for the file is Vagrantfile (casing doesn't matter).

Vagrant is meant to run with one Vagrantfile per project, and the Vagrantfile is supposed to be committed to version control. This allows other developers involved in the project to check out the code, run vagrant up, and be on their way. Vagrantfiles are portable across every platform Vagrant supports.

The syntax of Vagrantfiles is , but knowledge of the programming language is not necessary to make modifications to the Vagrantfile, since it is mostly simple variable assignment. In fact, isn't even the most popular community Vagrant is used within, which should help show you that despite not having Ruby knowledge, people are very successful with Vagrant.

1000 questions
4
votes
1 answer

Vagrant shell provisioner repeats five times

The shell provisioner is running five times, and I cannot find why this is happening. My Vagrantfile: Vagrant.configure("2") do |config| config.vm.box = "papasmurf/win2016base" config.vm.communicator = "winrm" config.winrm.username =…
4
votes
5 answers

unknown filesystem type 'vboxsf' after vagrant up

i want to setup environment using vagrant but display error after vagrant up. here is my spec im using : - OS X Yosemite Version 10.10.5 - VirtualBox vesion 5.2.6 - Vagrant 2.0.1 and this is my Vagrant file Vagrant.configure("2") do |config| …
tjandra
  • 85
  • 1
  • 2
  • 7
4
votes
1 answer

Rails doesn't detect file changes and config.reload_classes_only_on_change makes the server too slow

First of all I don't know if this is a bug or not. Until now I've been using this command in rails development.rb environment config so the box detects changes on my files: config.reload_classes_only_on_change = false But now, with Rails 5.2 and…
4
votes
2 answers

How to specify a provider during `vagrant up` command?

I have two machines (linux, Mac) and need to use vagrant to manage the vm. VirtualBox is used in the Liux while parallels is used in Mac. so I configured these two providers in the vagrant config file as below: Vagrant.configure('2') do |config| …
Joey Yi Zhao
  • 37,514
  • 71
  • 268
  • 523
4
votes
1 answer

Vagrant with Docker provider: specifying CPU and Memory

I'm using Vagrant to create several Docker containers. Everything seems to work well except I can't control CPU and memory allocation to the containers. Below you can see a couple of failed attempts. VAGRANTFILE_API_VERSION =…
zenlc2000
  • 451
  • 4
  • 9
4
votes
1 answer

Is "vagrant up" possible from different local directories with custom URLs?

I have two directories under /var/www/html, named vlp1 and vlp2 with Vagrant setup. If I run vagrant up separately in these folders the default local URL is vagrant.local for both. But vagrant.local/ always loads site from vlp1 folder. As it should…
Subrata Sarkar
  • 2,975
  • 6
  • 45
  • 85
4
votes
1 answer

Vagrant reporting a port collision which has nothing running on it

I'm getting a port collision on all the ports in my Vagrantfile which seems to work fine for a time then suddenly something changes and it refuses to work. Please no answers saying "change your port" Vagrant cannot forward the specified ports on…
Nick
  • 589
  • 1
  • 7
  • 28
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

run python script on vagrant up

I'm trying to run a vagranfile that will result in a running python flask app. I've tried using this as the last command to achieve this - config.vm.provision :shell, :path => "python app.py" But it resulted with the following error - *pathfor…
Yaron Idan
  • 6,207
  • 5
  • 44
  • 66
4
votes
1 answer

Multiple Vagrant VMs via PuPHPet with different configs

I feel like I'm missing something fundamental. How do I use PuPHPet to define two machines in one vagrantfile, both Ubuntu 14.04, but one with mysql installed and one with elasticsearch? I see how to define multiple machines, but the config of each…
Matt Fletcher
  • 345
  • 3
  • 15
4
votes
1 answer

Vagrant: 192.168.33.10 refused to connect

Hi, I installed centOS6 in virtual machine by vagrant and also installed httpd and php. But, when I try to access to http://192.168.33.10 which is the ip address I set in the Vagrantfile, I can't open a webpage. I made some files under…
user5809117
4
votes
1 answer

Conifgure VBoxManage commands that require VM be running from Vagrantfile

There are several commands under the VBoxManage umbrella that require the guest machine already be running (e.g. controlvm, guestcontrol) but all the vbox configuration I see in the Vagrantfile happens before the machine has started. Is there a way…
user2859458
  • 2,285
  • 1
  • 17
  • 27
4
votes
2 answers

Vagrant runs wrong provisioning file when booting multiple machines

I have the following vagrantfile, which specifies 2 machines - the frontend and the backend box. Vagrant.configure(2) do |config| config.vm.box = "frontend" config.vm.network "private_network", ip: "192.168.0.5" config.vm.provider…
BlackSpy
  • 5,563
  • 5
  • 29
  • 38
4
votes
1 answer

How to enable hot reloading via shared folders with Vagrant VM?

I have a very basic react/redux app utilizing hot reloading (i.e. when I save a change to my source code, it updates the contents of my app accordingly in browser, preserving the state of my app) via webpack. This works on myhost machine. However,…
Jimmy Gong
  • 1,825
  • 5
  • 20
  • 35
4
votes
1 answer

Vagrant config terminology

TL;DR; Can someone help me understand the difference between these "names" defined in a Vagrantfile? config.vm.define "worker" box.vm.box = "ots-box" box.vm.host_name = "worker" vb.name = "barhost" While trying to change the hostname of the…
Kashyap
  • 15,354
  • 13
  • 64
  • 103