terraform-provider-virtualbox icon indicating copy to clipboard operation
terraform-provider-virtualbox copied to clipboard

executable file not found in %PATH%

Open nazmang opened this issue 4 years ago • 5 comments

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?

nazmang avatar May 13 '21 08:05 nazmang

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.

VoyTechnology avatar Jun 10 '21 11:06 VoyTechnology

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.

VoyTechnology avatar Sep 23 '21 01:09 VoyTechnology

I only got over this error after adding the path directly to Windows and restarting it.

image

rneto12 avatar Feb 21 '22 13:02 rneto12

rneto12's advise works for me too. But need to reboot Windows to apply these changes.

BlackS52 avatar Jun 08 '22 11:06 BlackS52

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 :)

ilkoTheTiger avatar Apr 10 '23 20:04 ilkoTheTiger