Vagrant Overview for MariaDB Users

You are viewing an old version of this article. View the current version here.

Vagrant is a tool to create and manage development machines (Vagrant boxes). They are usually virtual machines on the local host system, but they could also be Docker containers or remote machines. Vagrant is open source software maintained by HashiCorp and released under the MIT license.

Vagrant benefits include simplicity, and a system to create test boxes that is mostly independent from the technology used.

In this page we discuss basic Vagrant concepts.

Providers

A provider adds support for creating a specific type of machines. Vagrant comes with three providers:

  • VirtualBox allows to create virtual machines with VirtualBox.
  • Hyper-V allows to create virtual machines with Microsoft Hyper-V.
  • Docker allows to create Docker containers.

Alternative providers are maintained by third parties or sold by HashiCorp. They allow to create different types of machines, for example using VMWare.

To find out how to develop your own provider, see Plugin Development: Providers in Vagrant documentation.

Some examples of useful providers, recognised by the community:

Vagrantfiles

A Vagrantfile is a file that described how to create a box. Vagrantfiles use the Ruby language,as well as objects provided by Vagrant itself.

A Vagrantfile is often based on another Vagrantfile, which is usually an operating system. For example, one can create a MariaDB Vagrantfile based on ubuntu/trusty64. A Vagrantfile can describe a box with a single server, like MariaDB, but it can also contain a whole environment, like LAMP. For most practical use cases, having the whole environment in a single box is more convenient.

A Vagrantfile is written for one or more specific providers, though it could work with other providers too.

Vagrantfiles can be searched in Vagrant Cloud. Most of the Vagrantfiles are also available on GitHub. Searches can be made, among other things, by keyword to find a specific technology, and by provider.

Vagrant commands

This is a list of the most common Vagrant commands. For a complete list, see Command-Line Interface in Vagrant documentation.

To list the available boxes:

vagrant box list

To start a box:

cd /box/directory
vagrant up

To connect to a box:

vagrant ssh

To see all boxes status and their id:

vagrant global-status

To destroy a box:

vagrant destroy <id>

Vagrant Resources

Here are some valuable websites and pages for Vagrant users.


Content initially contributed by Vettabase Ltd.

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.