terra-farm / terraform-provider-virtualbox

VirtualBox provider for Terraform
https://terra-farm.github.io/provider-virtualbox/
MIT License
324 stars 136 forks source link

VM Fails to become read #34

Closed hiucimon closed 2 years ago

hiucimon commented 5 years ago

MacOS High Sierra Version 5.2.18 r124319 (Qt5.6.3)

Using the sample, with count = 1, The instances are stood up, but repeated failures to get "showvminfo" causes overall failure with these messages at the end of the debug log:

2018-09-21T09:07:33.606-0400 [DEBUG] plugin.terraform-provider-virtualbox: pid-12628-vbm.go:75: executing: VBoxManage showvminfo 9609356b-e960-42d0-a1fe-81c27ccbf6b1 --machinereadable
2018-09-21T09:07:33.688-0400 [DEBUG] plugin.terraform-provider-virtualbox: pid-12628-vbm.go:60: executing: VBoxManage getextradata node-01 user_data
2018-09-21T09:07:33.727-0400 [DEBUG] plugin.terraform-provider-virtualbox: pid-12628-vbm.go:60: executing: VBoxManage guestproperty get node-01 /VirtualBox/GuestInfo/Net/0/MAC
2018-09-21T09:07:33.767-0400 [DEBUG] plugin.terraform-provider-virtualbox: pid-12628-state.go:193: [TRACE] Waiting 10s before next try
2018-09-21T09:07:43.769-0400 [DEBUG] plugin.terraform-provider-virtualbox: pid-12628-vbm.go:75: executing: VBoxManage showvminfo 9609356b-e960-42d0-a1fe-81c27ccbf6b1 --machinereadable
2018-09-21T09:07:43.864-0400 [DEBUG] plugin.terraform-provider-virtualbox: pid-12628-vbm.go:60: executing: VBoxManage getextradata node-01 user_data
2018-09-21T09:07:43.904-0400 [DEBUG] plugin.terraform-provider-virtualbox: pid-12628-vbm.go:60: executing: VBoxManage guestproperty get node-01 /VirtualBox/GuestInfo/Net/0/MAC
2018-09-21T09:07:43.944-0400 [DEBUG] plugin.terraform-provider-virtualbox: pid-12628-state.go:193: [TRACE] Waiting 10s before next try
2018-09-21T09:07:46.490-0400 [DEBUG] plugin.terraform-provider-virtualbox: pid-12628-state.go:218: [WARN] WaitForState timeout after 5m0s
2018-09-21T09:07:46.490-0400 [DEBUG] plugin.terraform-provider-virtualbox: pid-12628-state.go:219: [WARN] WaitForState starting 30s refresh grace period
2018-09-21T09:07:46.491-0400 [DEBUG] plugin.terraform-provider-virtualbox: pid-12628-resource_vm.go:343: [ERROR] Wait VM unitl ready: Error waiting for VM (node-01) to become ready: timeout while waiting for state to become 'yes' (timeout: 5m0s)
2018/09/21 09:07:46 [DEBUG] plugin: waiting for all plugin processes to complete...
2018-09-21T09:07:46.502-0400 [DEBUG] plugin.terraform-provider-virtualbox: pid-12628-rpc_server.go:48: [ERR] plugin: plugin server: accept unix /var/folders/v0/v9xm5xps3gschkk3gfp0snbsc3d7ph/T/plugin676224955: use of closed network connection
2018-09-21T09:07:46.503-0400 [DEBUG] plugin: plugin process exited: path=/Users/ndb338/Virtualbox/terraform-provider-virtualbox

I would like to note that I am willing to help with this project if you need it, but I have had some issues with your "build from source" directions. Some things I may be willing to add are the ability to handle 7zip files for images, testing to see if the image is newer than the directory contents, and automatic key refresh if keys are provided and the image has the default vagrent keys.

hiucimon commented 5 years ago

I meant to note that if I give it a single adapter and make it NAT, it comes up fast, but obviously has no IP address.

nevill commented 5 years ago

After several hours on it, I am sure that the example provided by this project is totally not working. Then I found the image from original author, which works well 😭.

The key is the base image should have guest addition installed. Also, take care of the host interface, should be an interface with DHCP enabled. If not, better set network type to hostonly, and interface to something like vboxnet1, exactly like what vagrant does.

VoyTechnology commented 5 years ago

@hiucimon does your offer to help still stand? We are looking to increase the general health of the project.

VoyTechnology commented 2 years ago

This sounds like the same issue as https://github.com/terra-farm/terraform-provider-virtualbox/pull/112, and is subsequent fix https://github.com/terra-farm/terraform-provider-virtualbox/pull/113. Since this is an old issue which might not be reproducable with newer version of the code I am going to close it.