Skip to content

Instantly share code, notes, and snippets.

@bdwyertech
Last active April 21, 2022 09:52
Show Gist options
  • Save bdwyertech/b065086f721fbe89d73a9b89a2fc0af2 to your computer and use it in GitHub Desktop.
Save bdwyertech/b065086f721fbe89d73a9b89a2fc0af2 to your computer and use it in GitHub Desktop.
Windows Subsystem for Linux - ChefDK
# Update to Latest Windows 10 Spring Refresh
# Install WSL
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
# Get Ubuntu installed - https://docs.microsoft.com/en-us/windows/wsl/install-on-server
wsl.exe
# Install ChefDK deb package
# Symlink Relevant Home Folders
cd ~
ln -s /mnt/c/Users/DwyerB/.aws/ .
ln -s /mnt/c/Users/DwyerB/.chef/ .
ln -s /mnt/c/Users/DwyerB/.ssh/ .
# Enable Regular Permissions
# /etc/wsl.conf
[automount]
enabled = true
options = "metadata,umask=77" # fmask=111 ? Not sure what fmask does yet
# Make it take effect Immediately
sudo umount /mnt/c
sudo mount -t drvfs C: /mnt/c -o metadata,uid=1000,gid=1000,umask=77
# Create Relevant PowerShell Functions
function kitchen
{
wsl kitchen $args
}
function knife
{
wsl knife $args
}
@bdwyertech
Copy link
Author

For GPG behind a proxy

RVM Installation

sudo apt-key adv --keyserver keyserver.ubuntu.com --keyserver-options http-proxy=$http_proxy --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB

@mcascone
Copy link

mcascone commented May 7, 2019

@bschmoll that was basically my experience as well, although i first tried the Debian install. I eventually found this article that just led me to execute bash in a cmd window, and it worked.
The symlinks in the OP's gist are very helpful; now I'm trying to figure out how to get knife and kitchen to work. The error i get is:
bash: /mnt/c/opscode/chefdk/bin/kitchen: C:/opscode/chefdk/embedded/bin/ruby.exe: bad interpreter: No such file or directory
So i think i have to set a new ruby PATH? I'm not very good at this kind of thing - i get it, but i tend to not know where to look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment