{"id":20444116,"url":"https://github.com/tknerr/linus-kitchen","last_synced_at":"2025-06-27T11:41:35.135Z","repository":{"id":10093742,"uuid":"12154453","full_name":"tknerr/linus-kitchen","owner":"tknerr","description":"An Ubuntu-based developer VM for hacking with Chef, Vagrant, Docker \u0026 Co","archived":false,"fork":false,"pushed_at":"2019-05-17T14:36:56.000Z","size":865,"stargazers_count":16,"open_issues_count":8,"forks_count":12,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-12T23:54:01.030Z","etag":null,"topics":["atom","chef","development-vm","docker","git","packer","vagrant","virtualbox"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tknerr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-08-16T08:38:46.000Z","updated_at":"2022-04-29T14:10:25.000Z","dependencies_parsed_at":"2022-08-30T14:51:37.209Z","dependency_job_id":null,"html_url":"https://github.com/tknerr/linus-kitchen","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tknerr%2Flinus-kitchen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tknerr%2Flinus-kitchen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tknerr%2Flinus-kitchen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tknerr%2Flinus-kitchen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tknerr","download_url":"https://codeload.github.com/tknerr/linus-kitchen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647234,"owners_count":21139083,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["atom","chef","development-vm","docker","git","packer","vagrant","virtualbox"],"created_at":"2024-11-15T09:51:20.712Z","updated_at":"2025-04-12T23:54:04.793Z","avatar_url":"https://github.com/tknerr.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Linus' Kitchen\n\n[![Circle CI](https://circleci.com/gh/tknerr/linus-kitchen/tree/master.svg?style=shield)](https://circleci.com/gh/tknerr/linus-kitchen/tree/master)\n\nAn Ubuntu Desktop 18.04 based development box for Infrastructure-as-Code development with Vagrant, Chef, Ansible \u0026 Co.\n\n![Linus' Kitchen Screenshot](https://raw.github.com/tknerr/linus-kitchen/master/linus_kitchen.png)\n\nYes, it is being set up with Vagrant and Chef, so it's a bit meta...\n\nIt is based on the [Zuehlke/linux-developer-vm](https://github.com/Zuehlke/linux-developer-vm) template, and also the Linux based equivalent of [Bill's Kitchen](https://github.com/tknerr/bills-kitchen) (which explains the name).\n\n## What's included?\n\n### Main tools\n\nThese are the main tools included in Linus' Kitchen (see CHANGELOG for the specific versions):\n\n  * [Ansible](https://www.ansible.com/)\n  * [ChefDK](https://downloads.chef.io/chef-dk/)\n  * [Docker](http://docker.io/)\n  * [Git](https://git-scm.org/)\n  * [Packer](http://packer.io/)\n  * [Vagrant](http://vagrantup.com/)\n  * [VirtualBox](https://www.virtualbox.org/)\n  * [Visual Studio Code](https://code.visualstudio.com/)\n  \n#### Chef-based development toolchain\n\nIn addition to Chef itself, the following tools (which are all Ruby-based) come included with ChefDK:\n\n  * [berkshelf](https://berkshelf.com/) - a dependency manager for Chef cookbooks\n  * [foodcritic](http://www.foodcritic.io/) - a lint tool for Chef cookbooks\n  * [chefspec](https://chefspec.github.io/chefspec/) - unit testing for Chef cookbooks\n  * [serverspec](http://serverspec.org/) - rspec based framework for testing servers\n  * [test-kitchen](http://kitchen.ci/) - a test driver for orchestrating and testing infrastructure\n\n#### Ansible-based development toolchain\n\nIn addition to Ansible itself, the following tools (which are all Python-based) are included:\n\n  * [ansible-galaxy](https://docs.ansible.com/ansible/galaxy.html) - a dependency manager for Ansible roles\n  * [ansible-lint](https://github.com/willthames/ansible-lint) - a lint tool for Ansible roles\n  * [testinfra](https://testinfra.readthedocs.io/) - a pytest based framework for testing servers\n  * [molecule](https://molecule.readthedocs.io/) - a test driver for orchestrating and testing infrastructure\n\n### Tweaks and Plugins\n\nOther tweaks worth mentioning:\n\n  * Scripts in `~/.bashrc.d/*.sh` are sourced from `~/.bashrc`, pre-configured with the following:\n    * sets up `be` as an alias for `bundle exec`\n    * runs `chef shell-init bash` for initializing the ChefDK\n    * configures \"virtualbox\" as the `$VAGRANT_DEFAULT_PROVIDER`\n  * Bundler is configured for parallel downloading and retrying (see `~/.bundle/config`)\n  * Customized `~/.vagrant.d/Vagrantfile` and `~/.kitchen/config.yml` for caching as much as possible\n  * Pre-installed Vagrant plugins:\n    * [vagrant-cachier](https://github.com/fgrehm/vagrant-cachier) - caches all kinds of packages you install in the vagrant VMs\n    * [vagrant-managed-servers](https://github.com/tknerr/vagrant-managed-servers) - Vagrant Provider for provisioning managed servers via SSH or WinRM\n  * Pre-installed Visual Studio Code plugins:\n    * [bbenoist.vagrant](https://marketplace.visualstudio.com/items?itemName=bbenoist.vagrant) - allows you to control Vagrant boxes from within VSCode\n    * [dhoeric.ansible-vault](https://marketplace.visualstudio.com/items?itemName=dhoeric.ansible-vault) - encrypt/decrypt Ansible vault credentials\n    * [donjayamanne.githistory](https://marketplace.visualstudio.com/items?itemName=donjayamanne.githistory) -  view and search the Git history, compare branches, do cherry-picking and more\n    * [eamodio.gitlens](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens) - Various features, most notably an inline Git blame with tooltips\n    * [felipecaputo.git-project-manager](https://marketplace.visualstudio.com/items?itemName=felipecaputo.git-project-manager) - configure a list of directories containing Git repositories and navigate through those indexed repositories easily\n    * [mde.select-highlight-minimap](https://marketplace.visualstudio.com/items?itemName=mde.select-highlight-minimap) - directly spot highlighted selections in the minimap\n    * [ms-python.python](https://marketplace.visualstudio.com/items?itemName=ms-python.python) - provides Python integration\n    * [ms-vscode.sublime-keybindings](https://marketplace.visualstudio.com/items?itemName=ms-vscode.sublime-keybindings) - Import your Sublime Text settings and keybindings\n    * [Pendrica.chef](https://marketplace.visualstudio.com/items?itemName=Pendrica.chef) - supports the Chef DSL, plenty of Chef snippets\n    * [PeterJausovec.vscode-docker](https://marketplace.visualstudio.com/items?itemName=PeterJausovec.vscode-docker) - Easily add configuration files for Docker, Docker Compose to your project. Syntax highlighting and linting for `Dockerfile` files.\n    * [rebornix.ruby](https://marketplace.visualstudio.com/items?itemName=rebornix.ruby) - Ruby integration\n    * [vscoss.vscode-ansible](https://marketplace.visualstudio.com/items?itemName=vscoss.vscode-ansible) - runs Ansible Playbooks, provides code snippets, syntax highlighting and YAML validation\n    * [yzhang.markdown-all-in-one](https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one) - Makes editing Markdown files easier. Supports e.g. creation of a TOC, some auto-completion, and export to HTML\n    * [zikalino.azure-rest-for-ansible](https://marketplace.visualstudio.com/items?itemName=zikalino.azure-rest-for-ansible) - call the Azure REST API from within VSCode, e.g. control VMs and run provided examples. Creates Ansible playbooks.\n  * Placed a `README.md` file on the Desktop to guide first time users after they logged in to the VM\n  * Symlinked [`update-vm.sh`](scripts/update-vm.sh) to `/usr/local/bin/update-vm` so it's in the `$PATH` and can be used for updating the VM from the inside (see below)\n\n## Usage\n\n### Obtaining and Starting the VM Image\n\nThe latest version of the Linus Kitchen can be downloaded as a VM image from here:\n\n  * https://github.com/tknerr/linus-kitchen/releases\n\nAfter downloading the .ova file you can import it into VMWare Fusion / Workstation Player via `File -\u003e Import...`.\nOnce imported, you can simply start the VM and log in:\n\n  * username: \"user\"\n  * password: \"user\"\n\nFrom then on just open a terminal and you will have all of the tools available (see \"What's included?\").\n\n### Updating the VM\n\nYou can run these commands from anywhere inside the VM:\n\n  * `update-vm` - update the VM by applying the Chef recipes from the locally checked out repo at `~/vm-setup`\n  * `update-vm --pull` - same as above, but update repo before by pulling the latest changes\n  * `update-vm --verify-only` - don't update the VM, only run the Serverspec tests\n  * `update-vm --provision-only` - don't run the Serverspec tests, only update the vm\n\n### Keyboard Layout and Locale Settings\n\nThe VM ships with a full `US` keyboard layout and `en_US.UTF-8` locale by default.\n\nTo change the keyboard layout to your preferred language use `System Settings... -\u003e Text Entry` in the VM.\n\nIf you have a totally different keymap (e.g. on a MacBook) you can always reconfigure it:\n```\nsudo dpkg-reconfigure keyboard-configuration\n```\n\nIf want to reconfigure the locale:\n```\nsudo dpkg-reconfigure locales\n```\n\n## Development\n\n### Prerequisites\n\nYou need [VMware Workstation Pro](https://www.vmware.com/products/workstation.html) / [VMware Fusion Pro](https://www.vmware.com/products/workstation.html) and [Vagrant](http://www.vagrantup.com/) with the [vagrant-vmware-plugin](https://www.vagrantup.com/vmware/) installed.\n\nIf you don't mind about running 64-bit VirtualBox VMs inside Linus Kitchen, you only even need [VirtualBox](http://virtualbox.org/wiki/Downloads) and [Vagrant](http://www.vagrantup.com/) installed (note that VirtualBox only supports nested 32-bit guests).\n\nAll other requirements, including ChefDK will be installed *inside the Vagrant VM* during provisioning, i.e. you don't need them installed on your host machine.\n\n### Basic Development Workflow\n\nBring up the developer VM:\n```\n$ vagrant up\n```\n\nThis will take a while, as it will do quite a few things inside the VM:\n\n 1. Setup a new user account ('user') under which the VM will be provisioned\n 2. Download and install [ChefDK](https://downloads.chef.io/chef-dk/)\n 3. Copy the current directory into the VM (will be placed in `~/vm-setup`)\n 4. Install cookbook dependencies via [Berkshelf](http://berkshelf.com/) to `~/vm-setup/cookbooks/vm/cookbooks`\n 5. Trigger a [Chef-Zero](https://www.chef.io/blog/2013/10/31/chef-client-z-from-zero-to-chef-in-8-5-seconds/) run to apply the `~/vm-setup/cookbooks/vm/recipes` to the VM (see \"What's included?\")\n 6. Verify the installation using a battery of [Serverspec](http://serverspec.org/) tests\n\nWatch the vagrant output on the console for seeing progress. At the end you\nshould see all tests passing:\n\n```\n...\n==\u003e default:\n==\u003e default: update-vm.sh\n==\u003e default:   installs chefdk 1.3.40\n==\u003e default:   symlinks the update-vm script to /usr/local/bin/\n==\u003e default:\n==\u003e default: Finished in 26.85 seconds (files took 1.08 seconds to load)\n==\u003e default: 59 examples, 0 failures\n...\n```\n\nIf these are passing as expected, you can continue developing on the Chef recipes within this repo.\nPlease don't forget to add a test for each new feature you add (see \"Contributing\")\n\n### Running the Acceptance Tests\n\nIn addition to the Serverspec tests (which verify that the installed tools are properly configured and working as expected) you can also execute a minimal acceptance test which covers the [common usage scenarios](https://github.com/tknerr/vagrant-workflow-tests/blob/master/spec/acceptance/usage_scenarios_spec.rb) when developing with Vagrant and Chef, including:\n\n  * cloning a [sample-toplevel-cookbook](https://github.com/tknerr/sample-toplevel-cookbook) and [sample-infrastructure-repo](https://github.com/tknerr/sample-infrastructure-repo)\n  * running various commands like `bundle install`, `vagrant plugin list`, `vagrant up`, etc..\n  * running different kinds of cookbook tests via `rubocop`, `foodcritic`, `chefspec` and `test-kitchen`\n\nThe acceptance test is not run by default, but you can run it manually from anywhere inside the VM:\n```\n$ git clone https://github.com/tknerr/vagrant-workflow-tests\n$ cd vagrant-workflow-tests\n$ rspec\n```\n\nIf all goes well you should see an output [like this](https://cloud.githubusercontent.com/assets/365744/3607278/0579cae2-0d45-11e4-81f0-9236c592562a.png).\n\n### Packaging\n\nWhenever you feel like distributing a fat VM image rather than a Vagrantfile,\nyou can package / export it as a VirtualBox / VMware image. This might be useful\nfor distributing the initial version of the developer VM to your dev team,\nor simply for preserving checkpoint releases as a binary images.\n\nLet's start from a clean state:\n```\n$ vagrant destroy -f\n```\n\nMake sure vagrant-cachier is disabled when you bring up the VM for packaging:\n```\n$ unset GLOBAL_VAGRANT_CACHIER_ENABLED\n$ vagrant up\n```\n\nThis will provision the VM as usual. Once the provisioning succeeded, we will\ndo a few cleanup steps before packaging the VM.\n\nFirst, unmount the /vagrant shared folder:\n```\n$ vagrant ssh -c \"sudo umount /vagrant -f\"\n```\n\nThen remove the vagrant user account:\n```\n$ vagrant ssh -c \"sudo pkill -KILL -u vagrant\"\n$ vagrant ssh -c \"sudo userdel -f -r vagrant\"\n```\n\nFinally, shutdown the VM, remove the sharedfolder, and export the VM as an .ova file:\n\nFor VirtualBox:\n```\n$ vagrant halt\n$ VBoxManage sharedfolder remove \"Linus Kitchen\" --name \"vagrant\"\n$ VBoxManage modifyvm \"Linus Kitchen\" --name \"Linus Kitchen v0.1.0\"\n$ VBoxManage export \"Linus Kitchen v0.1.0\" --output \"linus-kitchen-v0.1.0_virtualbox.ova\" --options manifest,nomacs\n```\n\nFor VMware:\n```\n$ vagrant halt\n$ VMX_FILE=`cat .vagrant/machines/default/vmware_fusion/id`\n$ ovftool --name=\"Linus Kitchen v0.1.0\" \"$VMX_FILE\" linus-kitchen-v0.1.0_vmware.ova\n```\n\nDon't forget to throw away the VM when you are done:\n```\n$ vagrant destroy -f\n```\n\n## Contributing\n\n 1. Fork the repository on Github\n 1. Create a named feature branch (like `feature/add-xyz`)\n 1. Implement your changes, add tests\n 1. Commit and push\n 1. Submit a Pull Request via Github\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftknerr%2Flinus-kitchen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftknerr%2Flinus-kitchen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftknerr%2Flinus-kitchen/lists"}