hashicorp / hashicorp/packer-plugin-virtualbox

Error when using .VHD as boot device

Open
#123 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
29
Forks
45
PR merge metrics
No merged PRs in 30d

Description

#### Overview of the Issue

When using a .vhd as the `iso_url` (as stated possible in the [documentation](https://developer.hashicorp.com/packer/integrations/hashicorp/virtualbox/latest/components/builder/iso#required:), VirtualBox returns the error `Error attaching ISO: VBoxManage error: VBoxManage.exe: error: The medium '' 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`:
```bash
C:\Users\\AppData\Roaming\packer.d\plugins\github.com\hashicorp\ansible\packer-plugin-ansible_v1.1.0_x5.0_windows_amd64.exe
C:\Users\\AppData\Roaming\packer.d\plugins\github.com\hashicorp\hyperv\packer-plugin-hyperv_v1.1.2_x5.0_windows_amd64.exe
C:\Users\\AppData\Roaming\packer.d\plugins\github.com\hashicorp\vagrant\packer-plugin-vagrant_v1.1.1_x5.0_windows_amd64.exe
C:\Users\\AppData\Roaming\packer.d\plugins\github.com\hashicorp\virtualbox\packer-plugin-virtualbox_v1.0.5_x5.0_windows_amd64.exe
C:\Users\\AppData\Roaming\packer.d\plugins\github.com\hashicorp\vmware\packer-plugin-vmware_v1.0.11_x5.0_windows_amd64.exe
```

### Simplified Packer Buildfile
```hcl
source "virtualbox-iso" "virtualbox" {
boot_command = ["aaa"]
boot_wait = "-1s"
cd_files = ["./installers"]
cpus = "4"
disk_size = "50000"
headless = "true"
iso_checksum = "none"
iso_url = "$"
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](https://gist.github.com/remi-espie/f0cf1d1ed7379bccb95f7f5ce9083ce6)

### 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.