{
  "variables": {
    "memory": "2048"
  },
  "builders": [
    {
      "type": "virtualbox-ovf",
      "keep_registered": true,
      "skip_export": true,
      "source_path": "https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.ova",
      "ssh_username": "ubuntu",
      "ssh_password": "passw0rd",
      "communicator": "ssh",
      "shutdown_command": "echo 'ubuntu' | sudo -S /sbin/halt -h -p",
      "shutdown_timeout": "10m",
      "headless": false,
      "vm_name": "ubuntu1",
      "pause_before_connecting": "50s",
      "http_directory": ".",
      "vboxmanage": [
        [
          "modifyvm",
          "{{.Name}}",
          "--memory",
          "{{ user `memory` }}"
        ],
        [
          "modifyvm",
          "{{ .Name }}",
          "--nictype1",
          "virtio"
        ],
        [
          "setextradata",
          "{{ .Name }}",
          "VBoxInternal/Devices/pcbios/0/Config/DmiSystemSerial",
          "string:ds=nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/"
        ],
        [
          "modifyvm",
          "{{ .Name }}",
          "--uart1",
          "0x3F8", "4"
        ],
        [
          "modifyvm",
          "{{ .Name }}",
          "--uartmode1",
          "file",
          "{{ pwd }}/console.log"
        ]
      ],
      "vboxmanage_post": [
        [
          "modifyvm",
          "{{ .Name }}",
          "--description",
          "Ubuntu 18.04, {{ .Name }}"
        ]
      ]
    }
  ]
}