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

VBoxManage: error: Could not find a controller named 'IDE Controller' #56

Open
CEnnis91 opened this issue Jan 17, 2022 · 3 comments
Open
Labels

Comments

@CEnnis91
Copy link

Overview of the Issue

I came across this issue when using Ubuntu's daily cloud images with the virtualbox-ovf builder. After importing the OVA, the plugin tries to attach the iso generated from the cloud-init data in cd_content. It looks for an ide controller named IDE Controller, but finds none; however a controller IDE exists. I suspect that this may be related to the VirtualBox version (6.1.30)?

I solved this issue locally by adding a vboxmanage_pre field to the plugin, which runs just after the VM is created (or OVF imported).
Adding the following lines to the problem buildfile below would fix the issue. If this is solution works, I can submit a PR. If not, I'm open to other ideas/solutions.

"vboxmanage_pre": [[ "storagectl", "{{.Name}}", "--name", "IDE", "--rename", "IDE Controller" ]],
"vboxmanage_post": [[ "storagectl", "{{.Name}}", "--name", "IDE Controller", "--rename", "IDE" ]],

Reproduction Steps

Using the example build file below:
PACKER_LOG=1 packer build example.json

Plugin and Packer version

Packer v1.7.8

Simplified Packer Buildfile

example.json
{
    "builders": [{
        "type": "virtualbox-ovf",
        "vm_name": "vboxmanage-pre.example",
        "communicator": "none",
        "virtualbox_version_file": "",
        "source_path": "https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64.ova",
        "checksum": "file:https://cloud-images.ubuntu.com/focal/current/SHA256SUMS",
        "guest_additions_mode": "disable",
        "cd_label": "cidata",
        "cd_content": {
            "meta-data": "local-hostname: changeme",
            "user-data": ""
        },
        "boot_wait": "2m",
        "keep_registered": "false",
        "skip_export": "true"
    }]
}

Operating system and Environment details

Oracle VM VirtualBox VM Selector v6.1.30

Log Fragments and crash.log files

...
2022/01/17 15:25:53 packer-plugin-virtualbox plugin: 2022/01/17 15:25:53 Not attaching guest additions since we're uploading.
2022/01/17 15:25:53 packer-plugin-virtualbox plugin: 2022/01/17 15:25:53 Executing VBoxManage: []string{"storageattach", "vboxmanage-pre.example", "--storagectl", "IDE Controller", "--port", "1", "--device", "1", "--type", "dvddrive", "--medium", "/tmp/packer324561340.iso"}
    virtualbox-ovf: Mounting cd_files ISO...
2022/01/17 15:25:53 packer-plugin-virtualbox plugin: 2022/01/17 15:25:53 stdout:
2022/01/17 15:25:53 packer-plugin-virtualbox plugin: 2022/01/17 15:25:53 stderr: VBoxManage: error: Could not find a controller named 'IDE Controller'
==> virtualbox-ovf: Error attaching ISO: VBoxManage error: VBoxManage: error: Could not find a controller named 'IDE Controller'
==> virtualbox-ovf: Deregistering and deleting imported VM...
...
@CEnnis91 CEnnis91 added the bug label Jan 17, 2022
@elct9620
Copy link

elct9620 commented Sep 1, 2022

I have tried VirtualBox 6.1 on macOS and Ubuntu has the same issue. Maybe VirtualBox 6.1 changes some default naming policy?

Updated: VirtualBox 6.0 has the same issue

@horihel
Copy link

horihel commented Oct 25, 2022

still an issue on Virtualbox 7.x

@Marc3001
Copy link

Marc3001 commented Apr 9, 2024

Unfortunately, vboxmanage_pre seems to not be available anymore in the config.
vboxmanage seems to be the way to pass vboxmanage commands before the vm starts but commands will be run after packer trying to attach CD.

So workaround seems to be no longer working :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants