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

user_data bash script dont work #144

Closed
ngabsf opened this issue Jun 10, 2022 · 2 comments
Closed

user_data bash script dont work #144

ngabsf opened this issue Jun 10, 2022 · 2 comments

Comments

@ngabsf
Copy link

ngabsf commented Jun 10, 2022

Hello, I am trying to launch a script through user_data if I remember correctly, I could do it in the same way, but maybe I have something wrong in the syntax.

user_data.sh
#!/bin/bash
apk add htop

TF_LOG
2022-06-10T03:18:00.227-0400 [INFO] Terraform version: 1.2.2
2022-06-10T03:18:26.104-0400 [DEBUG] provider.terraform-provider-virtualbox_v0.2.2-alpha.1.exe: pid-5456-resource_vm.go:605: [DEBUG] Network adapter: {Network:bridged Hardware:82545EM HostInterface:Qualcomm Atheros AR956x Wireless Network Adapter MacAddr:}
2022-06-10T03:18:37.681-0400 [WARN] unexpected data: registry.terraform.io/terra-farm/virtualbox:stdout="Waiting for VM "vm_test" to power on...
VM "vm_test" has been successfully started."
2022-06-10T03:18:37.703-0400 [DEBUG] provider.terraform-provider-virtualbox_v0.2.2-alpha.1.exe: pid-5456-resource_vm.go:335: [DEBUG] Resource ID: b5b03c4c-27dd-41c7-b13e-9d3870d66eb9
2022-06-10T03:18:37.703-0400 [DEBUG] provider.terraform-provider-virtualbox_v0.2.2-alpha.1.exe: pid-5456-resource_vm.go:813: [INFO] Waiting for VM (vm_test) to have network_adapter.0.ipv4_address_available of [yes]
2022-06-10T03:18:37.703-0400 [DEBUG] provider.terraform-provider-virtualbox_v0.2.2-alpha.1.exe: pid-5456-state.go:52: [DEBUG] Waiting for state to become: [yes]

2022-06-10T03:19:09.059-0400 [WARN] Provider "provider["registry.terraform.io/terra-farm/virtualbox"]" produced an unexpected new value for virtualbox_vm.TEST_VM[0], but we are tolerating it because it is using the legacy plugin SDK.
The following problems may be the cause of any confusing errors from downstream operations:

- .user_data: was cty.StringVal("#!/bin/bash\r\napk add htop"), but now cty.StringVal("#!/bin/bash\r\r\napk add htop")

2022-06-10T03:19:09.065-0400 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2022-06-10T03:19:09.082-0400 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/terra-farm/virtualbox/0.2.2-alpha.1/windows_amd64/terraform-provider-virtualbox_v0.2.2-alpha.1.exe pid=5456
2022-06-10T03:19:09.082-0400 [DEBUG] provider: plugin exited

@Kraktorist
Copy link

Kraktorist commented Jul 19, 2022

There is no built-in cloud-init mechanism in VirtualBox. And as I see nothing similar hasn't been implemented in this provider.
user_data parameter runs the following command:
VBoxManage setextradata RESOURCE_VM user_data YOUR_USER_DATA (doc)
This command attaches a tag user_data to the created box but this tag is not supposed to be accessible from inside the instance.

See this not resolved bug as well #89

@VoyTechnology
Copy link
Member

Closing as we are aware of the issue - tracked in #150

@VoyTechnology VoyTechnology closed this as not planned Won't fix, can't repro, duplicate, stale Sep 2, 2022
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

3 participants