terraform-provider-virtualbox
terraform-provider-virtualbox copied to clipboard
executable file not found in %PATH%
hi,
got error below when using on Windows 10 and VirtualBox 6.1.18. Lines from Example used.
virtualbox_vm.node[0]: Still creating... [20s elapsed]
Error: [ERROR] Create virtualbox VM node-01: exec: "false": executable file not found in %PATH%
on cluster.tf line 1, in resource "virtualbox_vm" "node":
1: resource "virtualbox_vm" "node" {
Error: [ERROR] Create virtualbox VM node-02: exec: "false": executable file not found in %PATH%
on cluster.tf line 1, in resource "virtualbox_vm" "node":
1: resource "virtualbox_vm" "node" {
VirualBox directory added to PATH, so which 'executable file' it requires?
Windows is not currently supported, see #83. But this error to me sounds like somewhere in the code we are calling false command (https://linux.die.net/man/1/false), which possibly comes from
https://github.com/terra-farm/go-virtualbox/blob/698b4798c5b6842af6e9e3630cd94e2c5e6fdb43/vbmgt.go#L34-L41
So my first guess is see if there is VBoxControl.exe in VBOX_INSTALL_PATH path.
I tested on Windows and I got the same issue. However I saw some progress. My guess is a custom implementation of the code used in go-virtualbox to get the VBoxManage path is somehow bad. I am working on adding a Run command to the go-virtualbox package so that we can use the configured instance to get the data, rather than relying on the custom code.
I only got over this error after adding the path directly to Windows and restarting it.

rneto12's advise works for me too. But need to reboot Windows to apply these changes.
Been going through the same issue for the last week, here's the resolution.
Apparently, when VirtualBox is installed in a different than the default folder, we get the PATH saved improperly in our system. It'll look like this:
VBOX_MSI_INSTALL_PATH | <Path to VirtualBox>
The solution is to add new PATH to our system:
VBOX_INSTALL_PATH | <Path to VirtualBox>
Restart the console application/IDE, in my case, VSCode, and just re-run terraform apply with yes brought up the virtual machine just fine. That's it :)