terra-farm/terraform-provider-virtualbox

Provider not is recognised

weyderfs opened this issue · 13 comments

Guys someone can clarify where is my fault?

$ ls -la ~/.terraform.d/plugins/linux_amd64/terraform-provider-virtualbox/
total 92
drwxrwxr-x 8 darth darth  4096 Aug  3 22:13 .
drwxrwxr-x 4 darth darth    64 Aug  3 22:13 ..
-rw-rw-r-- 1 darth darth   159 Aug  3 22:13 antora.yml
-rw-rw-r-- 1 darth darth  1137 Aug  3 22:13 CHANGELOG.md
-rw-rw-r-- 1 darth darth    54 Aug  3 22:13 codecov.yml
-rw-rw-r-- 1 darth darth  1801 Aug  3 22:13 CONTRIBUTING.md
drwxrwxr-x 2 darth darth    41 Aug  3 22:13 examples
drwxrwxr-x 8 darth darth   163 Aug  3 22:13 .git
-rw-rw-r-- 1 darth darth    30 Aug  3 22:13 .gitattibutes
drwxrwxr-x 3 darth darth    23 Aug  3 22:13 .github
-rw-rw-r-- 1 darth darth   329 Aug  3 22:13 .gitignore
-rw-rw-r-- 1 darth darth   528 Aug  3 22:13 gogetcookie.sh.enc
-rw-rw-r-- 1 darth darth   507 Aug  3 22:13 go.mod
-rw-rw-r-- 1 darth darth 32997 Aug  3 22:13 go.sum
-rw-rw-r-- 1 darth darth  1065 Aug  3 22:13 LICENSE
-rw-rw-r-- 1 darth darth   436 Aug  3 22:13 main.go
-rw-rw-r-- 1 darth darth    13 Aug  3 22:13 main_test.go
-rw-rw-r-- 1 darth darth  1001 Aug  3 22:13 Makefile
drwxrwxr-x 4 darth darth    35 Aug  3 22:13 modules
-rw-rw-r-- 1 darth darth  1863 Aug  3 22:13 README.md
drwxrwxr-x 2 darth darth    79 Aug  3 22:13 scripts
drwxrwxr-x 3 darth darth   143 Aug  3 22:13 virtualbox

$ cd ~/MyProject

$ terraform providers
.
└── provider.virtualbox

$ terraform init

Initializing the backend...

Initializing provider plugins...
- Checking for available provider plugins...

Provider "virtualbox" not available for installation.

A provider named "virtualbox" could not be found in the Terraform Registry.

This may result from mistyping the provider name, or the given provider may
be a third-party provider that cannot be installed automatically.

In the latter case, the plugin must be installed manually by locating and
downloading a suitable distribution package and placing the plugin's executable
file in the following directory:
    terraform.d/plugins/linux_amd64

Terraform detects necessary plugins by inspecting the configuration and state.
To view the provider versions requested by each module, run
"terraform providers".

Error: no provider exists with the given name

$ terraform version
  Terraform v0.12.29

You should not install the sources under .terraform.d/plugins but a binary version. You can find these under the releases. Here is the last one:

https://github.com/terra-farm/terraform-provider-virtualbox/releases/tag/v0.2.0

Installation instructions for Terraform versions up to 0.12 are here:

https://terra-farm.github.io/main/installation.html

I will see if I can find time shortly to have the providers published on the Registry for the upcoming 0.13. That manual installation hassle is over then.

Hi I cannot make this provider work. I am using Terraform v0.12.28. I have copied terraform-provider-virtualbox--darwin_amd64 to the plugin folder in my IOs but cannot make the provider work.

Sergios-MBP:tf_vbox sergiov$ terraform providers
.
└── provider.virtualbox

Sergios-MBP:tf_vbox sergiov$ terraform init

Initializing the backend...

Initializing provider plugins...

  • Checking for available provider plugins...

Provider "virtualbox" not available for installation.

A provider named "virtualbox" could not be found in the Terraform Registry.

This may result from mistyping the provider name, or the given provider may
be a third-party provider that cannot be installed automatically.

In the latter case, the plugin must be installed manually by locating and
downloading a suitable distribution package and placing the plugin's executable
file in the following directory:
terraform.d/plugins/darwin_amd64

Terraform detects necessary plugins by inspecting the configuration and state.
To view the provider versions requested by each module, run
"terraform providers".

Error: no provider exists with the given name

Hello @volpiserg, have you followed the installation instructions I referred to earlier? I suspect you forgot to rename the provider binary and put it in the proper folder. I repeat from the installation docs:

Provider plugin binaries are named with the scheme terraform-provider-<NAME>_vX.Y.Z.

So the provider binary should be named terraform-provider-virtualbox_v0.2.0. I see you are running on a Mac, so as the output stated, you can put this binary in folder terraform.d/plugins/darwin_amd64 of your current project.

You should not install the sources under .terraform.d/plugins but a binary version. You can find these under the releases. Here is the last one:

https://github.com/terra-farm/terraform-provider-virtualbox/releases/tag/v0.2.0

Installation instructions for Terraform versions up to 0.12 are here:

https://terra-farm.github.io/main/installation.html

I will see if I can find time shortly to have the providers published on the Registry for the upcoming 0.13. That manual installation hassle is over then.

Very weird, I follow your instructions, but error continues:

$ ls -la ~/.terraform.d/plugins/linux_amd64/terraform-provider-virtualbox-v0.2.0 
-rwxrwxr-x 1 darth darth 31011659 Aug  1  2019 /home/darth/.terraform.d/plugins/linux_amd64/terraform-provider-virtualbox-v0.2.0

$ terraform providers
.
└── provider.virtualbox

$ terraform init

Initializing the backend...

Initializing provider plugins...
- Checking for available provider plugins...

Provider "virtualbox" not available for installation.

A provider named "virtualbox" could not be found in the Terraform Registry.

This may result from mistyping the provider name, or the given provider may
be a third-party provider that cannot be installed automatically.

In the latter case, the plugin must be installed manually by locating and
downloading a suitable distribution package and placing the plugin's executable
file in the following directory:
    terraform.d/plugins/linux_amd64

Terraform detects necessary plugins by inspecting the configuration and state.
To view the provider versions requested by each module, run
"terraform providers".


Error: no provider exists with the given name

@weyderfs Instructions have to be precise: the provider binary name needs an _ (underscore) just before the version number, not a hyphen. 😉

@weyderfs Instructions have to be precise: the provider binary neem needs an _ (underscore) just before the version number, not a hyphen. wink

Oh man, my bad seriously
Works now!

@ringods thanks! after renaming the binary it worked!

unfortunately, now i get this error. any clue?

Error: Failed to instantiate provider "virtualbox" to obtain schema: fork/exec /Users/sergiov/.terraform.d/plugins/darwin_amd64/terraform-provider-virtualbox_v0.2.0: permission denied

Based on the command output, and naming scheme of your folders, what OS are you on? I see you putting things in darwin_amd64, but then mentions of linux_amd64. Are you sure you downloaded the correct binary for your system? If you have MacOS You should download the Darwin binaries, if you are on Linux, use the Linux binaries. This might be the cause of your problems.

@VoyTechnology I am running macOS 10.15.5 as my folder structure indicates and I downloaded terraform-provider-virtualbox--darwin_amd64, copied into ~/.terraform.d/plugins/darwin_amd64 and renamed it to "terraform-provider-virtualbox_v0.2.0"

I did it again just to see if I was doing something wrong but the same:

Sergios-MBP:vBox sergiov$ terraform init

Initializing the backend...

Initializing provider plugins...

The following providers do not have any version constraints in configuration,
so the latest version was installed.

To prevent automatic upgrades to new major versions that may contain breaking
changes, it is recommended to add version = "..." constraints to the
corresponding provider blocks in configuration, with the constraint strings
suggested below.

  • provider.virtualbox: version = "~> 0.2"

Terraform has been successfully initialized!

but when Terraform Validate
Sergios-MBP:vBox sergiov$ terraform validate

Error: Failed to instantiate provider "virtualbox" to obtain schema: fork/exec /Users/sergiov/.terraform.d/plugins/darwin_amd64/terraform-provider-virtualbox_v0.2.0: permission denied

@volpiserg you have to make the binary executable, usually using chmod +x terraform-provider-virtualbox_v0.2.0

@ringods thank you all. after chmod +x terraform-provider-virtualbox_v0.2.0 it is working now

thanks!

Just an aditional question. Is it suppoerted bridged addapter for terrform provider virtualbox? Nat is working fine but not bridged.

Hi, do you know if Bridged network is supported?