From f3cc413bbb574804ce50553e769f115dc2baf671 Mon Sep 17 00:00:00 2001 From: Taliesin Sisson Date: Mon, 29 Jun 2015 22:06:28 +0100 Subject: [PATCH] Set the dvd to the first boot device --- builder/hyperv/common/step_mount_dvddrive.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/builder/hyperv/common/step_mount_dvddrive.go b/builder/hyperv/common/step_mount_dvddrive.go index 8077dd7d1..56856566f 100644 --- a/builder/hyperv/common/step_mount_dvddrive.go +++ b/builder/hyperv/common/step_mount_dvddrive.go @@ -44,6 +44,8 @@ func (s *StepMountDvdDrive) Run(state multistep.StateBag) multistep.StepAction { script.Reset() script.WriteLine("param([string]$vmName)") script.WriteLine("Add-VMDvdDrive -VMName $vmName") + script.WriteLine("$dvdDrive = Get-VMDvdDrive -VMName $vmName | Select-Object -first 1") + script.WriteLine("Set-VMFirmware -VMName $vmName -FirstBootDevice $dvdDrive") err = powershell.Run(script.String(), vmName) if err != nil { state.Put("error", err)