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

Is it possible to require certain Vagrant and VirtualBox versions in Vagrantfile?

I recently noticed that I managed to have a version of Vagrant and VirtualBox installed that did not work with my Vagrantfile. Upgrading to the latest Vagrant & VirtualBox fixed the problem. Is it possible to ensure minimum Vagrant and VirtualBox…
Ville Mattila
  • 1,343
  • 3
  • 15
  • 28
4
votes
3 answers

Remove line in host's known_host file through Vagrant

I've narrowed down this question - regarding a MySQL over SSH connection only working once - to a conflicting line in my host computer's known_hosts file. Essentially, I can not get into my Database GUI of choice because the key is different for the…
user393219
3
votes
0 answers

Vagrant setup error: There was an error while executing `VBoxManage`, a CLI used by Vagrant for controlling VirtualBox

i am new to coding and am currently facing an annoying issue when installing Vagrant and it is stopping from completing my studies, i am using: macOS Big Sur 11.3.1 on a MacPro I've tried uninstalling / installing both Vagrant and Virtualbox using…
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
1 answer

Add string with backslash in file using sed command

I need to add a text string: --with-mpm=event \ to httpd.spec on 138th position. I tried: sed -i '138i--with-mpm=event \\' /root/rpmbuild/SPECS/httpd.spec This code runs in bash script of Vagrantfile during bootstrapping virtual machine. However,…
ERemarque
  • 497
  • 3
  • 16
3
votes
3 answers

Kernel driver not installed (rc=-1908) Mac High Sierra 10.13

I'm currently running vargant version 2.1.5 on my mac high sierra 10.13.6 So after completing the vagrant init and vagrant up command I'm suppose to have a fully running virtual machine in virtualbox. But after running vagrant up I get this…
3
votes
1 answer

Vagrantfile for Centos 6 LAMP stack

I need assistance putting together a Vagrantfile. I am trying to setup a virtual machine on my Windows desktop for working on an existing PHP/MySQL application. I've been instructed to use Vagrant and VirtualBox. I've been going through the…
Tanoro
  • 871
  • 2
  • 10
  • 30
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

Adding Box to Vagrant

I've created a new box for use with the Hyper-V provider. When I try to add the box, it dies with the following: PS C:\> vagrant box add sbx-misc-app01 .\img-misc-w2k16.box ==> box: Box file was not detected as metadata. Adding it directly... ==>…
Adam
  • 3,891
  • 3
  • 19
  • 42
3
votes
0 answers

"AttributeError: 'psycopg2' has no attribute '__version__'" when switching from sqlite to postgres with Django - Vagrant

I'm a newbie in Django/Python. I just setup Django successfully with vagrant on my computer. But I want to change the default database from sqlite to postgresql. To do so, I just changed the database section on the setting.py file to : # Database #…
kabrice
  • 1,475
  • 6
  • 27
  • 51
3
votes
0 answers

How can I access a Vagrant Config object as a string variable in a Vagrantfile?

A Vagrant base box sets config.ssh.username to a certain value. I have a Vagrantfile where I want to use that value in a string. If I create a string like "prefix_#{config.ssh.username}_suffix" the expansion looks like…
Prof. Moriarty
  • 601
  • 1
  • 6
  • 10
3
votes
0 answers

Docker fails with error inside debian vagrant box

Inside a Vagrant box with Docker version 17.11.0-ce build 1caf76c, this docker command fails: docker run mongo:3.4 -v /home/vagrant/src/db:/db -p 27017:27017 --name mongo with the following error message: docker: Error response from daemon:…
User9123
  • 179
  • 9
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…
3
votes
3 answers

Vagrant looking for Java in the wrong directory

I am running a VM using Vagrant. When I try to start up (provision) the VM, it keeps giving me the following error: ==> default: The following packages have unmet dependencies: ==> default: openjdk-8-jdk : Depends: openjdk-8-jre (=…
user7933742
3
votes
1 answer

Create Virtual Hosts in Vagrant Server

I am running Apache server with vagrant and I want to access multiple websites from host machine. Current setup looks like this: Vagrantfile: Vagrant.configure("2") do |config| config.vm.box = "ubuntu/trusty64" config.ssh.forward_agent =…
RNK
  • 5,582
  • 11
  • 65
  • 133