My source is an OVF file.
{
"variables": {
"vm_name": "Win2016-Server",
"output_dir": "output-box",
"ovf_path": "/path/to/files/server.ovf"
},
"builders": [
{
"vm_name": "WindowsServer2016",
"source_path": "{{user `ovf_path`}}",
"type": "virtualbox-ovf",
"communicator": "winrm",
"winrm_username": "user",
"winrm_password": "pass",
"headless": "true",
"winrm_port": "55985",
"winrm_timeout": "5h",
"shutdown_timeout": "1h",
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
"vboxmanage": [
[ "modifyvm", "{{.Name}}", "--memory", "8192" ],
[ "modifyvm", "{{.Name}}", "--cpus", "1" ],
[ "modifyvm", "{{.Name}}", "--chipset", "piix3" ],
[ "modifyvm", "{{.Name}}", "--natpf1", "winrm,tcp,,55985,,5985"],
[ "modifyvm", "{{.Name}}", "--ioapic", "on" ],
[ "modifyvm", "{{.Name}}", "--pae", "on" ],
[ "modifyvm", "{{.Name}}", "--nestedpaging", "on" ],
[ "modifyvm", "{{.Name}}", "--paravirtprovider", "kvm" ],
[ "modifyvm", "{{.Name}}", "--cpuexecutioncap", "50" ],
[ "modifyvm", "{{.Name}}", "--vram", "64" ],
[ "modifyvm", "{{.Name}}", "--nic1", "nat"],
[ "modifyvm", "{{.Name}}", "--nictype1", "82540EM"],
[ "modifyvm", "{{.Name}}", "--cableconnected1", "on"],
[ "modifyvm", "{{.Name}}", "--nicpromisc1", "allow-all"],
[ "modifyvm", "{{.Name}}", "--ostype", "Windows2016_64" ]
]
}
],
"post-processors": [
{
"type": "vagrant",
"output": "{{user `output_dir`}}/{{user `vm_name`}}.box",
"keep_input_artifact": false
}
]
}
When I am running this configuration I end up with Windows server complaining about:
"Your PC/Device needs to be repaired This 64-bit application couldn't load because your PC doesn't have a 64-bit processor. If you're using Windows To Go, make sure that your USB device has a version of Windows that's compatible with the PC that you're trying to use"
When I then access this machine in VirtualBox i can shut down it, change type of OS (to Windows2012_64 for example but other 64bit types are ok as well) and start it again. At this time Windows does not complain at all and starts without any problem
I tried to provide other options to packer for ostype (Windows2016_64, Windows2012_64, Other_64 etc.) but without change in behaviour.
Am I missing any important part of configuration for packer here. or is this bug of some kind?