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
7
votes
0 answers

Rename an already-created VM in vagrant

I have a VM created by Vagrant which is currently in 'saved' state. I want to preserve the state, but also want to change it's name as it is becoming difficult to organize many VMs I have created by vagrant. Is there an easy way to rename them? If I…
Rushi Agrawal
  • 3,208
  • 2
  • 21
  • 26
7
votes
1 answer

Vagrant + Ansible resolving super slow

I created a VM using Vagrant and Ansible and when i try to use it after it is booted i note that it is extremely slow. I'm also using a remote DB in the cloud but it seems not to be the cause of the slow response. By slow response i mean about 5secs…
mbalparda
  • 199
  • 1
  • 8
7
votes
2 answers

Vagrant synced folder options

What is the best method for implementing Vagrant NFS "synced folders" between host and VM? I was finally able to get NFS working, in general, but it required several tweaks within the VM; and I'm not sure how to automate those changes for others to…
Douglas Choma
  • 163
  • 1
  • 2
  • 7
7
votes
6 answers

Having problems accessing port 5000 in Vagrant

I am trying to teach myself Flask in a Vagrant environment. I understand that Flask runs a server on port 5000 by default. In my Vagrantfile I have: config.vm.network :forwarded_port, guest: 80, host: 8080 config.vm.network :forwarded_port, guest:…
verbsintransit
  • 888
  • 3
  • 8
  • 18
7
votes
3 answers

Editing php.ini on vagrant box

Does anyone know how to edit the mail setting in the php.ini file by using Vagrant. so I would ssh in terminal like so: cd myapp vagrant ssh then what>?
the_unforgiven_II
  • 361
  • 3
  • 10
  • 28
7
votes
3 answers

How to specify provisioner defaults in Vagrant for multi-machine environments?

I'm wondering if there is a way to specify defaults for provisioners when creating a multi-machine environment with Vagrant? I was trying to do something like the following: Vagrant.configure("2") do |config| config.vm.box =…
Andy Shinn
  • 26,561
  • 8
  • 75
  • 93
6
votes
0 answers

How to specify network when provisioning in vagrant

I have multiple networks specified in my vagrantfile and only one of them are accessible from outside. When the vagrant starts provisioning, sometimes it chooses the wrong network (IP) to connect to the VM and it fails. Is it possible to specify…
Teymur
  • 63
  • 7
6
votes
3 answers

Upgrading Vagrant in Ubuntu 16.04

I currently have Vagrant 1.8.1 installed in my Ubuntu 16.04 I'm thinking to upgrade it to Vagrant 2.0.0 The problem is I'm not sure if my vagrant files and VMs gets removed if I directly install Vagrant 2.0.0 using apt-get install vagrant. Is it…
Sukumar
  • 173
  • 2
  • 3
  • 10
6
votes
2 answers

Vagrant up keep asking for a password

At first I got this error: Text will be echoed in the clear. Please install the HighLine or Termios libraries to suppress echoed text. vagrant@127.0.0.1's password: Then I installed: HighLine Now I only get: vagrant@127.0.0.1's password: I…
jnbdz
  • 4,863
  • 9
  • 51
  • 93
6
votes
2 answers

vagrant port forwarding doesn't work: Connection reset by peer

ssh port forwarding (which is enabled by default) works fine, but my custom port forwardings don't. I took the config below from the official docs, but it doesn't work :( host machine runs Ubuntu 17.04 Vagrantfile is: Vagrant.configure("2") do…
whyer
  • 783
  • 5
  • 16
6
votes
2 answers

Connecting to Vagrant Box with MySQL Workbench

I'm getting started with Vagrant. I'm trying to connect to Scotch Box with MySQL Workbench. First I did succeed to connect to mysql with a PHP script inside the box, but I can't do it with MySQL Workbench. Here is my…
Antoine
  • 472
  • 2
  • 11
  • 21
6
votes
2 answers

Output: mount.nfs: requested NFS version or transport protocol is not supported

I am trying out the Kubernetes NFS volume claim in a replication controller example [1]. I have setup the NFS server, PV and PVC. And my replication controller looks like this apiVersion: v1 kind: ReplicationController metadata: name:…
Vishanth
  • 1,320
  • 3
  • 14
  • 26
6
votes
4 answers

Vagrant Refused via browser

I am very new to using Vagrant in my development workflow, however when setting up the box using vagrant up and then accessing it via my host i get a connection refused with my browser. Is all that needs to be done to work is: vagrant init…
user4815703
6
votes
2 answers

Local Packer Box Versioning

Is it possible to version a box created/hosted entirely on my local machine using Packer without publishing it on the HashiCorp Atlas? When I do a vagrant box list I get something like the following: vagrant box list Win8 (virtualbox,…
Joel B
  • 12,082
  • 10
  • 61
  • 69
6
votes
7 answers

How to fix Vagrant error: `private_key_path` file must exist:

I've been using PuPHPet to create virtual development environments. Yesterday I generated a config file for a new box. When I try to spin it up using the vagrant up command, I get the following error message: C:\xx>vagrant up Bringing machine…
Mr B
  • 3,980
  • 9
  • 48
  • 74