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
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
1 answer

Vagrant shared folder without sync

How can I have a shared folder (access to the same folder from both host and guest machines) WITHOUT any syncing method running? (I want to use my own rsync script which is exactly what I need without the Vagrant file sharing performance…
poshest
  • 4,157
  • 2
  • 26
  • 37
3
votes
1 answer

Vagrant - Install Ruby Gems

When run vagrant provision, instead of install the ruby gems in user environment, install in the root user environment. Here is my vagrant file: # -*- mode: ruby -*- # vi: set ft=ruby : Vagrant.configure("2") do |config| config.vm.box =…
jvrdom
  • 358
  • 1
  • 8
  • 18
3
votes
1 answer

Vagrant: How to configure vagrant to use different Vagrantfiles

How to use Vagrant for testing e.g. an application running on a Debian, Ubuntu, SuSE etc. VM. Current project is having one Vagrantfile having configuration inside. To start the Vagrant VM I'm running vagrant up vagrant provision Now I'm wondering…
frlan
  • 6,950
  • 3
  • 31
  • 72
3
votes
2 answers

Vagrant: Why forward database ports?

I'm a vagrant newbie trying to configure his first instance. But wherever I look on Vagrantfiles configuring PostgreSQL they're always using port forwarding to the host. config.vm.network :forwarded_port, host: 5432, guest: 5432 What is the point…
Krzysztof Wende
  • 3,208
  • 25
  • 38
3
votes
1 answer

Configure multiple monitors with vagrant

How to configure multiple monitors for the provider vmware-workstation in Vagrantfile? For the provider virtualbox this can be done as follows: config.vm.provider :virtualbox do |vb| vb.gui = true vb.customize ["modifyvm", :id,…
Michael K.
  • 1,738
  • 2
  • 17
  • 35
3
votes
2 answers

Getting Vagrant to work with AWS

I'm new to both Vagrant and AWS but trying to get the two to play together. I'm following the instructions here, but something doesn't seem correct. So far my steps are : List item Log into AWS Console Go into IAM Create user…
DelOne
  • 31
  • 3
3
votes
1 answer

Vagrantfile packaged in box (via packer) is not used

I used packer to create a vagrant box for a workshop I am running, and packaged vagrantfile in the box via the vagrantfile_template directive in the Vagrant post-processor as shown: ... "post-processors": [{ "type": "vagrant", …
frasertweedale
  • 5,424
  • 3
  • 26
  • 38
3
votes
1 answer

creating vagrant public network on windows PC

I am trying to setup public network for the vagrant box am setting up and i use Windows 10. If i do not put the interface name, vagrant asks for the interface name and without putting what vagrant wants it won't work. So my question is how do i get…
uberrebu
  • 3,597
  • 9
  • 38
  • 73
3
votes
2 answers

Vagrant: do not map hostname to loopback address in /etc/hosts

I am using Vagrant (v1.7.2) to provision Linux (Fedora 22) hosts, and the vagrant-hostmanager plugin (v1.6.1) to write /etc/hosts so that hosts can access each other. My Vagrantfile: Vagrant.configure(2) do |config| config.vm.box = "workshop" …
frasertweedale
  • 5,424
  • 3
  • 26
  • 38
3
votes
1 answer

Vagrant nfs sync folder issue with Ubuntu Host

I'm trying to run vagrant in a Ubuntu host with nfs enabled, but it's getting an error while I try to run vagrant. These are my specifications: Host : Ubuntu 14.04 LTS Guest : Ubuntu 14.04 LTS Virtual box version : 5.0.4 Vagrant version :…
Fellipe S
  • 33
  • 1
  • 5
3
votes
0 answers

Changing user during vagrant provisioning

I want to use vagrant to setup developer machines. Since the machine will talk to the servers inhouse, I thought it a good idea that they are setup with the same usernames the developers have on their host machine. I'm having trouble figuring out…
anr78
  • 1,308
  • 2
  • 17
  • 31
3
votes
1 answer

Vagrant and synced folders: How to set the owner to a user other than the default vagrant user?

I am trying to set up a development environment for a Rails 2 project within a CoreOS Vagrant VM that has a number of moving parts. Once the VM is provisioned there is a Puppet script that installs all the bits and pieces and starts them up. The bit…
Dave Sag
  • 13,266
  • 14
  • 86
  • 134
3
votes
3 answers

How can I have git ignore local changes to a specific file, without modifying the .gitignore?

My specific situation is this: I am working with a team on a git repo. We are using a vagrant machine, so in the git repo there is a Vagrantfile. I would like to modify my vagrant machine's configuration file to use specific amounts of memory and…
KevEllis
  • 143
  • 1
  • 1
  • 5
3
votes
0 answers

Array args with host environment variables for vagrant shell provisioner?

I have the following in a Vagrantfile (vagrant 1.7.4), arg1=ENV['LINUX_USERNAME'] arg2=ENV['LINUX_PASSWORD'] config.vm.provision "shell" do |s| s.path="create_user.bash" s.args = [arg1, arg2] end Edit: Update missing information I also have…
Gabriel
  • 10,524
  • 1
  • 23
  • 28