Skip to content
Switch branches/tags
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

DD Vagrant Boxes

This repository contains few helper scripts that will help you to build and store your Vagrant boxes.

How To Build Vagrant Boxes

Create and setup a new virtual machine

First, you need to create a new VM in Virtualbox, for this example we call it fedora24.

Then, add a port forwarding rule to the network adapter. Right click on the virtual machine name, then select Settings -> Network -> Adapter 1 -> Advanced -> Port Forwarding -> Plus icon and use the following settings:

  • Name: ssh
  • Protocol: TCP
  • Host IP:
  • Host Port: 2222
  • Guest IP: leave this field blank
  • Guest Port: 22

You can now start the operating system installation, also you need to make a user called vagrant as administrator.

When OS installation is completed, add vagrant user to sudoers to enable password-less sudo and disable requiretty. For that, you need to login to the virtual machine, then add the following lines to /etc/sudoers file.

Defaults:vagrant !requiretty

Now, install Virtualbox Guest Additions and its dependencies, e.g. the kernel-devel package in Fedora.

You also need to enable and start sshd service.

$ sudo systemctl enable sshd
$ sudo systemctl start sshd

Logout from the virtual machine and generate a new ssh key for vagrant user on your local computer:

$ cd $HOME/.ssh
$ ssh-keygen -t rsa -C vagrant@localhost -f vagrant.id_rsa

Then, run scripts/ to add the vagrant ssh public key to your VM. You can test the ssh key with:

$ ssh -i vagrant.id_rsa -p 2222 vagrant@

Finally, power off the virtual machine as it is ready for creating Vagrant boxes.

Create new Vagrant box

Generate a new Vagrantfile file:

$ scripts/ fedora24 1.0

Build a new vagrant box:

$ scripts/ fedora24 1.0

Generate a new json file:

$ scripts/ fedora24 1.0 "Fedora 24 base image."

Now, you can add the new box to your Vagrant:

$ scripts/ fedora24 1.0

Ok, it's time to test the new box:

$ cd tests
$ vagrant init fedora24
$ vagrant up


This project is licensed under a MIT license. Please read the LICENSE file.


Building Vagrant boxes from scratch ... automatically !




No releases published


No packages published