terra-farm / terraform-provider-virtualbox

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

Error: [ERROR] Cloning *.iso and *.dmg to VM folder. #132

Open zeusequinox opened 2 years ago

zeusequinox commented 2 years ago

Terraform Version

<MISSING>

Virtualbox Provider version

v0.2.2-alpha.1

Virtualbox Version

v6.1.26

Operating System

Windows 10

Describe the bug

I am getting this error while providing path to add guestadditions.

Without Adding The .iso I can't get the IPV4 address of provisioned virtual machine, as the network config is not in the "vboxmanage.exe guestproperty enumerate" cmd. So, in order to get ipv4 address we need to add guestadditions along with the provisioned vm. Can it somehow be changed to use copy or xcopy for windows os?

To Reproduce

Steps to reproduce the behavior:

  1. <MISSING>

Expected Behaviour

<MISSING>

Configuration

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

resource "virtualbox_vm" "node" {
  count = 1
  name  = format("node-%02d", count.index + 1)
  #name   = "Centos-7"
  #image = "D:/VDI's/64bit/Ubuntu 21.04 (64bit).vdi"
  #image     = "/drives/d/VDI's/64bitUbuntu 21.04 (64bit).vdi"
  #image  = "https://app.vagrantup.com/centos/boxes/7/versions/2004.01/providers/virtualbox.box"
  image  = "./centos/CentOS-8-Vagrant-8.2.2004-20200611.2.x86_64.vagrant-virtualbox.box"
  cpus   = 1
  memory = "1024 mib"
  status = "running"
  network_adapter {
    type   = "bridged"
    device = "IntelPro1000MTDesktop"
    host_interface = "Hyper-V Virtual Ethernet Adapter"
    # host_interface = "eth0"
  }
  optical_disks = ["./centos/VBoxGuestAdditions_6.1.26.iso"]

}

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

Log Output

image

VoyTechnology commented 1 year ago

Hi @zeusequinox, thank you for submitting this issue. I took some liberty in applying the latest issue template to this bug report, I hope you don't mind. Can you please provide some of the missing fields? Thank you.