1

I am receiving the following error when trying to run any command in 'kitchen':

bash: /mnt/c/opscode/chefdk/bin/kitchen: C:/opscode/chefdk/embedded/bin/ruby.exe: bad interpreter: No such file or directory

It works from outside integrated bash when using the chefdk client, however I am trying to get this working from integrated bash.

Chef utility commands such as 'chef-client' and 'knife' seem to be working so far.

Serverless chap
  • 183
  • 1
  • 9
aphexlog
  • 1,503
  • 3
  • 16
  • 43

2 Answers2

2

A possible solution for the SSH key permissions issue below

We REALLY need to get this working all the way through because it is SO much faster than the native ChefDK on Windows! The below will get you closer:

  1. Stop Windows From Sharing PATH with WSL

    • Use Regedit.exe to create a DWORD DistributionFlags with value fffffffd under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LxssManager. Then go to Services and restart the LxssManager service.
  2. Download and install ChefDK and Vagrant for Ubuntu in WSL

  3. Add some windows paths to your WSL Path

    export PATH="$PATH:/mnt/d/bin/Oracle/VirtualBox:/mnt/c/Windows/System32:/mnt/c/Windows/System32/WindowsPowerShell/v1.0"

  4. Allow Vagrant Windows Access

    export VAGRANT_WSL_ENABLE_WINDOWS_ACCESS='1'

  5. Run kitchen converge and it now works

  6. Running kitchen login still has issues. It complains about insecure vagrant private key:

    /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/test-kitchen-1.22.0/lib/kitchen/instance.rb:217: warning: Insecure world writable dir /home/dgames/.yadr/bin in PATH, mode 040777 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0777 for '/mnt/k/20180707-mbp/repos/github/cloud/ssl_certs/.kitchen/kitchen-vagrant/all-cacerts-centos-72/.vagrant/machines/default/virtualbox/private_key' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored. Load key "/mnt/k/20180707-mbp/repos/ge_github/cloud/ssl_certs/.kitchen/kitchen-vagrant/all-cacerts-centos-72/.vagrant/machines/default/virtualbox/private_key": bad permissions vagrant@127.0.0.1's password:

DaxGames
  • 41
  • 4
1

We haven't set things up to work with WSL as the Windows ChefDK installers are native Windows-y builds of everything. I recommend using the bash from MSYS2 if you want that as a shell.

coderanger
  • 52,400
  • 4
  • 52
  • 75