17i72q
Last Updated: July 27, 2016
·
10.36K
· akalyaev
D83b63db79b42978fe35e120550ca180

Vagrant tips

This is the list of Vagrant configuration options and plugins which I found very useful. Also downstairs are the lists of tools, services and other interesting things :)

Config options

Provide default box url

config.vm.box_url = "http://dl.dropbox.com/u/937870/VMs/squeeze64.box"

This is used if the box doesn't already exist. When vagrant up is called and the box is not found, this option is used to download the box.

Use NFS for syncing folders

config.vm.synced_folder "~/Dropbox", "/Dropbox", :nfs => true

It's much faster. Read https://coderwall.com/p/uaohzg for more info.

Note Some people have reported problems with permissions. This may be due to duplicated records in /etc/exports (when you are using the same IP address across all of your boxes). So, please, give each of your boxes an unique IP address.

Forward your SSH keys into Vagrant box

config.ssh.forward_agent = true

I use this to deploy my apps from inside the box. Very useful!

Plugins

vagrant-vbguest

vagrant plugin install vagrant-vbguest

This plugin will automatically install (or just check that versions are the same) the host's VirtualBox Guest Additions on the guest system.

vagrant-berkshelf

vagrant plugin install vagrant-berkshelf

Berkshelf integration. Vagrant will automatically run it before any provisioning step.

vagrant-librarian-chef

vagrant plugin install vagrant-librarian-chef

Librarian-Chef integration. Vagrant will automatically run it before any provisioning step.

vagrant-omnibus

vagrant plugin install vagrant-omnibus

Installs latest Chef-solo. (Thanks to @tralamazza)

vagrant-cachier

vagrant plugin install vagrant-cachier

A Vagrant plugin that helps you reduce the amount of coffee you drink while waiting for boxes to be provisioned by sharing a common package cache among similiar VM instances. (Thanks to @juliendubreuil)

Providers

Tools

veewee

A tool for easily (and repeatedly) building custom Vagrant base boxes, KVMs, and virtual machine images. (Thanks to @av-ast)

Services

Rove.io

Rove.io is a service that allows you to pregenerate typical Vagrant builds (Chef).

PuPHPet

A simple GUI to set up virtual machines for PHP Web development (Puppet).

Boxes lists


Feel free to leave a comment if you have something to add.

Say Thanks
Respond

11 Responses
Add your response

7862
C24ce8d41d4134d3d616fbd486162c38

A list of of ready-to-use Vagrant boxes http://www.vagrantbox.es/

over 1 year ago ·
7863
C24ce8d41d4134d3d616fbd486162c38

https://github.com/jedi4ever/veewee
A tool for easily (and repeatedly) building custom Vagrant base boxes, KVMs, and virtual machine images.

over 1 year ago ·
7864
Aa378bad44eb16e0530a76c0ddb4f0b5

If you have a box on a remote server and it gets stuck at boot time, you can run it with the RDP-server.

First, you need install Oracle Extension Pack

# VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.2.16-86992.vbox-extpack

Next step, is to get VirtualBox name for vagrant box:

# VBoxManage list vms
"vagrant_1373795168" {e76864cc-ee28-46f3-86a6-7b684b299f3a}

Finally, start your box directly from VirtualBox

# VBoxHeadless --startvm "vagrant_1373795168" -v on --vrdeproperty "TCP/Address"=192.168.0.231 --vrdeproperty "TCP/Ports"=3389 --vrdeproperty "VNCPassword"=somepass

Now you can connect to the box using RDP client (http://cord.sourceforge.net/ for MacOS for example).

over 1 year ago ·
7865
D83b63db79b42978fe35e120550ca180

@av-ast Thanks! I've updated the protip.

over 1 year ago ·
7866
D83b63db79b42978fe35e120550ca180

@numbata You could extract it to a separate protip, I think) But thanks for mentioned it here.

over 1 year ago ·
7900
781bbe3e6880c14f783d044f2ff05e50

Installs latest chef-solo

vagrant plugin install vagrant-omnibus

EC2 Provider

vagrant plugin install vagrant-aws
over 1 year ago ·
7946
F3096ba44f2acb27f08884804021f936

@akalyaev you should checkout https://github.com/locomote/gusteau for some awesome vagrant / chef solo integration.

over 1 year ago ·
7968

Another interesting plugin is vagrant-cachier https://github.com/fgrehm/vagrant-cachier. It will help you reduce the waiting time for boxes to be provisioned by downloading sources from repositories.

over 1 year ago ·
8329
22296c67ba443c0bad5cefbe5e83a3e0
over 1 year ago ·
11737
D049f551aa71e6326c74002ac8e6788a

Easily execute commands in VM - https://github.com/p0deje/vagrant-exec

over 1 year ago ·
13416
09de9d8e03cbb0dfa0f5879b3d8a012a

http://getprotobox.com/ is a GUI for building vagrant files and uses ansible as a provisioner (disclaimer: I built this).

over 1 year ago ·
Filed Under