Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using .VHD as boot device #123

Open
remi-espie opened this issue Mar 1, 2024 · 0 comments · May be fixed by #124
Open

Error when using .VHD as boot device #123

remi-espie opened this issue Mar 1, 2024 · 0 comments · May be fixed by #124
Labels

Comments

@remi-espie
Copy link

remi-espie commented Mar 1, 2024

Overview of the Issue

When using a .vhd as the iso_url (as stated possible in the documentation, VirtualBox returns the error Error attaching ISO: VBoxManage error: VBoxManage.exe: error: The medium '<path/to/vhd>' can't be used as the requested device type (DVD, detected HDD).

Reproduction Steps

Put a .VHD file locaiton as the iso_url and run packer.

Plugin and Packer version

From packer version:
Packer v1.10.0

From packer plugins installed:

C:\Users\<Username>\AppData\Roaming\packer.d\plugins\github.com\hashicorp\ansible\packer-plugin-ansible_v1.1.0_x5.0_windows_amd64.exe
C:\Users\<Username>\AppData\Roaming\packer.d\plugins\github.com\hashicorp\hyperv\packer-plugin-hyperv_v1.1.2_x5.0_windows_amd64.exe
C:\Users\<Username>\AppData\Roaming\packer.d\plugins\github.com\hashicorp\vagrant\packer-plugin-vagrant_v1.1.1_x5.0_windows_amd64.exe
C:\Users\<Username>\AppData\Roaming\packer.d\plugins\github.com\hashicorp\virtualbox\packer-plugin-virtualbox_v1.0.5_x5.0_windows_amd64.exe
C:\Users\<Username>\AppData\Roaming\packer.d\plugins\github.com\hashicorp\vmware\packer-plugin-vmware_v1.0.11_x5.0_windows_amd64.exe

Simplified Packer Buildfile

source "virtualbox-iso" "virtualbox" {
  boot_command              = ["a<wait>a<wait>a"]
  boot_wait                 = "-1s"
  cd_files                  = ["./installers"]
  cpus                      = "4"
  disk_size                 = "50000"
  headless                  = "true"
  iso_checksum              = "none"
  iso_url                   = "$<path/to/vhd>"
  memory                    = "4096"
  output_directory          = "./output"
  shutdown_command          = "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\""
  guest_os_type             = "Windows10_64"
  vm_name                   = "${var.vm_name}"
}

build {
  sources = ["source.hyperv-iso.hyperv", "source.virtualbox-iso.virtualbox", "source.vmware-iso.vmware"]
  provisioner "breakpoint" {
    name = "debug"
  }
}

Operating system and Environment details

Windows 10 amd64, running from Powershell.

Log Fragments and crash.log files

Link to Packer log gist

Note

When using VirtualBox GUI, I can put the .vhd as a hard drive and run my VM normally, I just don't understand how to do the same with packer.

@remi-espie remi-espie added the bug label Mar 1, 2024
@remi-espie remi-espie linked a pull request Mar 6, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant