hashicorp / hashicorp/packer-plugin-virtualbox

Chef-solo provisioning on Windows

Open
#14 0 comments 0 reactions 0 assignees View on GitHub
bug builder/virtualbox community-supported plugin provisioner/chef windows-guest
Dominant language
Go
Stars
29
Forks
45
PR merge metrics
No merged PRs in 30d

Description

_This issue was originally opened by @Chan9390 as hashicorp/packer#5220. It was migrated here as a result of the [Packer plugin split](https://github.com/hashicorp/packer/issues/8610#issuecomment-770034737). The original body of the issue is below._


**Chef solo isn't installing on Windows Server 2008 R2**. Other provisioning like shell and powershell are working fine, but when it comes to chef-solo provisioning, the **inbuilt installation script gets stuck**.

I tried the following workarounds:
- Overriding the inbuilt command with `install_command`. Doesnt work
- Have a shell provisioning with installation command. Doesnt work
- Have a powershell provisioning with installation command. Doesnt work

The guest VM is *Windows Server 2008 R2*. It has dotNet 4.5 and Windows Management Framework 5.0 installed (Powershell v5 is present).

- Packer version : Tested with 1.0.0 and 1.0.3
- Host platform : Ubuntu 16.04
- End output from logs:
```
2017/08/04 21:10:01 [INFO] (telemetry) Starting provisioner chef-solo
2017/08/04 21:10:01 ui: ==> virtualbox-iso: Provisioning with chef-solo
2017/08/04 21:10:01 ui: virtualbox-iso: Installing Chef...
2017/08/04 21:10:01 packer: 2017/08/04 21:10:01 opening new ssh session
2017/08/04 21:10:01 packer: 2017/08/04 21:10:01 starting remote command: powershell.exe -Command ". { iwr -useb https://omnitruck.chef.io/install.ps1 } | iex; Install-Project"
2017/08/04 21:10:22 ui: virtualbox-iso:
2017/08/04 21:10:22 ui: virtualbox-iso: ModuleType Version Name ExportedCommands
2017/08/04 21:10:22 ui: virtualbox-iso: ---------- ------- ---- ----------------
2017/08/04 21:10:22 ui: virtualbox-iso: Script 0.0 Omnitruck {Get-ProjectMetada...
```

- Provisioning script:
```
{
"type": "chef-solo",
"guest_os_type": "windows",
"cookbook_paths": ["chef/cookbooks"],
"run_list": [
"recipe[metasploitable::root_certs]",
"recipe[metasploitable::vagrant_ssh]",
"recipe[metasploitable::disable_auto_logon]",
"recipe[metasploitable::enable_rdp]"
]
},
```

Look at the entire script [here](https://github.com/rapid7/metasploitable3/blob/windows_chef/windows_2008_r2.json).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.