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

can't convert vbox network to terraform data: No match with get guestproperty output #138

Open
git006 opened this issue Apr 1, 2022 · 9 comments

Comments

@git006
Copy link

git006 commented Apr 1, 2022

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

resource "virtualbox_vm" "node" {
count = 1
name = "${format("k8s-%02d", count.index+1)}"
url = "https://cloud.centos.org/centos/7/vagrant/x86_64/images/CentOS-7-x86_64-Vagrant-2004_01.VirtualBox.box"
image = "./VirtualBox.box"
cpus = 1
memory = "512 Mib"
network_adapter {
type = "bridged"
host_interface = "wlp0s20f3"
# device = "wlp0s20f3"
}
}

I installed virtualbox in my ubuntu. What value should i provide to the host_interface or device? i just check ifconfig and got the adapter name "wlp0s20f3".

after terraform apply, it said "Error: [ERROR] can't convert vbox network to terraform data: No match with get guestproperty output".

@fabdg
Copy link

fabdg commented Aug 24, 2022

@PTangeL
Copy link

PTangeL commented Jan 16, 2024

same here, I think the VM it's still starting after 60 seconds, there is a PR that put a timeout as a variable, so we could tweak it easily.

@Jean-Baptiste-Lasselle
Copy link

Jean-Baptiste-Lasselle commented Feb 26, 2024

Hello, quick msg to give a full explanation of how to successfully use the provider, testd with ubuntu and debian, with full explanations and details about the caveats and limitations of the provider: https://github.com/3forges/packman/tree/0.0.2/terraform
also might be appreciated https://github.com/3forges/packman/tree/0.0.2/packer

@CyraxNova
Copy link

@Jean-Baptiste-Lasselle I add PR (terra-farm/go-virtualbox#45) for fix bridge-adapter.

@git006 VirtualBox gold image need contain VBox GuestAdditons (https://www.oracle.com/virtualization/technologies/vm/downloads/virtualbox-downloads.html)

For more detail see
VBoxManage guestproperty enumerate "vm-name"

@Jean-Baptiste-Lasselle
Copy link

Jean-Baptiste-Lasselle commented Mar 19, 2024

@Jean-Baptiste-Lasselle I add PR (terra-farm/go-virtualbox#45) for fix bridge-adapter.

@git006 VirtualBox gold image need contain VBox GuestAdditons (https://www.oracle.com/virtualization/technologies/vm/downloads/virtualbox-downloads.html)

For more detail see VBoxManage guestproperty enumerate "vm-name"

:) Oh, someone read my long analysis :) (Ctrl + F where the option syntax is now --bridge-adapter<1-N>, and not --bridgeadapter<1-N> anymore. I hereafter, checked that it still in that analysis of mine) ... I see, and thank you for pinging me I'm happy this could help, I could have done the PR, but I have other plans actually, to bring up a different design for terraforming virutalbox VMs, which is why I was interested in the study :) ... And As I have explained it, the virtualbox provider from terra-farm still works even if it will break soon. But it's true a PR will make the provider last longer.

All in all, it still is a good surprise, that there still exists this one out of ten thousand, who would read a very long, in-depth analysis :) ... And thank you for the mention :)

Oh, and btw, one question @CyraxNova : Do you mean that the can't convert vbox network to terraform data: error message, is caused by the fact that the device configration option, is mean to set a guest property of the VirtualBox VM, provided that the VirtualBox Guest Additions is already there in the "golden" VM image ?

@CyraxNova
Copy link

CyraxNova commented Mar 20, 2024

@Jean-Baptiste-Lasselle : Yes. I'm using image = "https://app.vagrantup.com/ubuntu/boxes/jammy64/versions/20240315.1.0/providers/virtualbox.box" (Ubuntu 22.04). By default, the image does not contain VirtualBox GuestAdditons. Need to install VirtualBox GuestAdditons on the vm and repackage the image. Not VM VirtualBox Extension Pack. Exactly VBox GuestAdditons.

@Jean-Baptiste-Lasselle
Copy link

Jean-Baptiste-Lasselle commented Mar 20, 2024

@Jean-Baptiste-Lasselle : Yes. I'm using image = "https://app.vagrantup.com/ubuntu/boxes/jammy64/versions/20240315.1.0/providers/virtualbox.box" (Ubuntu 22.04). By default, the image does not contain VirtualBox GuestAdditons. Need to install VirtualBox GuestAdditons on the vm and repackage the image. Not VM VirtualBox Extension Pack. Exactly VBox GuestAdditons.

Ahhhh Thank you so very much, I will test that as soon as possible: I like it very much when every single detail is completely analyzed, and in my case, i made the terraform provider work, without the can't convert vbox network to terraform data: error message anymore, simply because I commented the device configuration option. So I will add to my study this detail, appreciate very much your indication, which i will definitely test and add to my study :) . The final point I want to add there is answering this question: If I set the device configuration option, what happens in my VM ? What is it useful for ? To set the name of the Linux network interface ? to do what exactly ? Or said otherwise, Why would I want to set the device guest property for my VirtualBox VM?

For the sake of the reader, I add that the PR created by my fellow colleague @CyraxNova is a bout a completely unrelated and independent matter : and our discussion here makes it clear

@CyraxNova
Copy link

CyraxNova commented Mar 20, 2024

@Jean-Baptiste-Lasselle VBox GuestAdditons need for work all func in https://github.com/terra-farm/go-virtualbox/blob/main/guestprop.go .You can see the error No match with get guestproperty output in https://github.com/terra-farm/go-virtualbox/blob/main/guestprop.go#L49

see https://www.virtualbox.org/manual/UserManual.html#guestadd-guestprops
"Oracle VM VirtualBox enables requests of some properties from a running guest, provided that the Oracle VM VirtualBox Guest Additions are installed and the VM is running. "

@Jean-Baptiste-Lasselle
Copy link

@Jean-Baptiste-Lasselle VBox GuestAdditons need for work all func in https://github.com/terra-farm/go-virtualbox/blob/main/guestprop.go .You can see the error No match with get guestproperty output in https://github.com/terra-farm/go-virtualbox/blob/main/guestprop.go#L49

see https://www.virtualbox.org/manual/UserManual.html#guestadd-guestprops "Oracle VM VirtualBox enables requests of some properties from a running guest, provided that the Oracle VM VirtualBox Guest Additions are installed and the VM is running. "

Sure, sure, now the end question I will investigate is : Ok, we know how to set a guest property, programmatically, but why would we want to do that ? :) (would it help seting for example, the name of the Linux net interface in the VM at provisioning time, like setting it to eth0 or enp0s3 ?) I never used guest properties in the past, and what does it mean/stands for, device ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants