# Bootstrap on windows

**URL:** <https://discourse.chef.io/t/bootstrap-on-windows/9324>\
**Category:** Chef Infra (archive)\
**Created:** [September 6, 2016, 10:22am UTC](https://discourse.chef.io/t/bootstrap-on-windows/9324 "2016-09-06T10:22:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ofir](https://avatars.discourse-cdn.com/v4/letter/o/53a042/32.png) [@ofir](https://discourse.chef.io/u/ofir)\
**Post date:** [September 6, 2016, 10:22am UTC](https://discourse.chef.io/t/bootstrap-on-windows/9324/1 "2016-09-06T10:22:10Z")

</div>

Hi,

I started using chef and got into different behavior on widows than on linux,  
while bootstrap on linux the knife bootstrap actually performing the recipes actions and print the output to the screen.  
but when bootstrap on windows the command only generate a batch script on the windows machine, then I have to execute it manually in my self.

this is the output of what actually happens:

[root@chef-workstation chef-repo]# knife bootstrap windows winrm 10.100.11.106 --winrm-user ‘chef-win08r2-node\administrator’ --winrm-password ‘\*\*\*\*\*\*\*\*\*\*’ --node-name Win-node --run-list 'role[ora\_11201\_Win64]'  
Node Win-node exists, overwrite it? (Y/N) Y  
Client Win-node exists, overwrite it? (Y/N) Y  
Creating new client for Win-node  
Creating new node for Win-node

Waiting for remote response before bootstrap.10.100.11.106 .  
10.100.11.106 Response received.  
Remote node responded after 0.0 minutes.  
10.100.11.106 AMD64  
Bootstrapping Chef on 10.100.11.106  
10.100.11.106 Rendering “C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-4722-1472902123.bat” chunk 1  
10.100.11.106 Rendering “C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-4722-1472902123.bat” chunk 2  
10.100.11.106 Rendering “C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-4722-1472902123.bat” chunk 3  
10.100.11.106 Rendering “C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-4722-1472902123.bat” chunk 4  
10.100.11.106 Rendering “C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-4722-1472902123.bat” chunk 5  
10.100.11.106 Rendering “C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-4722-1472902123.bat” chunk 6  
10.100.11.106 Rendering “C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-4722-1472902123.bat” chunk 7  
[root@chef-workstation chef-repo]#  
[root@chef-workstation chef-repo]#  
[root@chef-workstation chef-repo]#

is it possible to make the process of bootstrap on windows automatic as in linux?

Thanks, Ofir.

---

<div class="post-metadata">

**Author:** ![ofir](https://avatars.discourse-cdn.com/v4/letter/o/53a042/32.png) [@ofir](https://discourse.chef.io/u/ofir)\
**Post date:** [September 13, 2016, 2:22pm UTC](https://discourse.chef.io/t/bootstrap-on-windows/9324/2 "2016-09-13T14:22:06Z")

</div>

Any suggestions?  
I saw in examples that the bootstrap also execute the cookbook from remote.  
What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![Matt\_Wrock](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/matt_wrock/32/3394_2.png) [@Matt\_Wrock](https://discourse.chef.io/u/Matt_Wrock)\
**Post date:** [September 14, 2016, 1:04am UTC](https://discourse.chef.io/t/bootstrap-on-windows/9324/3 "2016-09-14T01:04:36Z")

</div>

We have seen this happen on Windows 2008 (not 2008R2) where knife-windows uses an incompatible codepage. In that case, invoking the generated `bootstrap-*.bat` file simply does nothing and does not invoke the script.

You might try check the temporary directory on the node to see if a .bat file starting with `bootstrap-` exists. If it does, try running that script via `knife winrm -m [your node's IP or FQDN] "[path to .bat file]"` Finally if that stalls, try running it in a remote desktop session locally. Neither of these solutions are even close to ideal so please report back with what you found so we can try to better address the core problem.

You might also try installing knife-windows 1.6.0 which has the fix for windows 2008 and you could see if it also fixes your 2008R2 environment. Be aware that version has some new gem dependencies that are incompatible with the current chef-dk. So if you are a chef-dk user, you would be best off installing knife-windows 1.6 via a chef-dk build from our current channel. You can find the latest at [https://packages.chef.io/current/windows/2012r2/chefdk-0.18.13-1-x86.msi](https://packages.chef.io/current/windows/2012r2/chefdk-0.18.13-1-x86.msi).

---

<div class="post-metadata">

**Author:** ![ofir](https://avatars.discourse-cdn.com/v4/letter/o/53a042/32.png) [@ofir](https://discourse.chef.io/u/ofir)\
**Post date:** [September 14, 2016, 1:09pm UTC](https://discourse.chef.io/t/bootstrap-on-windows/9324/4 "2016-09-14T13:09:36Z")

</div>

> [@Matt\_Wrock](#):
>
> directory

Thanks for the answer!

The server is actually windows server 2008R2.  
The bootstrap-\*bat script is created in the temp directory, and it is running successfully by local execution.  
I tested the bootstrap on 2012 server and it seems to execute the script as well.

so it seems to be a problem with the specific version of windows server as you mention.  
also I tried to execute the script from remote as you suggested but it seems like it does nothing:

[root@chef-workstation chef-repo]# knife winrm -m 10.100.11.106 "C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-3097-1473780267.bat"  
Enter your password:  
[root@chef-workstation chef-repo]# knife winrm -m 10.100.11.106 --winrm-user 'chef-win08r2-node\administrator' --winrm-password '\*\*\*\*\*\*\*' "C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-3097-1473780267.bat"  
[root@chef-workstation chef-repo]#

my workstation and server are linux platform not windows, is it a problem?  
should I create another server and work station for windows as well?

Thanks, Ofir.

---

<div class="post-metadata">

**Author:** ![Matt\_Wrock](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/matt_wrock/32/3394_2.png) [@Matt\_Wrock](https://discourse.chef.io/u/Matt_Wrock)\
**Post date:** [September 15, 2016, 1:14am UTC](https://discourse.chef.io/t/bootstrap-on-windows/9324/5 "2016-09-15T01:14:48Z")

</div>

This should work from linux just as well as from windows. I would first try using knife-windows 1.6.0 to see if the many bug fixes in that release may impact your scenario. As I mentioned before, installing knife-windows 1.6.0 in an existing chef-dk environments may cause gem conflicts. You can alternatively try installing the above linked chef-dk that has all of its gems compatible with knife-windows 1.6.0. We will be officially releasing the new chef-dk (a slightly updated version) next week.
