"vboxmanage" : [
[ "modifyvm", "{{.Name}}", "--memory", "{{user `memSize`}}"],
[ "modifyvm", "{{.Name}}", "--cpus", "{{user `cpuCount`}}" ],
[ "modifyvm", "{{.Name}}", "--nic1", "nat"]
],
"vboxmanage_post": ["modifyvm", "{{.Name}}", "--nic1", "bridged"],
but when running the json, vboxmanage run failed, can you help to tell me what's the problem with my json file ?
from my point, after vm was poweroff, can {{.Name}} point to the new created vm ?
"description" : "import a existing ova and pull image and then export to as a ova image",
"variables" : {
"diskImg" : "/vmimage/OMSP.ova",
"vmName" : "OracleLinux7u4_vbox",
"memSize" : "2048",
"cpuCount" : "1",
"diskSize" : "36720",
"diskFmt" : "ova",
"chefCookbooks" : "cookbooks",
"nicInterFace" : "eno1",
"chefRunlist" : "recipe[httpd]"
},
"builders" : [{
"type" : "virtualbox-ovf",
"name" : "vboxOvfBuilder",
"vboxmanage" : [
[ "modifyvm", "{{.Name}}", "--memory", "{{user `memSize`}}"],
[ "modifyvm", "{{.Name}}", "--cpus", "{{user `cpuCount`}}" ],
[ "modifyvm", "{{.Name}}", "--nic1", "nat"]
],
"vboxmanage_post": ["modifyvm", "{{.Name}}", "--nic1", "bridged"],
"export_opts":
[
"--manifest",
"--vsys", "0",
"--description", "create vm with nat and then change to bridged",
"--version", "2.0"
],
"source_path" : "{{user `diskImg`}}",
"format" : "{{user `diskFmt`}}",
"headless" : true,
"vrdp_bind_address" : "0.0.0.0",
"ssh_host_port_min" : 2222,
"ssh_host_port_max" : 2229,
"output_directory" : "images-{{timestamp}}",
"communicator" : "ssh",
"ssh_port" : 22,
"ssh_username" : "root",
"ssh_password" : "welcome1",
"ssh_wait_timeout" : "1500s",
"vm_name" : "oraclelinux7u4-vbox_bridge_1nat-{{timestamp}}",
"shutdown_command" : "shutdown -P now"
}
],
"provisioners": [{
"type" : "shell",
"script" : "scripts/getimage.sh"
}
]
}