From e88c1542e50f89d056d02e5edebedc5574aebb76 Mon Sep 17 00:00:00 2001 From: Steven Samuel Cole Date: Tue, 23 Aug 2016 23:51:34 +0200 Subject: [PATCH] extend export_opts documentation, add sample code (#3746) --- .../docs/builders/virtualbox-ovf.html.md | 40 ++++++++++++++++++- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/website/source/docs/builders/virtualbox-ovf.html.md b/website/source/docs/builders/virtualbox-ovf.html.md index 0e53b0316..fdf086656 100644 --- a/website/source/docs/builders/virtualbox-ovf.html.md +++ b/website/source/docs/builders/virtualbox-ovf.html.md @@ -83,8 +83,44 @@ builder. specified, the default is 10 seconds. - `export_opts` (array of strings) - Additional options to pass to the - `VBoxManage export`. This can be useful for passing product information to - include in the resulting appliance file. + [VBoxManage export](https://www.virtualbox.org/manual/ch08.html#vboxmanage-export). + This can be useful for passing product information to include in the + resulting appliance file. Packer JSON configuration file example: + + ``` {.json} + { + "type": "virtualbox-ovf", + "export_opts": + [ + "--manifest", + "--vsys", "0", + "--description", "{{user `vm_description`}}", + "--version", "{{user `vm_version`}}" + ], + "format": "ova", + } + ``` + + A VirtualBox [VM description](https://www.virtualbox.org/manual/ch08.html#idm3756) + may contain arbitrary strings; the GUI interprets HTML formatting. + However, the JSON format does not allow arbitrary newlines within a + value. Add a multi-line description by preparing the string in the + shell before the packer call like this (shell `>` continuation + character snipped for easier copy & paste): + + ``` {.shell} + + vm_description='some + multiline + description' + + vm_version='0.2.0' + + packer build \ + -var "vm_description=${vm_description}" \ + -var "vm_version=${vm_version}" \ + "packer_conf.json" + ``` - `floppy_files` (array of strings) - A list of files to place onto a floppy disk that is attached when the VM is booted. This is most useful for