rgl/windows-vagrant

Initial boot of Windows 2019 installation failed

kaklakariada opened this issue · 4 comments

I tried to create a Windows 2019 VM by running make build-windows-2019-virtualbox.

This created and started a VM, but it failed to boot with error message FATAL: Could not read from the boot medium! System halted..

I assume the reason is that the ISO images (VBoxGuestAdditions.iso and the installation disk) are added to the SATA Controller in the wrong order:

  • VBoxGuestAdditions.iso: port 14
  • installation disk: port 15
    The VM tried to boot from the first iso image VBoxGuestAdditions.iso and failed.

Workaround

I used the following workaround:

  1. Stop the VM (keeping the make command running)
  2. Manually edit the VM in VirtualBox, swapping the SATA ports of the two iso images so that the installation iso comes first
  3. Start the VM

Installation continued successfully.

Note

Using other SATA ports than 14 and 15 caused the installation to fail after 1:12h at the very end:

==> virtualbox-iso.windows-2019-amd64: Gracefully halting virtual machine...
    virtualbox-iso.windows-2019-amd64: Removing floppy drive...
==> virtualbox-iso.windows-2019-amd64: Error detaching ISO: VBoxManage error: VBoxManage: error: No storage device attached to device slot 0 on port 15 of controller 'SATA Controller'
==> virtualbox-iso.windows-2019-amd64: VBoxManage: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component SessionMachine, interface IMachine, callee nsISupports
==> virtualbox-iso.windows-2019-amd64: VBoxManage: error: Context: "DetachDevice(Bstr(pszCtl).raw(), port, device)" at line 403 of file VBoxManageStorageController.cpp
==> virtualbox-iso.windows-2019-amd64: Error detaching ISO: VBoxManage error: VBoxManage: error: No storage device attached to device slot 0 on port 15 of controller 'SATA Controller'
==> virtualbox-iso.windows-2019-amd64: VBoxManage: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component SessionMachine, interface IMachine, callee nsISupports
==> virtualbox-iso.windows-2019-amd64: VBoxManage: error: Context: "DetachDevice(Bstr(pszCtl).raw(), port, device)" at line 403 of file VBoxManageStorageController.cpp
==> virtualbox-iso.windows-2019-amd64: Step "StepRemoveDevices" failed, aborting...

Environment:

  • macOS 11.6
  • Vagrant 2.2.18
  • Packer 1.7.7
  • VirtualBox 6.1.26
rgl commented

Indeed, some change in packer/virtualbox broke this.

A commit to the hashicorp/packer-plugin-virtualbox repo made on August 13th entitled Ensure boot ISO is attached on lowest numbered port, relative to other ISO may have fixed this. I was able to resolve the boot problem described in this issue by manually building and installing the latest version of the virtualbox plugin.

rgl commented

@kaklakariada were you able to make it work with the newer packer-plugin-virtualbox like @alpayne mentioned?

Hi @rgl,
Thank you for the reminder. I successfully ran make build-windows-2022-virtualbox with the following versions:

  • macOS 12.3
  • Vagrant 2.2.19
  • Packer 1.8.0
  • VirtualBox 6.1.32

I will close this issue.