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
15
votes
2 answers

GuestAdditions version mismatch

when I use this command: vagrant up I obtain this error: [machine1] GuestAdditions versions on your host (4.3.36) and guest (5.0.10) do not match. how can I update guest addition from ubuntu shell?
Polly
  • 637
  • 3
  • 12
  • 25
15
votes
1 answer

Vagrantfile syntax highlight in PyCharm

I use Vagrant plugin for running VMs, but I still desire to set up Vagrantfile syntax highlight in PyCharm. Is it possible? Thanks in advance!
kagarlickij
  • 7,327
  • 10
  • 36
  • 71
15
votes
1 answer

Answering prompt using vagrant file?

Is it possible to add a script to a Vagrantfile that answers a prompt. I am provisioning a ubuntu box for docker config.vm.box = "ubuntu" config.vm.provision :shell, :inline => "sudo apt-get update" config.vm.provision :shell, :inline => "sudo…
user3689824
  • 153
  • 1
  • 5
15
votes
7 answers

Error when doing vagrant up

I get this error when I do a vagrant up : anr@anr-Lenovo-G505s ~ $ vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==> default: Box 'base' could not be found. Attempting to find and install... default: Box Provider:…
vamsiampolu
  • 6,328
  • 19
  • 82
  • 183
15
votes
2 answers

Why is Vagrant trying to SSH to Windows guest?

My host is running Windows 7 Pro (64 bit). The Guest OS in this case is Windows Server 2008 R2. The 'vagrant up' command is running into an issue where I keep getting: ****default: SSH address: 127.0.0.1:2222 default: SSH username: vagrant default:…
akshtray
  • 161
  • 1
  • 1
  • 4
14
votes
1 answer

Vagrant + Ansible + Python3

I have a Vagrantfile that is simplified to: Vagrant.configure(2) do |config| config.vm.box = "ubuntu/xenial64" config.vm.boot_timeout = 900 config.vm.define 'srv' do |srv| srv.vm.provision 'ansible' do |ansible| …
clay
  • 18,138
  • 28
  • 107
  • 192
14
votes
1 answer

Is there any way to retry playbooks from where they failed?

Is there any way to retry playbooks from where they failed? I'm starting it with vagrant provision
Javier Manzano
  • 4,761
  • 16
  • 56
  • 86
14
votes
6 answers

How can I upload more than one file with vagrant file provisioning?

In a Vagrant setup, I have to upload a couple of files from the host to the guest during the provisioning phase. In https://docs.vagrantup.com/v2/provisioning/file.html I can see how to upload a single file, from a source to a destination, but how…
Giacomo Tesio
  • 7,144
  • 3
  • 31
  • 48
14
votes
1 answer

Shall I version the .vagrant folder

We have a vagrant project where we manage our production machines, what will be the best way for us to share the their status? For now I've shared the .vagrant folder via the git repo? Is this the best way to do it?
Calin
  • 6,661
  • 7
  • 49
  • 80
13
votes
3 answers

Vagrant port forwarding for Mysql

I am trying to setup port forwarding in Vagrantfile to connect to guest mysqld from host system, but get reading initial communication packet error. Host: Yosemite, Guest: Trusty, vagrant 1.7.4 Vagrantfile(host): config.vm.network "forwarded_port",…
Alex Blex
  • 34,704
  • 7
  • 48
  • 75
13
votes
3 answers

Vagrant Config Error - "A box must be specified."

The boxes were working fine. Then I halted one (the only one running at the time) and now I can't get either of them back up. Running vagrant up [name] gives me the following error, regardless of which I pick or whether I leave it at vagrant up for…
Sam A. Horvath-Hunt
  • 931
  • 1
  • 7
  • 20
13
votes
6 answers

Vagrantfile. Set locale for ssh agent

I have a problem described here This problem appears because host machine put locale to guest via ssh. What is the proper way to solve this? How I can force vagrant ssh to do this: LC_ALL=en_US.UTF-8 vagrant ssh each time?
kharandziuk
  • 12,020
  • 17
  • 63
  • 121
13
votes
1 answer

Vagrant file for .NET Developer (with Windows, IIS, MS SQL)

I'm looking for Vagrant file which can be used as base for .NET Developers.
Dmitry Zaets
  • 3,289
  • 1
  • 20
  • 33
12
votes
3 answers

Vagrant VMWare Public: Unable to set static automatically

I am using the VMWare Plugin. I am currently using the following : config.vm.network "public_network", ip: "172.17.255.13", netmask: "255.255.255.0" It does indeed make a BRIDGED connection, however it is a BRIDGED DHCP Connection. Has anybody used…
grepsedawk
  • 3,324
  • 2
  • 26
  • 49
12
votes
2 answers

In Vagrant, can I set a provisioner to only ever run manually?

In my Vagrantfile, I have a provisioner like so: config.vm.provision "reset", type: "shell", run: "always" do |s| s.privileged = false s.inline = "bash /path/to/my/reset/script.sh" end And when normally provisioning vagrant, it runs fine.…
skift
  • 1,027
  • 2
  • 16
  • 27
1 2
3
66 67