config.json is the main configuration file. Data from config.json is used to configure virtual machine. After editing file make sure that your JSON syntax is valid. JSONLint can help to check it.

Default config.json

{
  "vm": {
    "ip": "192.168.44.44",
    "memory": "1024",
    "synced_folders": [
      {
        "host_path": "data/",
        "guest_path": "/var/www",
        "type": "default"
      }
    ],
    "forwarded_ports": []
  },
  "vdd": {
    "sites": {
      "drupal8": {
        "account_name": "root",
        "account_pass": "root",
        "account_mail": "box@example.com",
        "site_name": "Drupal 8",
        "site_mail": "box@example.com",
        "vhost": {
          "document_root": "drupal8",
          "url": "drupal8.dev",
          "alias": ["www.drupal8.dev"]
        }
      },
      "drupal7": {
        "account_name": "root",
        "account_pass": "root",
        "account_mail": "box@example.com",
        "site_name": "Drupal 7",
        "site_mail": "box@example.com",
        "vhost": {
          "document_root": "drupal7",
          "url": "drupal7.dev",
          "alias": ["www.drupal7.dev"]
        }
      }
    }
  }
}

Variables description

vm (object of objects, required)
Virtual machine configuration.

  • ip (string, required)
    Static IP address of virtual machine. It is up to the users to make sure that the static IP doesn't collide with any other machines on the same network. While you can choose any IP you'd like, you should use an IP from the reserved private address space.

  • memory (string, required)
    RAM available to virtual machine. Minimum value is 1024.

  • synced_folders (array of objects, required)
    Synced folders configuration.

    • host_path (string, required)
      A path to a directory on the host machine. If the path is relative, it is relative to VDD root.

    • guest_path (string, required)
      Must be an absolute path of where to share the folder within the guest machine.

    • type (string, required)
      In some cases the default shared folder implementations (such as VirtualBox shared folders) have high performance penalties. If you're seeing less than ideal performance with synced folders, NFS can offer a solution.

      Available options: "default" and "nfs".

    Example:

     "synced_folders": [
        {
          "host_path": "data/folder1/",
          "guest_path": "/var/www/folder1",
          "type": "nfs"
        },
        {
          "host_path": "data/folder2/",
          "guest_path": "/var/www/folder2",
          "type": "nfs"
        }
      ],

  • forwarded_ports (array of objects, required)
    The list of forwarded ports.

    Example:

    "forwarded_ports": [
      {
        "guest_port": 35729,
        "host_port": 35729,
        "protocol": "tcp"
      }
    ],
    

vdd (object of objects, required)
VDD configuration.

  • sites (object of objects, required)
    Sites configuration.

    • key (string, required)
      Machine name of a site. Name should fit expression '[^a-z0-9_]+'. Will be used for creating subdirectory for site, Drush alias name, database name, etc.

      • account_name (string, required)
        Drupal administrator user name.

      • account_pass (string, required)
        Drupal administrator password.

      • account_mail (string, required)
        Drupal administrator email.

      • site_name (string, required)
        Drupal site name.

      • site_mail (string, required)
        Drupal site email.

      • vhost (object of strings, optional)
        Site virtual host configuration.

        • document_root (string, required)
          Document root directory. Relative to /var/www directory.

        • url (string, required)
          Site url.

        • alias (array of strings, required)
          List of url aliases.

To implement any changes in the config.json, vagrant must reprovision the vagrantbox. To do so run the following from the command line on your host machine (e.g. Mac/Windows/Linux)

vagrant provision