Packer not able to create Windows 2016 box with proper cpu type

12 views
Skip to first unread message

Michal Rozwadowski

unread,
Sep 17, 2019, 10:56:44 AM9/17/19
to Packer
Hi all!

I have a problem with packer processing Windows Server 2016 image
My source is an OVF file.
My configuration for packer looks like this

{
  "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?

I am using packer .1.3.3 and virtualbox 5.2.6

Any suggestions much appreciated. 

Regards,
Michał
Reply all
Reply to author
Forward
0 new messages