

The base VM image is downloaded – if it does not already exist on your Windows host and subsequently Vagrant engages with VirtualBox to create the VM according to the configuration settings. This will run Vagrant and have it process the local vagrantfile. Open a Windows command line and cd to that directory. To create and run the VM, write the following Vagrantfile to a directory:, for example using The prerequisites for following along: have a recent version of Vagrant and VirtualBox installed. I will briefly show how to create/start the VM, SSH into it to create a terminal session, run a Docker file from the Windows host to run a container and to halt and restart. Vagrant takes care of installing Docker into the VM, of configuring the Network, for mapping a local host directory into the VM and for creating a larger-than-normal disk for the Ubuntu VM.

In this article, I share the very simple Vagrant script that I am using to spin up and manage VMs in which I run Docker containers. Based on simple declarative definitions – text files – it will configure the VM and take care of it. It interacts with the VirtualBox APIs, to create, start, pause and resume and stop the VMs. Vagrant runs on the Windows machine as a command line tool. VirtualBox runs the VM and takes care of network from and to the VM as well as mapping local directories on the Windows host machine into the VM. The easiest way for me to create and run Docker enabled VMs is using combination of Vagrant and VirtualBox. But whenever I want to have more control over the Linux environment that runs the Docker host, or I want to run multiple such envionments in parallel, I like to just run VMs under my own control and use them to run Docker inside.

Using the Docker Quickstart Terminal is one way of doing so, and to some extent that works fine. And of course I want to work with Docker containers.
