Closed tylerauerbeck closed 5 years ago
Going to close this one as I see that only nat
and bridged
are supported. The README.md is a bit misleading because it states the following:
.#.type, string, requried: The type of the network, allowed values: 'nat', 'bridged', 'hostonly', 'internal', 'generic'.
Would it make sense to update this?
@tylerauerbeck , You setup wrong network interface. host_interface its name of virtual box adapter usually this name eq vboxnet0. In Your example you use workstation interface.
resource "virtualbox_vm" "node" {
count = 2
name = "${format("node-%02d", count.index+1)}"
url = "https://vagrantcloud.com/ubuntu/boxes/xenial64/versions/20180420.0.0/providers/virtualbox.box"
image = "./virtualbox.box"
cpus = 2
memory = "512 mib",
// user_data = "${file("user_data")}"
network_adapter {
type = "hostonly",
host_interface="vboxnet0"
}
}
@tylerauerbeck, this issue is pretty old. I will close, but feel free to re-open if you are still having problems.
When trying to set the network adapter to hostonly, terraform apply ends in exit status 1. Here is the output from the debug log:
My terraform tf file is based off the one provided in example, with the only change being
This works without any issue if I leave the network type as bridged.