Contributors30 minutesHere you'll make sure that your workstation is set up for Chef development and also install the virtualization software.
This module uses Test Kitchen along with VirtualBox and Vagrant to manage test instances. This combination is popular with Chef users because it uses free software and is easy to set up.

VirtualBox is a hypervisor that manages your virtual machine instances. Think of it as the software that hosts your VM instances.
Vagrant makes it easier to work with hypervisors such as VirtualBox. Vagrant uses a configuration file, called a Vagrantfile, to describe aspects of the virtual machine such as available memory, host name, and network settings.
Vagrant also provides access to base virtual machine images, called boxes. Vagrant Cloud is a place where you can access prebuilt boxes or upload new boxes for others to use. Bento is a Chef project that provides ready-to-use Vagrant boxes for many common platforms. In this module, you'll use CentOS, a free computing platform that's functionally compatible with Red Hat Enterprise Linux.
Test Kitchen enables you to specify details about your virtual machine, including its operating system, available memory, host name, and network settings, and how to run Chef – including which recipes and which tests to run. Test Kitchen builds the Vagrantfile for you and is the interface you use to create, destroy, and run Chef on your instances. Test Kitchen also downloads the Vagrant box for you as needed.
| This page explains the manual steps to help you understand exactly what software you need to install and how to install it. Alternatively, you can also run the ChefDK_Bootstrap script to set up your Windows or Mac workstation for Chef development. The script installs commonly used development tools such as the Atom text editor, Git, VirtualBox, and Vagrant. |
Before you begin
Your workstation – the system from which you develop your cookbooks – can be a physical machine or a virtual machine that supports nested virtualization.
Ensure that your workstation supports and is configured to use CPU virtualization. This setting is typically configured through your system's BIOS. If you're using a virtual machine as your workstation through a program such as VMware Fusion, ensure that nested virtualization is enabled on the workstation VM.
Also ensure that your workstation meets the system requirements for running VirtualBox.
VirtualBox does not run in virtualized workstation environments such as Amazon EC2 or a VirtualBox host instance. With some modification, you can use another Test Kitchen driver if you're unable to run VirtualBox. (Or, you can choose a different variation of this module if you're unable to run VirtualBox.)
1. Set up your workstation for Chef development
Although this module doesn't involve the Chef server or bootstrapping a node, we recommend that you complete Manage a Red Hat Enterprise Linux node with Chef server before starting this module.
If you prefer to learn about local development now, before learning how to bootstrap a node, perform these steps to set up your workstation. Then come back to this page.
At this point, your workstation should:
- have the latest version of Chef Workstation.
- have a programmer's text editor that you're comfortable working with.
- have the
~/learn-chef directory for you to work in. - have Git and an SSH client.
Having Git is important because you'll use it to download starter code to work with.
Having an SSH client is important because you'll use it to log in to your Linux instance to verify your work.
2. Install VirtualBox and Vagrant
If you already use VirtualBox and Vagrant or have gone through the Learn Chef modules that use them, then you're already set up.
If you're new to VirtualBox and Vagrant, the Learn the Chef basics module can help you get set up. You can follow the steps that have you bring up a CentOS instance to verify the installation. However, you don't need to connect to or install Chef Workstation on your CentOS instance.