terra-farm / terraform-provider-virtualbox

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

vboxnet0 is not found #67

Closed patsevanton closed 4 years ago

patsevanton commented 4 years ago

Could not start the machine ... because the following physical network interfaces were not found: vboxnet1 (adapter 1) You can either change the machine's network settings or stop the machine.

apt-cache policy virtualbox

  Installed: 5.2.18-dfsg-2ubuntu18.10.1

terraform --version

+ provider.virtualbox (unversioned)

Error: [ERROR] Starting VM: exit status 1

  on example.tf line 1, in resource "virtualbox_vm" "node":
   1: resource "virtualbox_vm" "node" {

Log:

2019/08/23 13:22:10 [ERROR] <root>: eval: *terraform.EvalApplyPost, err: [ERROR] Starting VM: exit status 1
2019/08/23 13:22:10 [ERROR] <root>: eval: *terraform.EvalSequence, err: [ERROR] Starting VM: exit status 1
2019/08/23 13:23:08 [ERROR] <root>: eval: *terraform.EvalApplyPost, err: [ERROR] Starting VM: exit status 1
2019/08/23 13:23:08 [ERROR] <root>: eval: *terraform.EvalSequence, err: [ERROR] Starting VM: exit status 1
2019/08/23 13:23:08 [TRACE] [walkApply] Exiting eval tree: virtualbox_vm.node[0]```

Terraform config:

resource "virtualbox_vm" "node" {
  count     = 2
  name      = format("node-%02d", count.index + 1)
  image     = "https://app.vagrantup.com/ubuntu/boxes/bionic64/versions/20180903.0.0/providers/virtualbox.box"
  cpus      = 2
  memory    = "512 mib"
  user_data = file("user_data")

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

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

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