<p>You're looking at a list of different <em>builders</em>.
there can be multiple builder entries, and they're indicated by a certain 'type' - see the field named <em>type</em>.</p>
<p>In the example from Stefan there are <em>qemu</em>, <em>hyperv-iso</em>, <em>vmware-iso</em>, <em>virtualbox-iso</em> and finally <em>parallels-iso</em>.</p>
<p>Each of them contains</p>
<ul>
<li>a full set of parameters for building a VM &quot;artifact&quot;</li>
<li>the right parameters for that respective hypervisor.</li>
<li>the scripts to install the specific guest tools</li>
<li>the scripts for shared tasks they all need, i.e. the automatic update scripts.</li>
</ul>
<p>An artifact here is an installed VM in the format of this specific hypervisor / an iso of that / something.</p>
<p>And so that's why you can have some duplication, and as such, that's why <em>you</em> probably only need to copy one builder section .</p>

CC BY-SA 4.0
2021-04-10T04:39:15.003Z
Thank you Florian, I ended up figuring this out but forgot to come back here! Credit to you though, appreciated. In the end it turns out I just needed hyperv-iso. Now I have to figure out how to get the VM I've created with all my updates on it, back out to something bootable onto a new PC/server. :)
JamesMatson
CC BY-SA 4.0
2021-04-09T16:02:36.787Z
2021-04-09T16:02:36.787Z
Florian Heigl
<p>I am a beginner to Packer. I am using a template found at <a href="https://github.com/StefanScherer/packer-windows" rel="nofollow noreferrer">https://github.com/StefanScherer/packer-windows</a> for Windows 10, and have been able to create a virtual machine in Hyper-V using the template and my own .ISO.</p>
<p>Now I want to take the next step and add some of my own PowerShell scripts to the process, but I notice this template has multiple references to 'floppy_files' at various parts of the template, yet they are the same script files repeated? Can someone explain why? Do I need to put my script in each floppy_files collection? I'd rather understand why before I do that even if it does happen to work. Template shown below for clarity.</p>
<pre><code>{
  &quot;builders&quot;: [
    {
      &quot;accelerator&quot;: &quot;kvm&quot;,
      &quot;boot_wait&quot;: &quot;6m&quot;,
      &quot;communicator&quot;: &quot;winrm&quot;,
      &quot;cpus&quot;: &quot;2&quot;,
      &quot;disk_size&quot;: &quot;{{user `disk_size`}}&quot;,
      &quot;floppy_files&quot;: [
        &quot;{{user `autounattend`}}&quot;,
        &quot;./floppy/WindowsPowershell.lnk&quot;,
        &quot;./floppy/PinTo10.exe&quot;,
        &quot;./scripts/fixnetwork.ps1&quot;,
        &quot;./scripts/disable-screensaver.ps1&quot;,
        &quot;./scripts/disable-winrm.ps1&quot;,
        &quot;./scripts/enable-winrm.ps1&quot;,
        &quot;./scripts/microsoft-updates.bat&quot;,
        &quot;./scripts/win-updates.ps1&quot;
      ],
      &quot;headless&quot;: true,
      &quot;iso_checksum&quot;: &quot;{{user `iso_checksum`}}&quot;,
      &quot;iso_url&quot;: &quot;{{user `iso_url`}}&quot;,      
      &quot;memory&quot;: &quot;{{user `memory`}}&quot;,
      &quot;output_directory&quot;: &quot;windows_10-qemu&quot;,
      &quot;qemuargs&quot;: [
        [
          &quot;-drive&quot;,
          &quot;file=windows_10-qemu/{{ .Name }},if=virtio,cache=writeback,discard=ignore,format=qcow2,index=1&quot;
        ],
        [
          &quot;-drive&quot;,
          &quot;file={{ user `iso_url` }},media=cdrom,index=2&quot;
        ],
        [
          &quot;-drive&quot;,
          &quot;file={{ user `virtio_win_iso` }},media=cdrom,index=3&quot;
        ]
      ],
      &quot;shutdown_command&quot;: &quot;shutdown /s /t 10 /f /d p:4:1 /c \&quot;Packer Shutdown\&quot;&quot;,
      &quot;type&quot;: &quot;qemu&quot;,
      &quot;vm_name&quot;: &quot;{{user `vm_name`}}&quot;,
      &quot;winrm_password&quot;: &quot;vagrant&quot;,
      &quot;winrm_timeout&quot;: &quot;{{user `winrm_timeout`}}&quot;,
      &quot;winrm_username&quot;: &quot;vagrant&quot;
    },
    {
      &quot;boot_wait&quot;: &quot;6m&quot;,
      &quot;communicator&quot;: &quot;winrm&quot;,
      &quot;configuration_version&quot;: &quot;8.0&quot;,
      &quot;cpus&quot;: &quot;2&quot;,
      &quot;disk_size&quot;: &quot;{{user `disk_size`}}&quot;,
      &quot;floppy_files&quot;: [
        &quot;{{user `autounattend`}}&quot;,
        &quot;./floppy/WindowsPowershell.lnk&quot;,
        &quot;./floppy/PinTo10.exe&quot;,
        &quot;./scripts/fixnetwork.ps1&quot;,
        &quot;./scripts/disable-screensaver.ps1&quot;,
        &quot;./scripts/disable-winrm.ps1&quot;,
        &quot;./scripts/enable-winrm.ps1&quot;,
        &quot;./scripts/microsoft-updates.bat&quot;,
        &quot;./scripts/win-updates.ps1&quot;
      ],
      &quot;guest_additions_mode&quot;: &quot;none&quot;,
      &quot;iso_checksum&quot;: &quot;{{user `iso_checksum`}}&quot;,
      &quot;iso_url&quot;: &quot;{{user `iso_url`}}&quot;,
      &quot;memory&quot;: &quot;{{user `memory`}}&quot;,
      &quot;shutdown_command&quot;: &quot;shutdown /s /t 10 /f /d p:4:1 /c \&quot;Packer Shutdown\&quot;&quot;,
      &quot;switch_name&quot;: &quot;{{user `switch_name`}}&quot;,
      &quot;type&quot;: &quot;hyperv-iso&quot;,
      &quot;vm_name&quot;: &quot;{{user `vm_name`}}&quot;,
      &quot;winrm_password&quot;: &quot;vagrant&quot;,
      &quot;winrm_timeout&quot;: &quot;{{user `winrm_timeout`}}&quot;,
      &quot;winrm_username&quot;: &quot;vagrant&quot;
    },
    {
      &quot;boot_command&quot;: &quot;&quot;,
      &quot;boot_wait&quot;: &quot;6m&quot;,
      &quot;communicator&quot;: &quot;winrm&quot;,
      &quot;cpus&quot;: 2,
      &quot;disk_adapter_type&quot;: &quot;lsisas1068&quot;,
      &quot;disk_size&quot;: &quot;{{user `disk_size`}}&quot;,
      &quot;disk_type_id&quot;: &quot;{{user `disk_type_id`}}&quot;,
      &quot;floppy_files&quot;: [
        &quot;{{user `autounattend`}}&quot;,
        &quot;./floppy/WindowsPowershell.lnk&quot;,
        &quot;./floppy/PinTo10.exe&quot;,
        &quot;./scripts/fixnetwork.ps1&quot;,
        &quot;./scripts/disable-screensaver.ps1&quot;,
        &quot;./scripts/disable-winrm.ps1&quot;,
        &quot;./scripts/enable-winrm.ps1&quot;,
        &quot;./scripts/microsoft-updates.bat&quot;,
        &quot;./scripts/win-updates.ps1&quot;
      ],
      &quot;guest_os_type&quot;: &quot;windows9-64&quot;,
      &quot;headless&quot;: &quot;{{user `headless`}}&quot;,
      &quot;iso_checksum&quot;: &quot;{{user `iso_checksum`}}&quot;,
      &quot;iso_url&quot;: &quot;{{user `iso_url`}}&quot;,
      &quot;memory&quot;: &quot;{{user `memory`}}&quot;,
      &quot;shutdown_command&quot;: &quot;shutdown /s /t 10 /f /d p:4:1 /c \&quot;Packer Shutdown\&quot;&quot;,
      &quot;type&quot;: &quot;vmware-iso&quot;,
      &quot;version&quot;: &quot;{{user `vmx_version`}}&quot;,
      &quot;vm_name&quot;: &quot;{{user `vm_name`}}&quot;,
      &quot;vmx_data&quot;: {
        &quot;RemoteDisplay.vnc.enabled&quot;: &quot;false&quot;,
        &quot;RemoteDisplay.vnc.port&quot;: &quot;5900&quot;
      },
      &quot;vmx_remove_ethernet_interfaces&quot;: true,
      &quot;vnc_port_max&quot;: 5980,
      &quot;vnc_port_min&quot;: 5900,
      &quot;winrm_password&quot;: &quot;vagrant&quot;,
      &quot;winrm_timeout&quot;: &quot;{{user `winrm_timeout`}}&quot;,
      &quot;winrm_username&quot;: &quot;vagrant&quot;
    },
    {
      &quot;boot_command&quot;: &quot;&quot;,
      &quot;boot_wait&quot;: &quot;6m&quot;,
      &quot;communicator&quot;: &quot;winrm&quot;,
      &quot;cpus&quot;: 2,
      &quot;disk_size&quot;: &quot;{{user `disk_size`}}&quot;,
      &quot;floppy_files&quot;: [
        &quot;{{user `autounattend`}}&quot;,
        &quot;./floppy/WindowsPowershell.lnk&quot;,
        &quot;./floppy/PinTo10.exe&quot;,
        &quot;./scripts/fixnetwork.ps1&quot;,
        &quot;./scripts/disable-screensaver.ps1&quot;,
        &quot;./scripts/disable-winrm.ps1&quot;,
        &quot;./scripts/enable-winrm.ps1&quot;,
        &quot;./scripts/microsoft-updates.bat&quot;,
        &quot;./scripts/win-updates.ps1&quot;
      ],
      &quot;guest_additions_mode&quot;: &quot;disable&quot;,
      &quot;guest_os_type&quot;: &quot;Windows10_64&quot;,
      &quot;headless&quot;: &quot;{{user `headless`}}&quot;,
      &quot;iso_checksum&quot;: &quot;{{user `iso_checksum`}}&quot;,
      &quot;iso_url&quot;: &quot;{{user `iso_url`}}&quot;,
      &quot;memory&quot;: &quot;{{user `memory`}}&quot;,
      &quot;shutdown_command&quot;: &quot;shutdown /s /t 10 /f /d p:4:1 /c \&quot;Packer Shutdown\&quot;&quot;,
      &quot;type&quot;: &quot;virtualbox-iso&quot;,
      &quot;vm_name&quot;: &quot;{{user `vm_name`}}&quot;,
      &quot;winrm_password&quot;: &quot;vagrant&quot;,
      &quot;winrm_timeout&quot;: &quot;{{user `winrm_timeout`}}&quot;,
      &quot;winrm_username&quot;: &quot;vagrant&quot;
    },
    {
      &quot;boot_command&quot;: &quot;&quot;,
      &quot;boot_wait&quot;: &quot;6m&quot;,
      &quot;communicator&quot;: &quot;winrm&quot;,
      &quot;cpus&quot;: 2,
      &quot;disk_size&quot;: &quot;{{user `disk_size`}}&quot;,
      &quot;floppy_files&quot;: [
        &quot;{{user `autounattend`}}&quot;,
        &quot;./floppy/WindowsPowershell.lnk&quot;,
        &quot;./floppy/PinTo10.exe&quot;,
        &quot;./scripts/fixnetwork.ps1&quot;,
        &quot;./scripts/disable-screensaver.ps1&quot;,
        &quot;./scripts/disable-winrm.ps1&quot;,
        &quot;./scripts/enable-winrm.ps1&quot;,
        &quot;./scripts/microsoft-updates.bat&quot;,
        &quot;./scripts/win-updates.ps1&quot;
      ],
      &quot;guest_os_type&quot;: &quot;win-10&quot;,
      &quot;iso_checksum&quot;: &quot;{{user `iso_checksum`}}&quot;,
      &quot;iso_url&quot;: &quot;{{user `iso_url`}}&quot;,
      &quot;memory&quot;: &quot;{{user `memory`}}&quot;,
      &quot;shutdown_command&quot;: &quot;shutdown /s /t 10 /f /d p:4:1 /c \&quot;Packer Shutdown\&quot;&quot;,
      &quot;type&quot;: &quot;parallels-iso&quot;,
      &quot;parallels_tools_flavor&quot;: &quot;win&quot;,
      &quot;parallels_tools_mode&quot;: &quot;disable&quot;,
      &quot;prlctl&quot;: [
        [
          &quot;set&quot;,
          &quot;{{.Name}}&quot;,
          &quot;--adaptive-hypervisor&quot;,
          &quot;on&quot;
        ],
        [
          &quot;set&quot;,
          &quot;{{.Name}}&quot;,
          &quot;--efi-boot&quot;,
          &quot;off&quot;
        ]
      ],
      &quot;vm_name&quot;: &quot;{{user `vm_name`}}&quot;,
      &quot;winrm_password&quot;: &quot;vagrant&quot;,
      &quot;winrm_timeout&quot;: &quot;{{user `winrm_timeout`}}&quot;,
      &quot;winrm_username&quot;: &quot;vagrant&quot;
    }
  ],
  &quot;post-processors&quot;: [
    {
      &quot;keep_input_artifact&quot;: false,
      &quot;output&quot;: &quot;windows_10_{{.Provider}}.box&quot;,
      &quot;type&quot;: &quot;vagrant&quot;,
      &quot;vagrantfile_template&quot;: &quot;vagrantfile-windows_10.template&quot;
    }
  ],
  &quot;provisioners&quot;: [
    {
      &quot;execute_command&quot;: &quot;{{ .Vars }} cmd /c \&quot;{{ .Path }}\&quot;&quot;,
      &quot;remote_path&quot;: &quot;/tmp/script.bat&quot;,
      &quot;scripts&quot;: [
        &quot;./scripts/enable-rdp.bat&quot;
      ],
      &quot;type&quot;: &quot;windows-shell&quot;
    },
    {
      &quot;scripts&quot;: [
        &quot;./scripts/vm-guest-tools.ps1&quot;,
        &quot;./scripts/debloat-windows.ps1&quot;
      ],
      &quot;type&quot;: &quot;powershell&quot;
    },
    {
      &quot;restart_timeout&quot;: &quot;{{user `restart_timeout`}}&quot;,
      &quot;type&quot;: &quot;windows-restart&quot;
    },
    {
      &quot;scripts&quot;: [
        &quot;./scripts/set-powerplan.ps1&quot;,
        &quot;./scripts/docker/disable-windows-defender.ps1&quot;
      ],
      &quot;type&quot;: &quot;powershell&quot;
    },
    {
      &quot;execute_command&quot;: &quot;{{ .Vars }} cmd /c \&quot;{{ .Path }}\&quot;&quot;,
      &quot;remote_path&quot;: &quot;/tmp/script.bat&quot;,
      &quot;scripts&quot;: [
        &quot;./scripts/pin-powershell.bat&quot;,
        &quot;./scripts/compile-dotnet-assemblies.bat&quot;,
        &quot;./scripts/set-winrm-automatic.bat&quot;,
        &quot;./scripts/uac-enable.bat&quot;,
        &quot;./scripts/dis-updates.bat&quot;,
        &quot;./scripts/compact.bat&quot;
      ],
      &quot;type&quot;: &quot;windows-shell&quot;
    }
  ],
  &quot;variables&quot;: {
    &quot;autounattend&quot;: &quot;./answer_files/10/Autounattend.xml&quot;,
    &quot;disk_size&quot;: &quot;61440&quot;,
    &quot;disk_type_id&quot;: &quot;1&quot;,
    &quot;memory&quot;: &quot;2048&quot;,
    &quot;headless&quot;: &quot;false&quot;,
    &quot;iso_checksum&quot;: &quot;sha256:668fe1af70c2f7416328aee3a0bb066b12dc6bbd2576f40f812b95741e18bc3a&quot;,
    &quot;iso_url&quot;: &quot;https://software-download.microsoft.com/download/sg/17763.107.101029-1455.rs5_release_svc_refresh_CLIENT_LTSC_EVAL_x64FRE_en-us.iso&quot;,
    &quot;restart_timeout&quot;: &quot;5m&quot;,
    &quot;vhv_enable&quot;: &quot;false&quot;,
    &quot;virtio_win_iso&quot;: &quot;~/virtio-win.iso&quot;,
    &quot;vm_name&quot;: &quot;windows_10_pos&quot;,
    &quot;winrm_timeout&quot;: &quot;6h&quot;,
    &quot;vmx_version&quot;: &quot;14&quot;
  }
}
</code></pre>

<windows><packer><vm>
Trying to understand sample windows 10 packer template at https://github.com/StefanScherer/packer-windows
JamesMatson
# Trying to understand sample windows 10 packer template at https://github.com/StefanScherer/packer-windows

(Asked by: username_0 on 2021-03-27)

I am a beginner to Packer. I am using a template found at https://github.com/StefanScherer/packer-windows for Windows 10, and have been able to create a virtual machine in Hyper-V using the template and my own .ISO.
Now I want to take the next step and add some of my own PowerShell scripts to the process, but I notice this template has multiple references to 'floppy_files' at various parts of the template, yet they are the same script files repeated? Can someone explain why? Do I need to put my script in each floppy_files collection? I'd rather understand why before I do that even if it does happen to work. Template shown below for clarity.
{
  "builders": [
    {
      "accelerator": "kvm",
      "boot_wait": "6m",
      "communicator": "winrm",
      "cpus": "2",
      "disk_size": "{{user `disk_size`}}",
      "floppy_files": [
        "{{user `autounattend`}}",
        "./floppy/WindowsPowershell.lnk",
        "./floppy/PinTo10.exe",
        "./scripts/fixnetwork.ps1",
        "./scripts/disable-screensaver.ps1",
        "./scripts/disable-winrm.ps1",
        "./scripts/enable-winrm.ps1",
        "./scripts/microsoft-updates.bat",
        "./scripts/win-updates.ps1"
      ],
      "headless": true,
      "iso_checksum": "{{user `iso_checksum`}}",
      "iso_url": "{{user `iso_url`}}",      
      "memory": "{{user `memory`}}",
      "output_directory": "windows_10-qemu",
      "qemuargs": [
        [
          "-drive",
          "file=windows_10-qemu/{{ .Name }},if=virtio,cache=writeback,discard=ignore,format=qcow2,index=1"
        ],
        [
          "-drive",
          "file={{ user `iso_url` }},media=cdrom,index=2"
        ],
        [
          "-drive",
          "file={{ user `virtio_win_iso` }},media=cdrom,index=3"
        ]
      ],
      "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
      "type": "qemu",
      "vm_name": "{{user `vm_name`}}",
      "winrm_password": "vagrant",
      "winrm_timeout": "{{user `winrm_timeout`}}",
      "winrm_username": "vagrant"
    },
    {
      "boot_wait": "6m",
      "communicator": "winrm",
      "configuration_version": "8.0",
      "cpus": "2",
      "disk_size": "{{user `disk_size`}}",
      "floppy_files": [
        "{{user `autounattend`}}",
        "./floppy/WindowsPowershell.lnk",
        "./floppy/PinTo10.exe",
        "./scripts/fixnetwork.ps1",
        "./scripts/disable-screensaver.ps1",
        "./scripts/disable-winrm.ps1",
        "./scripts/enable-winrm.ps1",
        "./scripts/microsoft-updates.bat",
        "./scripts/win-updates.ps1"
      ],
      "guest_additions_mode": "none",
      "iso_checksum": "{{user `iso_checksum`}}",
      "iso_url": "{{user `iso_url`}}",
      "memory": "{{user `memory`}}",
      "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
      "switch_name": "{{user `switch_name`}}",
      "type": "hyperv-iso",
      "vm_name": "{{user `vm_name`}}",
      "winrm_password": "vagrant",
      "winrm_timeout": "{{user `winrm_timeout`}}",
      "winrm_username": "vagrant"
    },
    {
      "boot_command": "",
      "boot_wait": "6m",
      "communicator": "winrm",
      "cpus": 2,
      "disk_adapter_type": "lsisas1068",
      "disk_size": "{{user `disk_size`}}",
      "disk_type_id": "{{user `disk_type_id`}}",
      "floppy_files": [
        "{{user `autounattend`}}",
        "./floppy/WindowsPowershell.lnk",
        "./floppy/PinTo10.exe",
        "./scripts/fixnetwork.ps1",
        "./scripts/disable-screensaver.ps1",
        "./scripts/disable-winrm.ps1",
        "./scripts/enable-winrm.ps1",
        "./scripts/microsoft-updates.bat",
        "./scripts/win-updates.ps1"
      ],
      "guest_os_type": "windows9-64",
      "headless": "{{user `headless`}}",
      "iso_checksum": "{{user `iso_checksum`}}",
      "iso_url": "{{user `iso_url`}}",
      "memory": "{{user `memory`}}",
      "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
      "type": "vmware-iso",
      "version": "{{user `vmx_version`}}",
      "vm_name": "{{user `vm_name`}}",
      "vmx_data": {
        "RemoteDisplay.vnc.enabled": "false",
        "RemoteDisplay.vnc.port": "5900"
      },
      "vmx_remove_ethernet_interfaces": true,
      "vnc_port_max": 5980,
      "vnc_port_min": 5900,
      "winrm_password": "vagrant",
      "winrm_timeout": "{{user `winrm_timeout`}}",
      "winrm_username": "vagrant"
    },
    {
      "boot_command": "",
      "boot_wait": "6m",
      "communicator": "winrm",
      "cpus": 2,
      "disk_size": "{{user `disk_size`}}",
      "floppy_files": [
        "{{user `autounattend`}}",
        "./floppy/WindowsPowershell.lnk",
        "./floppy/PinTo10.exe",
        "./scripts/fixnetwork.ps1",
        "./scripts/disable-screensaver.ps1",
        "./scripts/disable-winrm.ps1",
        "./scripts/enable-winrm.ps1",
        "./scripts/microsoft-updates.bat",
        "./scripts/win-updates.ps1"
      ],
      "guest_additions_mode": "disable",
      "guest_os_type": "Windows10_64",
      "headless": "{{user `headless`}}",
      "iso_checksum": "{{user `iso_checksum`}}",
      "iso_url": "{{user `iso_url`}}",
      "memory": "{{user `memory`}}",
      "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
      "type": "virtualbox-iso",
      "vm_name": "{{user `vm_name`}}",
      "winrm_password": "vagrant",
      "winrm_timeout": "{{user `winrm_timeout`}}",
      "winrm_username": "vagrant"
    },
    {
      "boot_command": "",
      "boot_wait": "6m",
      "communicator": "winrm",
      "cpus": 2,
      "disk_size": "{{user `disk_size`}}",
      "floppy_files": [
        "{{user `autounattend`}}",
        "./floppy/WindowsPowershell.lnk",
        "./floppy/PinTo10.exe",
        "./scripts/fixnetwork.ps1",
        "./scripts/disable-screensaver.ps1",
        "./scripts/disable-winrm.ps1",
        "./scripts/enable-winrm.ps1",
        "./scripts/microsoft-updates.bat",
        "./scripts/win-updates.ps1"
      ],
      "guest_os_type": "win-10",
      "iso_checksum": "{{user `iso_checksum`}}",
      "iso_url": "{{user `iso_url`}}",
      "memory": "{{user `memory`}}",
      "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
      "type": "parallels-iso",
      "parallels_tools_flavor": "win",
      "parallels_tools_mode": "disable",
      "prlctl": [
        [
          "set",
          "{{.Name}}",
          "--adaptive-hypervisor",
          "on"
        ],
        [
          "set",
          "{{.Name}}",
          "--efi-boot",
          "off"
        ]
      ],
      "vm_name": "{{user `vm_name`}}",
      "winrm_password": "vagrant",
      "winrm_timeout": "{{user `winrm_timeout`}}",
      "winrm_username": "vagrant"
    }
  ],
  "post-processors": [
    {
      "keep_input_artifact": false,
      "output": "windows_10_{{.Provider}}.box",
      "type": "vagrant",
      "vagrantfile_template": "vagrantfile-windows_10.template"
    }
  ],
  "provisioners": [
    {
      "execute_command": "{{ .Vars }} cmd /c \"{{ .Path }}\"",
      "remote_path": "/tmp/script.bat",
      "scripts": [
        "./scripts/enable-rdp.bat"
      ],
      "type": "windows-shell"
    },
    {
      "scripts": [
        "./scripts/vm-guest-tools.ps1",
        "./scripts/debloat-windows.ps1"
      ],
      "type": "powershell"
    },
    {
      "restart_timeout": "{{user `restart_timeout`}}",
      "type": "windows-restart"
    },
    {
      "scripts": [
        "./scripts/set-powerplan.ps1",
        "./scripts/docker/disable-windows-defender.ps1"
      ],
      "type": "powershell"
    },
    {
      "execute_command": "{{ .Vars }} cmd /c \"{{ .Path }}\"",
      "remote_path": "/tmp/script.bat",
      "scripts": [
        "./scripts/pin-powershell.bat",
        "./scripts/compile-dotnet-assemblies.bat",
        "./scripts/set-winrm-automatic.bat",
        "./scripts/uac-enable.bat",
        "./scripts/dis-updates.bat",
        "./scripts/compact.bat"
      ],
      "type": "windows-shell"
    }
  ],
  "variables": {
    "autounattend": "./answer_files/10/Autounattend.xml",
    "disk_size": "61440",
    "disk_type_id": "1",
    "memory": "2048",
    "headless": "false",
    "iso_checksum": "sha256:668fe1af70c2f7416328aee3a0bb066b12dc6bbd2576f40f812b95741e18bc3a",
    "iso_url": "https://software-download.microsoft.com/download/sg/17763.107.101029-1455.rs5_release_svc_refresh_CLIENT_LTSC_EVAL_x64FRE_en-us.iso",
    "restart_timeout": "5m",
    "vhv_enable": "false",
    "virtio_win_iso": "~/virtio-win.iso",
    "vm_name": "windows_10_pos",
    "winrm_timeout": "6h",
    "vmx_version": "14"
  }
}

**Tags:** windows, packer, vm


---

## 1 answers

### Answer by username_1 on 2021-04-09. Score: 1 | Accepted answer

You're looking at a list of different *builders*.
there can be multiple builder entries, and they're indicated by a certain 'type' - see the field named *type*.

In the example from Stefan there are *qemu*, *hyperv-iso*, *vmware-iso*, *virtualbox-iso* and finally *parallels-iso*.

Each of them contains

* a full set of parameters for building a VM "artifact"
* the right parameters for that respective hypervisor.
* the scripts to install the specific guest tools
* the scripts for shared tasks they all need, i.e. the automatic update scripts.

An artifact here is an installed VM in the format of this specific hypervisor / an iso of that / something.

And so that's why you can have some duplication, and as such, that's why *you* probably only need to copy one builder section .

> **Comments:**
> **username_0**: Thank you Florian, I ended up figuring this out but forgot to come back here! Credit to you though, appreciated. In the end it turns out I just needed hyperv-iso. Now I have to figure out how to get the VM I've created with all my updates on it, back out to something bootable onto a new PC/server. :)  

---

