Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provider on windows multiple tests #123

Open
abdelhaleemahmed opened this issue Dec 8, 2021 · 3 comments
Open

Provider on windows multiple tests #123

abdelhaleemahmed opened this issue Dec 8, 2021 · 3 comments
Labels
os/windows Affecting the Windows version

Comments

@abdelhaleemahmed
Copy link

abdelhaleemahmed commented Dec 8, 2021

Greetings,

I tried to run the provider on windows 10, form a powershell prompt using the following configurations:

Software:
Virtualbox version: 6.1.28r147628
Provider: 0.2.2-alpha.1
Terraform: Terraform v1.0.11 on windows_amd64

Configuration file:

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)
  image     = "/DevOps/boxes/bionic20211025.0.0.box"
  #image     = "https://app.vagrantup.com/ubuntu/boxes/bionic64/versions/20210916.0.0/providers/virtualbox.box"
  cpus      = 2
  memory    = "4096 mib"
  #user_data = file("user_data")

  network_adapter {
    type = "nat"
  }

}

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

~

Issue 01: I got the machine up and running and with the NAT configuration, and able to access the internet, but with the following error:

virtualbox_vm.node[0]: Creating...
virtualbox_vm.node[0]: Still creating... [10s elapsed]
╷
│ Error: [ERROR] can't convert vbox network to terraform data: No match with get guestproperty output
│
│   with virtualbox_vm.node[0],
│   on infra.tf line 11, in resource "virtualbox_vm" "node":
│   11: resource "virtualbox_vm" "node" {
│
╵

Changing the configuration to the following and use a hostonly network:

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)
  image     = "/DevOps/boxes/bionic20211025.0.0.box"
  #image     = "https://app.vagrantup.com/ubuntu/boxes/bionic64/versions/20210916.0.0/providers/virtualbox.box"
  cpus      = 2
  memory    = "4096 mib"
  #user_data = file("user_data")

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

output "IPAddr" {
  value = element(virtualbox_vm.node.*.network_adapter.0.ipv4_address, 1)
}
virtualbox_vm.node[0]: Creating...
virtualbox_vm.node[0]: Still creating... [10s elapsed]
╷
│ Error: [ERROR] Starting VM: exit status 1
│
│   with virtualbox_vm.node[0],
│   on infra.tf line 11, in resource "virtualbox_vm" "node":
│   11: resource "virtualbox_vm" "node" {
│
╵

I'm I downing something wrong?

any advice is appreciated, I'm a Linux expert so, I will move my tests to a Linux machine and then try everything again.
Moreover I used multiple images with the same results.

@VoyTechnology
Copy link
Member

I took the liberty of editing the comment to add syntax highlighting. I hope you don't mind.

@VoyTechnology VoyTechnology added the os/windows Affecting the Windows version label Jan 3, 2022
@abuarbaz
Copy link

abuarbaz commented Jan 18, 2022

I was able to solve this problem by adding the correct hostinterface name. Try to see the hostinterface name and assign that you should be able to create that successfully. Check that in your case how the interface is looking if you try to create a VM manually and assign that interface accordingly.

image

network_adapter {
   type = "bridged"
   host_interface = "Intel(R) Dual Band Wireless-AC 8260"
}

@retro97bv
Copy link

It happens exactly the same

terraform {
required_providers {
virtualbox = {
source = "terra-farm/virtualbox"
version = "0.2.2-alpha.1"
}
}
}
resource "virtualbox_vm" "node" {
name = "skyneds"
image = "https://cloud.centos.org/centos/7/vagrant/x86_64/images/CentOS-7-x86_64-Vagrant-2004_01.VirtualBox.box"
cpus = 2
memory = "1024 mib"

network_adapter {
type = "nat"
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
os/windows Affecting the Windows version
Projects
None yet
Development

No branches or pull requests

4 participants