terraform-provider-virtualbox
terraform-provider-virtualbox copied to clipboard
virtualbox provider fails to create a VM
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)
:(
Did you figure out how to fix this @sajusat ?
I have the same problem