Minimal Linux with Packer and Vagrant

As an IT professional, it’s important to take the time to sharpen your tools. And as a systems programmer and project leader in research computing, one of my most valuable tools is a lean, mean operating system install. Prior to the deployment of Wharton’s High Performance Computing Cluster (HPCC), the goal was to reacquaint myself with a minimal Linux from scratch. Enter Packer – a tool for building machine images.

Here I am using Packer to build an image for VirtualBox containing a minimal CentOS 7 install:

Getting started…

Next let’s take a look at our packer file: centos7.json

Make sure to update the above json for the exact ISO filename and checksum. The anaconda installer in CentOS also needs to know what to do via a kickstart file: ks.cfg

Now that we have a Packer and a kickstart file, we can issue the Packer build command:

It is pretty neat to watch packer do its thing. Packer will now boot a virtual machine from the ISO, using the kickstart file to configure it. If all goes according to plan, we’ll have a box file that we can open via Vagrant.

On that note, let’s take a look at a minimal Vagrant config file: Vagrantfile

We can now take the minimal OS for a test drive with these commands:

All of this marked the beginning of Red Hat Enterprise Linux 7 support for the Wharton HPCC system (CentOS being binary compatible with RHEL).

As a specialist in Linux and high-performance computing, Burris enjoys enabling faculty within The Wharton School of the University of Pennsylvania by providing effective research computing resources. Burris has been involved in research computing since 2001. Current projects find Burris working with HPC, big data, cloud computing and grid technologies. His favorite languages are Python and BASH. In his free time, he enjoys bad cinema, video editing, synthesizers and bicycling.