terra-farm / terraform-provider-virtualbox

VirtualBox provider for Terraform
https://terra-farm.github.io/provider-virtualbox/
MIT License
322 stars 137 forks source link

virtualbox provider fails to create a VM #142

Open sajusat opened 2 years ago

sajusat commented 2 years ago

Hi, I am using Ubuntu 20.04. I have tried the following

terraform {
    required_providers {
        virtualbox = {
            source = "terra-farm/virtualbox"
            version = "0.2.2-alpha.1"
        }
    }
}

resource "virtualbox_vm" "node" {
  count     = 1
  name      = "bullseye"
  image     = "https://app.vagrantup.com/debian/boxes/bullseye64/versions/11.20220328.1/providers/virtualbox.box"
  cpus      = 2
  memory    = "512 mib"

  network_adapter {
    type           = "hostonly"
    host_interface = "vbnet"
  }
}

output "IPAddr" {
  value = element(virtualbox_vm.node.*.network_adapter.0.ipv4_address, 1)
}

I did terraform apply

  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

virtualbox_vm.node[0]: Creating...
virtualbox_vm.node[0]: Still creating... [10s elapsed]
virtualbox_vm.node[0]: Still creating... [20s elapsed]
virtualbox_vm.node[0]: Still creating... [30s elapsed]
╷
│ Error: [ERROR] Starting VM: exit status 1
│ 
│   with virtualbox_vm.node[0],
│   on main.tf line 10, in resource "virtualbox_vm" "node":
│   10: resource "virtualbox_vm" "node" {
│ 
╵

I can see a VM is created in virtualbox UI. It is powered off. When I try to manually start the VM it complains that Could not start the machine bullseye because the following physical network interfaces were not found. vbnet (adapter 1)

:(

dgvigil commented 2 years ago

Did you figure out how to fix this @sajusat ?

antonioepoibo commented 1 year ago

I have the same problem